Skip to main content

OTEL

Ingesting OTEL Traces & Logs with Kubesense​

Kubesense offers full support for the ingestion of OpenTelemetry (OTEL) traces, and it displays them natively in our user interface for easy visualization and analysis.

Ingestion from Kubernetes Pods​

You can ingest OTLP traces generated by your services directly into Kubesense via our DaemonSet Sensor. This is achieved by configuring the exporter endpoint to the kubeSensor Service Endpoint, which automatically enriches the received spans and logs with relevant Kubernetes metadata.

Locating the Kubesense Sensor Service Endpoint​

To find the endpoint for the Sensor service (referred to as {KUBESENSOR_HOST}), follow the instructions provided here.

Configuring the Required Environment Variables​

To enable the shipping of OTEL data to Kubesense, you need to apply the following environment variables to your services:

Environment Variables:

env:
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: "http://{KUBESENSOR_HOST}:{KUBESENSOR_PORT}"
- name: OTEL_RESOURCE_ATTRIBUTES
value: "kubesense.env_type=(k8s|docker)"

Note: Additional setup is required, and in most scenarios, ingesting OTLP logs from within your Kubernetes cluster is not recommended, as it could lead to log duplication.

Automatic Attribute Enrichment​

Kubesense automatically enriches the traces with valuable Kubernetes metadata to provide more context for your observability needs.

Forwarding Traces from an OpenTelemetry Collector Inside Kubernetes​

To forward OTEL data from an OpenTelemetry Collector inside Kubernetes, configure the following exporter and pipelines:

Exporter Configuration:

exporters:
otlp/kubesense:
endpoint: {KUBESENSOR_HOST}:{KUBESENSOR_PORT}

To directly add custom resource attribute from otel collector.

Processor Configuration:

processors:
attributes/env_type:
actions:
- action: insert
key: kubesense.env_type
value: k8s

Traces Pipeline:

pipelines:
traces:
exporters:
- otlp/kubesense

Additional Notes​

  • Both gRPC and HTTPS are supported for data transmission.