Better Stack Logs SDK¶
One API for Better Stack Logs in five languages: TypeScript, Rust, Go, Python and Java. Every package has the same functions, options, defaults, error codes and behaviour, tested in Docker against a contract-verified Better Stack stub (ingest host + ClickHouse-HTTP SQL host).
| Language | Package | Coverage |
|---|---|---|
| TypeScript | @grow-codes/better-stack-logs |
|
| Rust | grow-better-stack-logs |
|
| Go | github.com/grow-codes-packages/better-stack-logs/go |
|
| Python | grow-better-stack-logs |
|
| Java | codes.grow.packages:better-stack-logs |
What you get¶
- Client with health and authenticated ping on both Better Stack hosts, each with its own credentials (Client).
- Ingest as JSON, NDJSON or MessagePack with gzip and
dttimestamps, plus an OTLP/HTTP logs exporter (Ingest). - SQL query through the ClickHouse HTTP interface with server-side parameters,
searchLogsover hot and cold storage andwaitForLog(SQL query). - Configuration from code or
GROW_BETTER_STACK_LOGS_*/ 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).
- Every function with examples in all five languages (Functions).
Start with Install and the Quickstart.
Independent project
This SDK is made by Grow Codes. Better Stack Logs is a trademark of Better Stack, Inc. This project is not affiliated with or endorsed by Better Stack, Inc. See License & disclaimer.