Package codes.grow.packages.tempo
Class TempoTracingConfig
java.lang.Object
codes.grow.packages.tempo.TempoTracingConfig
Tempo tracing settings whose unset fields come from the environment, then Tempo defaults.
resolve(EnvReader) turns it into the generic TracingConfig used by TempoTracing.initTracing(TempoTracingConfig).
Precedence per field: explicit > GROW_GRAFANA_TEMPO_OTLP_* >
OTEL_EXPORTER_OTLP_TRACES_* > OTEL_EXPORTER_OTLP_* > default.
- Endpoint:
GROW_GRAFANA_TEMPO_OTLP_ENDPOINT,OTEL_EXPORTER_OTLP_TRACES_ENDPOINT(used as is),OTEL_EXPORTER_OTLP_ENDPOINT(/v1/tracesappended for HTTP); defaulthttp://127.0.0.1:4318(:4317for gRPC). - Protocol:
GROW_GRAFANA_TEMPO_OTLP_PROTOCOL,OTEL_EXPORTER_OTLP_TRACES_PROTOCOL,OTEL_EXPORTER_OTLP_PROTOCOL; defaulthttp/protobuf(nativealso means OTLP over HTTP: Tempo has no other protocol). - Headers:
OTEL_EXPORTER_OTLP_TRACES_HEADERSorOTEL_EXPORTER_OTLP_HEADERS(k=v,k2=v2) for names not set explicitly. - Tenant (
X-Scope-OrgID): explicittenantId, an explicit header, thenGROW_GRAFANA_TEMPO_TENANT_ID,TEMPO_TENANT_ID,GROW_TEMPO_TENANT_ID. - Compression:
GROW_GRAFANA_TEMPO_OTLP_COMPRESSION,OTEL_EXPORTER_OTLP_TRACES_COMPRESSION,OTEL_EXPORTER_OTLP_COMPRESSION. - Service name:
OTEL_SERVICE_NAME, thenservice.nameinOTEL_RESOURCE_ATTRIBUTES; the other resource attributes fill unset ones. - Sampler:
OTEL_TRACES_SAMPLERandOTEL_TRACES_SAMPLER_ARG.
A multi-tenant Tempo answers an export without a tenant with HTTP 503 / gRPC
Unavailable, which the exporter retries until it drops the spans: set the tenant whenever Tempo
runs with multi-tenancy.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder ofTempoTracingConfig; every field is optional. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic TempoTracingConfig.Builderbuilder()Starts an empty builder (every field from the environment or the default).static TempoTracingConfig.BuilderStarts a builder with a service name.static TempoTracingConfigfrom(TracingConfig config) Takes every field of a generic config as explicit; only an unset endpoint and a missing tenant header are filled from the environment.resolve()Resolves the settings against the process environment.Resolves the settings against an environment reader.tenantId()The explicit tenant.toString()
-
Field Details
-
DEFAULT_OTLP_HTTP_ENDPOINT
Default OTLP/HTTP endpoint (Tempo's OTLP HTTP receiver).- See Also:
-
DEFAULT_OTLP_GRPC_ENDPOINT
Default OTLP/gRPC endpoint (Tempo's OTLP gRPC receiver).- See Also:
-
-
Method Details
-
builder
Starts an empty builder (every field from the environment or the default).- Returns:
- builder
-
builder
Starts a builder with a service name.- Parameters:
serviceName-service.name- Returns:
- builder
-
from
Takes every field of a generic config as explicit; only an unset endpoint and a missing tenant header are filled from the environment.- Parameters:
config- generic config- Returns:
- Tempo config
-
tenantId
The explicit tenant.- Returns:
- tenant id, if set
-
resolve
Resolves the settings against the process environment.- Returns:
- generic tracing config
- Throws:
ConfigException- naming an invalid variable (never its value)
-
resolve
Resolves the settings against an environment reader.- Parameters:
env- environment (EnvReader.of(Map)in tests)- Returns:
- generic tracing config
- Throws:
ConfigException- naming an invalid variable (never its value)
-
toString
-