Package codes.grow.packages.otelcollector


package codes.grow.packages.otelcollector
Grow Codes SDK for OpenTelemetry Collector.

Start with OtelCollectorClient.fromEnv().

Shared building blocks live in core (errors, transport, redaction); category APIs in secrets, logging and tracing; in-memory fakes and the conformance runner in testing.

  • Class
    Description
    Health of an OpenTelemetry Collector: GET {healthUrl} (health_check extension, port 13133) and, when that endpoint is unreachable (stock Grow stacks bind it to localhost), GET {zpagesUrl}/debug/servicez (port 55679).
    LogQueryClient of the collector: the collector stores nothing and has no query API, so every method throws UnsupportedException.
    TraceQueryClient of the collector: the collector stores nothing and has no query API, so every method throws UnsupportedException.
    Options of the metric instrument helpers (counter, upDownCounter, histogram, gauge).
    Client for an OpenTelemetry Collector: health (health_check with zpages fallback), an authenticated OTLP ping, the collector version, and factories for the telemetry bootstrap, tracing, log clients and exporters whose lifetime the client owns (OtelCollectorClient.close() flushes and shuts them down).
    Builder that configures and creates a client in one chain.
    Immutable configuration of a OtelCollectorClient and of every OTLP exporter this package builds (traces, logs, metrics).
    Builder of the configuration.
    OTLP log clients for the collector: a BatchingLogClient (SPEC section 4) over OtlpLogExporter, with the service resource (service.name, version, environment and the configured resource attributes) and the configured log batch settings (OTEL_BLRP_*).
    OTLP metrics for the collector: the official OTLP metric exporter (cumulative temporality) and meter / counter / upDownCounter / histogram / gauge helpers on the global MeterProvider (registered by initTelemetry unless setGlobal(false)).
    One-call OpenTelemetry bootstrap for every Grow stack (the platform deploys the collector with each stack): traces (OtelCollectorTracing), logs (an OpenTelemetry LoggerProvider for log appenders plus a BatchingLogClient) and metrics (MeterProvider with a periodic reader) with one shared resource and the official OTLP exporters.
    Tracing preset for the OpenTelemetry Collector (SPEC section 5): the official OTLP span exporters (http/protobuf to http://127.0.0.1:4318/v1/traces by default, or grpc to http://127.0.0.1:4317) and initTracing with collector defaults from the environment.
    Converts SDK attribute maps (strings, booleans, longs, doubles, lists and nested maps) to OpenTelemetry Attributes: homogeneous primitive lists become array attributes, nested maps and mixed lists become AnyValue (AttributeKey.valueKey(java.lang.String)) attributes.
    Shared OTLP plumbing: gRPC method paths, decoding of google.rpc.Status and partial success bodies, mapping of HTTP and gRPC statuses to the SDK exceptions, and exporter settings (retry policy, TLS) for the official OpenTelemetry exporters.
    A decoded OTLP partial success.
    A decoded google.rpc.Status.
    LogExporter (SPEC section 4) that sends records to the collector over OTLP with the official OpenTelemetry log exporter: POST {logsUrl} (application/x-protobuf) or gRPC LogsService/Export.
    Best-effort client-side resource detection: host (host.name, host.arch, os.type, os.version), process (process.pid, process.executable.path, process.runtime.*, process.owner), container (container.id from cgroups) and k8s (k8s.pod.name, k8s.namespace.name, … from the downward-API variables K8S_* / POD_*, HOSTNAME and the service-account namespace file).
    JVM runtime metrics (semantic-convention names) observed on every collection: jvm.memory.used and jvm.memory.committed (By, jvm.memory.type heap / non_heap), jvm.thread.count, jvm.class.count, jvm.cpu.time (s), jvm.cpu.recent_utilization and process.uptime (s).
    The three OpenTelemetry signals the collector receives.
    A running telemetry setup (all three signals) created by OtelCollectorTelemetry.initTelemetry().
    Options of OtelCollectorTelemetry.initTelemetry(OtelCollectorConfig, TelemetryOptions): per-signal switches over the config, global registration, metric settings and exporter replacements (tests).
    Builder of TelemetryOptions.