Class BetterStackClient

java.lang.Object
codes.grow.packages.betterstack.BetterStackClient
All Implemented Interfaces:
AutoCloseable

public final class BetterStackClient extends Object implements AutoCloseable
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 ingesting host.

 try (BetterStackClient client = BetterStackClient.fromEnv()) {
   BatchingLogClient logs = client.logClient(
       BetterStackLogClientOptions.builder().resource(Map.of("service.name", "checkout")).build());
   logs.logger().info("order placed", Map.of("orderId", 42));
 } // close() flushes every log client
 

Thread-safe. Every I/O method has a blocking form and an …Async form returning CompletableFuture.