Class TempoConfig
TempoClient (SPEC section 2.2).
Build one with builder() or read it from the environment with fromEnv().
Precedence: explicit builder value > SDK variable (EnvReader.DEFAULT_PREFIX + name)
> vendor variables > default. toString() never prints credentials.
Tempo has no authentication of its own: put an authenticating reverse proxy in front of it and
pass its credentials with TempoConfig.Builder.header(String, String) (sensitive headers are redacted
everywhere). Environment: GROW_GRAFANA_TEMPO_URL, then TEMPO_URL and
GROW_TEMPO_URL; GROW_GRAFANA_TEMPO_TENANT_ID, then TEMPO_TENANT_ID and
GROW_TEMPO_TENANT_ID; GROW_GRAFANA_TEMPO_TOKEN, then GROW_TEMPO_TOKEN; the
common SPEC variables (GROW_GRAFANA_TEMPO_REQUEST_TIMEOUT, …) with GROW_TEMPO_*
aliases for TLS and proxy.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder of the configuration. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic TempoConfig.Builderbuilder()Starts an empty builder (every field at its default).Returns the connect timeout.static TempoConfigfromEnv()Reads the configuration from the process environment.static TempoConfigReads the configuration from an explicit variable map (tests).headers()Returns the extra request headers.hooks()Returns the hooks.logger()Returns the logger.proxy()Returns the explicit proxy URL.Returns the per-attempt timeout.retry()Returns the retry policy.tenantId()Returns the tenant sent asX-Scope-OrgIDon every query call.tls()Returns the TLS options.token()Returns the bearer token for an authenticating reverse proxy (Tempo itself has no auth).toString()Returns the total timeout per call including retries.Translates the common fields into transport settings.url()Returns the endpoint base URL.Returns the user agent suffix.voidvalidate()Checks URL scheme, positive timeouts, retry limits and TLS pairs.static voidvalidateTenantId(String tenantId) Checks a Tempo tenant id: per tenant 1-150 characters of letters, digits and!-_.*'()(not.or..);|joins tenants of a federated query.
-
Field Details
-
DEFAULT_URL
Default endpoint of the query API (HTTP port 3200).- See Also:
-
TENANT_HEADER
Header that selects the tenant on a multi-tenant Tempo (query and OTLP ingest; gRPC metadatax-scope-orgid). A single-tenant Tempo ignores it.- See Also:
-
-
Method Details
-
builder
Starts an empty builder (every field at its default).- Returns:
- a new builder
-
fromEnv
Reads the configuration from the process environment.- Returns:
- the validated configuration
- Throws:
ConfigException- when a variable holds an invalid value (the message names the variable, never the value)
-
fromEnv
Reads the configuration from an explicit variable map (tests).- Parameters:
env- variable map- Returns:
- the validated configuration
-
validate
public void validate()Checks URL scheme, positive timeouts, retry limits and TLS pairs.- Throws:
ConfigException- when a rule is violated
-
validateTenantId
Checks a Tempo tenant id: per tenant 1-150 characters of letters, digits and!-_.*'()(not.or..);|joins tenants of a federated query.- Parameters:
tenantId- tenant id, ornull(no tenant)- Throws:
ConfigException- when the id is invalid (the message never repeats the value)
-
toTransportConfig
Translates the common fields into transport settings.- Returns:
- the transport configuration
-
url
Returns the endpoint base URL.- Returns:
- the URL
-
tenantId
Returns the tenant sent asX-Scope-OrgIDon every query call.- Returns:
- the tenant id, or empty (no header)
-
token
Returns the bearer token for an authenticating reverse proxy (Tempo itself has no auth).- Returns:
- the token, or empty
-
connectTimeout
Returns the connect timeout.- Returns:
- the timeout
-
requestTimeout
Returns the per-attempt timeout.- Returns:
- the timeout
-
totalTimeout
Returns the total timeout per call including retries.- Returns:
- the timeout
-
retry
Returns the retry policy.- Returns:
- the policy
-
tls
Returns the TLS options.- Returns:
- the options
-
proxy
Returns the explicit proxy URL.- Returns:
- the proxy, or empty
-
headers
Returns the extra request headers.- Returns:
- immutable map
-
userAgentSuffix
Returns the user agent suffix.- Returns:
- the suffix, or empty
-
hooks
Returns the hooks.- Returns:
- the hooks
-
logger
Returns the logger.- Returns:
- the logger
-
toString
-