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.
-
ClassDescriptionHealth of an OpenTelemetry Collector:
GET {healthUrl}(health_checkextension, port 13133) and, when that endpoint is unreachable (stock Grow stacks bind it to localhost),GET {zpagesUrl}/debug/servicez(port 55679).LogQueryClientof the collector: the collector stores nothing and has no query API, so every method throwsUnsupportedException.TraceQueryClientof the collector: the collector stores nothing and has no query API, so every method throwsUnsupportedException.Options of the metric instrument helpers (counter,upDownCounter,histogram,gauge).Client for an OpenTelemetry Collector: health (health_checkwith zpages fallback), an authenticated OTLPping, 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 aOtelCollectorClientand of every OTLP exporter this package builds (traces, logs, metrics).Builder of the configuration.OTLP log clients for the collector: aBatchingLogClient(SPEC section 4) overOtlpLogExporter, 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) andmeter/counter/upDownCounter/histogram/gaugehelpers on the globalMeterProvider(registered byinitTelemetryunlesssetGlobal(false)).One-call OpenTelemetry bootstrap for every Grow stack (the platform deploys the collector with each stack): traces (OtelCollectorTracing), logs (an OpenTelemetryLoggerProviderfor log appenders plus aBatchingLogClient) and metrics (MeterProviderwith 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/protobuftohttp://127.0.0.1:4318/v1/tracesby default, orgrpctohttp://127.0.0.1:4317) andinitTracingwith collector defaults from the environment.Converts SDK attribute maps (strings, booleans, longs, doubles, lists and nested maps) to OpenTelemetryAttributes: homogeneous primitive lists become array attributes, nested maps and mixed lists becomeAnyValue(AttributeKey.valueKey(java.lang.String)) attributes.Shared OTLP plumbing: gRPC method paths, decoding ofgoogle.rpc.Statusand 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 decodedgoogle.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 gRPCLogsService/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.idfrom cgroups) andk8s(k8s.pod.name,k8s.namespace.name, … from the downward-API variablesK8S_*/POD_*,HOSTNAMEand the service-account namespace file).JVM runtime metrics (semantic-convention names) observed on every collection:jvm.memory.usedandjvm.memory.committed(By,jvm.memory.typeheap / non_heap),jvm.thread.count,jvm.class.count,jvm.cpu.time(s),jvm.cpu.recent_utilizationandprocess.uptime(s).The three OpenTelemetry signals the collector receives.A running telemetry setup (all three signals) created byOtelCollectorTelemetry.initTelemetry().Options ofOtelCollectorTelemetry.initTelemetry(OtelCollectorConfig, TelemetryOptions): per-signal switches over the config, global registration, metric settings and exporter replacements (tests).Builder ofTelemetryOptions.