-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ITKDev: Fixed sending data into loki
- Loading branch information
Showing
10 changed files
with
101 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
modules/os2forms_audit/src/Service/LokiClientInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace Drupal\os2forms_audit\Service; | ||
|
||
/** | ||
* Interface for sending log messages to Loki ingestion endpoint. | ||
*/ | ||
interface LokiClientInterface { | ||
|
||
/** | ||
* Send a log message to Loki ingestion endpoint. | ||
* | ||
* Message format sent to loki in the following json format. | ||
* { | ||
* "Streams": [ | ||
* { | ||
* "stream": { | ||
* "label": "value" | ||
* }, | ||
* "values": [ | ||
* [ "<unix epoch in nanoseconds>", "<log line>"] | ||
* ] | ||
* } | ||
* ] | ||
* } | ||
* | ||
* @param string $label | ||
* Loki global label to use. | ||
* @param int $epoch | ||
* Unix epoch in nanoseconds. | ||
* @param string $line | ||
* The log line to send. | ||
* @param array $metadata | ||
* Extra labels/metadata to filter on. | ||
* | ||
* @see https://grafana.com/docs/loki/latest/reference/api/#ingest-logs | ||
*/ | ||
public function send(string $label, int $epoch, string $line, array $metadata = []): void; | ||
|
||
} |