frostfs-observability/logging/lokicore/loki/README.md
Evgenii Stratonikov afb5f2b857 [#7] .forgejo: Add pre-commit
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-01-31 15:05:29 +03:00

32 lines
558 B
Markdown

# git.frostfs.info/TrueCloudLab/frostfs-observability/loki"
A simple asynchronous client in Go for sending logs to Loki.
## Usage
```go
package main
import (
"time"
"git.frostfs.info/TrueCloudLab/frostfs-observability/logging/lokicore/loki"
)
func main() {
loki := loki.Setup(loki.Config{
Address: "localhost:3100/api/prom/push",
Labels: map[string]string{
"label": "test",
},
BatchWait: 1000,
BatchEntriesNumber: 200,
Enabled: true,
})
defer loki.Shutdown()
loki.Send("log message", time.Now())
}
```