frostfs-observability/logging/lokicore/loki
Evgenii Stratonikov 99465e6639 [#7] loki: Fix linter issues
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-01-31 14:54:34 +03:00
..
example [#7] loki: Fix linter issues 2024-01-31 14:54:34 +03:00
log.go [#7] loki: Fix linter issues 2024-01-31 14:54:34 +03:00
README.md [#5] logs: Add Loki 2023-11-01 14:17:34 +03:00
send.go [#5] logs: Add Loki 2023-11-01 14:17:34 +03:00
setup.go [#5] logs: Add Loki 2023-11-01 14:17:34 +03:00

git.frostfs.info/TrueCloudLab/frostfs-observability/loki"

A simple asynchronous client in Go for sending logs to Loki.

Usage

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())
}