Open Telemetry
Oodle provides a seamless integration with Open Telemetry. By adding Oodle as an exporter in your Open Telemetry configuration, you can start sending traces directly to Oodle.
To send traces to Oodle via Open Telemetry, you will need the following:
OODLE_INSTANCE: Your Oodle instance ID. Go toSettingsicon ->API Keyspage in your Oodle UI to find out. (Oodle UI links: ap1, us1)OODLE_API_KEY: Your Oodle API key for authentication. Go toSettingsicon ->API Keysin your Oodle UI to choose an appropriate key. (Oodle UI links: ap1, us1)
Open Telemetry Collector Configuration
If you have set up an Open Telemetry Collector, you can add an exporter for Oodle to your Open Telemetry configuration file:
exporters:
otlphttp/oodle:
traces_endpoint: "https://<OODLE_INSTANCE>.collector.oodle.ai/v1/otlp/traces"
headers:
"X-OODLE-INSTANCE": "<OODLE_INSTANCE>"
"X-API-KEY": "<OODLE_API_KEY>"
Steps
You can find the Open Telemetry config changes by following these steps:
- Login to the Oodle UI, then navigate to Settings page
- Click on the Open Telemetry tile
- Choose an appropriate API key from the list on top of the drawer
- Ensure that you have selected the Traces feature in Step 1.
Follow the steps in the drawer to complete the OpenTelemetry collector configuration for Traces
OTel SDK Configuration
If you are using an Open Telemetry SDK, and have exporters configured directly in your application, you can add the Oodle exporter via the SDK:
- Go
- Java
import (
// other imports ...
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp"
"go.opentelemetry.io/otel/sdk/trace"
// other imports ...
)
existingTraceExporter, err := otlptracehttp.New(
// initialization ...
)
if err != nil {
panic("...")
}
oodleTraceExporter, err := otlptracehttp.New(
ctx,
otlptracehttp.WithEndpoint("<OODLE_INSTANCE>.collector.oodle.ai"),
otlptracehttp.WithURLPath("v1/otlp/traces"),
otlptracehttp.WithHeaders(map[string]string{
"X-OODLE-INSTANCE": "<OODLE_INSTANCE>",
"X-API-KEY": "<OODLE_API_KEY>",
}),
)
if err != nil {
panic("failed to initialize Oodle trace exporter")
}
traceProvider := trace.NewTracerProvider(
trace.WithSpanProcessor(
trace.NewBatchSpanProcessor(existingTraceExporter),
),
trace.WithSpanProcessor(
trace.NewBatchSpanProcessor(oodleTraceExporter),
),
trace.WithSampler(sampler),
trace.WithResource(res),
)
package otel;
import io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporter;
import io.opentelemetry.sdk.resources.Resource;
import io.opentelemetry.sdk.trace.SdkTracerProvider;
import io.opentelemetry.sdk.trace.export.SpanExporter;
import java.time.Duration;
public class SpanExporterConfig {
public static SpanExporter existingSpanExporter() {
// initialization ...
}
public static SpanExporter oodleSpanExporter() {
return OtlpHttpSpanExporter.builder()
.setEndpoint("https://<OODLE_INSTANCE>.collector.oodle.ai/v1/otlp/traces")
.addHeader("X-OODLE-INSTANCE", "<OODLE_INSTANCE>")
.addHeader("X-API-KEY", "<OODLE_API_KEY>")
.build();
}
}
public class SdkTracerProviderConfig {
public static SdkTracerProvider create(Resource resource) {
return SdkTracerProvider.builder()
.setResource(resource)
.addSpanProcessor(
SpanProcessorConfig.batchSpanProcessor(
SpanExporterConfig.existingSpanExporter()))
.addSpanProcessor(
SpanProcessorConfig.batchSpanProcessor(
SpanExporterConfig.oodleSpanExporter()))
.setSampler(
SamplerConfig.parentBasedSampler(
SamplerConfig.traceIdRatioBased(.25)))
.setSpanLimits(SpanLimitsConfig::spanLimits)
.build();
}
}
Custom Resource Attributes
Oodle UI provides additional conveniences to filter spans by the following resource attributes:
The Open Telemetry collector can add custom resource attributes to each event
via the resource processor. In addition, Oodle supports custom resource attributes sent via the
X-RESOURCE-ATTRS HTTP header.
The example below adds two resource attributes:
k8s.cluster.name and deployment.environment.name.
- Collector Processor
- HTTP Header
processors:
resource/oodle:
attributes:
- key: k8s.cluster.name
value: <CLUSTER>
action: insert
- key: deployment.environment.name
value: <ENV>
action: insert
exporters:
otlphttp/oodle:
traces_endpoint: "https://<OODLE_INSTANCE>.collector.oodle.ai/v1/otlp/traces"
headers:
"X-OODLE-INSTANCE": "<OODLE_INSTANCE>"
"X-API-KEY": "<OODLE_API_KEY>"
service:
pipelines:
traces:
processors: [resource/oodle]
exporters: [otlphttp/oodle]
The format for the X-RESOURCE-ATTRS header is: key1=value1,key2=value2.
- Open Telemetry Collector
- Go SDK
- Java SDK
exporters:
otlphttp/oodle:
traces_endpoint: "https://<OODLE_INSTANCE>.collector.oodle.ai/v1/otlp/traces"
headers:
"X-OODLE-INSTANCE": "<OODLE_INSTANCE>"
"X-API-KEY": "<OODLE_API_KEY>"
"X-RESOURCE-ATTRS": "k8s.cluster.name=<CLUSTER>,deployment.environment.name=<ENV>"
service:
pipelines:
traces:
exporters: [otlphttp/oodle]
oodleTraceExporter, err := otlptracehttp.New(
ctx,
otlptracehttp.WithEndpoint("<OODLE_INSTANCE>.collector.oodle.ai"),
otlptracehttp.WithURLPath("v1/otlp/traces"),
otlptracehttp.WithHeaders(map[string]string{
"X-OODLE-INSTANCE": "<OODLE_INSTANCE>",
"X-API-KEY": "<OODLE_API_KEY>",
"X-RESOURCE-ATTRS": "k8s.cluster.name=<CLUSTER>,deployment.environment.name=<ENV>",
}),
)
public class SpanExporterConfig {
public static SpanExporter existingSpanExporter() {
// initialization ...
}
public static SpanExporter oodleSpanExporter() {
return OtlpHttpSpanExporter.builder()
.setEndpoint("https://<OODLE_INSTANCE>.collector.oodle.ai/v1/otlp/traces")
.addHeader("X-OODLE-INSTANCE", "<OODLE_INSTANCE>")
.addHeader("X-API-KEY", "<OODLE_API_KEY>")
.addHeader(
"X-RESOURCE-ATTRS",
"k8s.cluster.name=<CLUSTER>,deployment.environment.name=<ENV>"
)
.build();
}
}
Support
If you need assistance or have any questions, please reach out to us through:
- The help chat widget available on the Support link in the sidebar
- Email at support@oodle.ai