Class OtelCollectorTelemetry
java.lang.Object
codes.grow.packages.otelcollector.OtelCollectorTelemetry
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.-
Method Summary
Modifier and TypeMethodDescriptionstatic TelemetryHandleStarts telemetry from the environment (OtelCollectorConfig.fromEnv()).static TelemetryHandleinitTelemetry(OtelCollectorConfig config) Starts telemetry for a config with the default options.static TelemetryHandleinitTelemetry(OtelCollectorConfig config, TelemetryOptions options) Starts telemetry.resourceAttributes(OtelCollectorConfig config, ResourceDetector detector) Resource attributes for a config: detected < configured attributes < service fields (service.name,service.version,deployment.environment.nameand the olderdeployment.environment).
-
Method Details
-
initTelemetry
Starts telemetry from the environment (OtelCollectorConfig.fromEnv()).- Returns:
- the handle
-
initTelemetry
Starts telemetry for a config with the default options.- Parameters:
config- collector config- Returns:
- the handle
-
resourceAttributes
public static Map<String,Object> resourceAttributes(OtelCollectorConfig config, ResourceDetector detector) Resource attributes for a config: detected < configured attributes < service fields (service.name,service.version,deployment.environment.nameand the olderdeployment.environment).- Parameters:
config- collector configdetector- resource detector- Returns:
- a new map
-
initTelemetry
Starts telemetry. Signals follow the config (traces/logs/metrics,OTEL_SDK_DISABLED,OTEL_<SIGNAL>_EXPORTER=none) unless the options turn them on or off. Exporter failures never throw at the caller.- Parameters:
config- collector configoptions- options- Returns:
- the handle
- Throws:
ConfigException- for invalid settings or when a global OpenTelemetry already exists
-