Skip to content

Grafana Loki SDK

Grow Codes CI License

One API for Grafana Loki in five languages: TypeScript, Rust, Go, Python and Java. Every package has the same functions, options, defaults, error codes and behaviour, tested against a real grafana/loki:3.7.10 in Docker.

Language Package Coverage
TypeScript @grow-codes/grafana-loki TypeScript coverage
Rust grow-grafana-loki Rust coverage
Go github.com/grow-codes-packages/grafana-loki/go Go coverage
Python grow-grafana-loki Python coverage
Java codes.grow.packages:grafana-loki Java coverage

What you get

  • Client with health, authenticated ping and server version (Client).
  • Configuration from code or GROW_GRAFANA_LOKI_* / vendor environment variables, immutable and validated (Configuration).
  • Retries with full-jitter backoff and Retry-After, connect/request/total timeouts and cancellation in every language.
  • Typed errors with one set of codes across languages (Error handling).
  • Redaction everywhere: credentials never appear in errors, logs, hooks or toString (Redaction).
  • Logging: batching log client, logger facade, redaction processor, framework adapters and log search (Logging).
  • Service functions for the Grafana Loki API (Functions).

Start with Install and the Quickstart.

Independent project

This SDK is made by Grow Codes. Grafana Loki is a trademark of its owner (Grafana Labs); this project is not affiliated with or endorsed by it. See License & disclaimer.