Accepts a BetterStackConfig or plain options. Throws ConfigError when invalid.
The HTTP ingest exporter (JSON encoding, default limits). Requires the ingest side.
The OTLP/HTTP logs exporter (protobuf). Requires the ingest side.
Flushes and closes every log client, then releases connections. Idempotent; later calls on
the client (and on its exporters and query client) raise CancelledError.
Unauthenticated liveness. With a query host: GET {queryUrl}/ping (Ok.). Ingest-only:
GET {url}/ without credentials (any answer below 500 proves the host is reachable; no data
is sent). Never throws except CANCELLED (also on a closed client) / CONFIG.
A batching BetterStackLogClient over the HTTP ingest API (default) or OTLP. close flushes and closes every log client it created. Requires the ingest side.
A new HTTP ingest exporter with its own encoding and limits (use it with
new BetterStackLogClient(exporter) or for BetterStackLogExporter.sendEvents).
Requires the ingest side; invalid options throw ValidationError.
A new OTLP/HTTP logs exporter with its own protocol, scope name and limit. Requires the ingest side.
Authenticated round trip; returns the latency in ms. With query credentials:
SELECT count() AS c FROM remote(<sourceTable>_logs) WHERE 1 = 0 (or SELECT 1 without a
sourceTable). Ingest-only: posts an empty batch [] (0 events). Bad credentials →
AuthenticationError. A closed client raises CancelledError.
The SQL query client. Throws ConfigError without query credentials.
Better Stack is a SaaS without a version endpoint: always throws UnsupportedError.
StaticfromBuilds a client from GROW_BETTER_STACK_LOGS_*, BETTERSTACK_SOURCE_TOKEN,
BETTERSTACK_INGESTING_HOST, BETTERSTACK_QUERY_* … environment variables.
Client for Better Stack Logs: ingestion through the source's ingesting host (
logClient,exporter,otlpExporter) and the SQL query API (query()), each with its own credentials and transport. A source token is never sent to the query host and SQL credentials never to the ingest host.Example