Skip to Content
KubeSense
OpenTelemetry/Logs

Logs

Send OpenTelemetry logs to KubeSense over OTLP/HTTP or OTLP/gRPC from VMs, ECS, Lambda and external services, with the resource attributes KubeSense needs.

KubeSense receives OpenTelemetry logs at the Log Aggregator over OTLP/HTTP or OTLP/gRPC. Logs arrive in the Log Explorer and go through the same log pipelines as every other log source.

When to use OTLP logs

Where the logs come fromUse
Pods on KubernetesThe KubeSense log sensor. It already collects container stdout and stderr, so don't also export these logs over OTLP or each line is stored twice
VMs and EC2 hostsOTLP, from an OpenTelemetry Collector on the host. See OpenTelemetry (OTLP)
Amazon ECSSee ECS
AWS LambdaSee AWS Lambda Logs
SaaS platforms and third-party servicesOTLP, pushed to the Aggregator's load balancer. See External Service Logs & Metrics

On Kubernetes, set OTEL_LOGS_EXPORTER=none in applications so the SDKs don't export logs that the log sensor already collects.

Endpoints

ProtocolEndpoint
OTLP/HTTPhttp://<AGGREGATOR_HOST>:30055/v1/logs
OTLP/gRPC<AGGREGATOR_HOST>:30056

Turn the receiver on in your KubeSense server values. It's off by default:

aggregator:
  sources:
    otel:
      enabled: true

From outside the KubeSense cluster, expose the Aggregator through an internal load balancer. See External Service Logs & Metrics. The load balancer keeps the 30055 and 30056 port numbers.

Resource attributes

KubeSense uses these resource attributes to place each log record:

AttributeBecomesRequired
service.nameworkload, instance and container_name in the Log ExplorerYes
kubesense.clusterclusterYes
kubesense.env_typeenv_type: legacy for VMs and EC2 hosts, ecs, docker, or any other value (for example external) for third-party sourcesYes
service.namespacenamespaceRecommended

Severity comes from the OTLP severity_text field. When it is empty, KubeSense detects the level from the message body.

Send from an application

For an application on a VM that logs through the OpenTelemetry SDK:

OTEL_SERVICE_NAME=billing-worker
OTEL_RESOURCE_ATTRIBUTES=kubesense.cluster=prod-vms,kubesense.env_type=legacy
OTEL_LOGS_EXPORTER=otlp
OTEL_EXPORTER_OTLP_LOGS_PROTOCOL=http/protobuf
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=http://<AGGREGATOR_HOST>:30055/v1/logs

To use gRPC instead, set OTEL_EXPORTER_OTLP_LOGS_PROTOCOL=grpc and OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=http://<AGGREGATOR_HOST>:30056.

Send through a Collector

processors:
  resource/kubesense:
    attributes:
      - { key: kubesense.cluster,  value: prod-vms, action: upsert }
      - { key: kubesense.env_type, value: legacy,   action: upsert }

exporters:
  otlphttp/kubesense_logs:
    logs_endpoint: http://<AGGREGATOR_HOST>:30055/v1/logs
    tls:
      insecure: true

service:
  pipelines:
    logs:
      receivers: [otlp]
      processors: [resource/kubesense, batch]
      exporters: [otlphttp/kubesense_logs]

To read log files on a host, add the filelog receiver to the same pipeline. See OpenTelemetry (OTLP) for a complete host configuration.

Troubleshooting

SymptomLikely cause
Connection refused on 30055 or 30056aggregator.sources.otel.enabled is off, or the port isn't reachable from the sender
Every log line appears twiceThe application exports OTLP logs on Kubernetes, where the log sensor also collects them. Set OTEL_LOGS_EXPORTER=none
Logs have no workload or land under the wrong clusterservice.name, kubesense.cluster or kubesense.env_type is missing
Every log shows the same levelseverity_text is empty and the message has no recognizable level. Set the severity in your logging bridge

On this page