Skip to main content

Telelemetry

Integration with Grafana Loki

We can also configure the OTel collector to send logs to Loki backends. To do so:

  1. Export the collector config map into a file:

    kubectl get cm oblv-deploy-stack-oblv-deploy-chart-collector-config \
    -n kube-system -o yaml > /tmp/collector-config.yaml

    cat /tmp/collector-config.yaml

    apiVersion: v1
    data:
    collector-config.yaml: |
    receivers:
    otlp:
    protocols:
    grpc:
    endpoint: 0.0.0.0:4317
    http:
    endpoint: 0.0.0.0:4318
    exporters:
    debug:
    verbosity: detailed
    service:
    pipelines:
    traces:
    receivers: [otlp]
    exporters: [debug]
    metrics:
    receivers: [otlp]
    exporters: [debug]
    logs:
    receivers: [otlp]
    exporters: [debug]
    kind: ConfigMap
  2. Edit the config map to configure Loki as an exporter:

    apiVersion: v1
    data:
    collector-config.yaml: |
    receivers:
    otlp:
    protocols:
    grpc:
    endpoint: 0.0.0.0:4317
    http:
    endpoint: 0.0.0.0:4318
    exporters:
    debug:
    verbosity: detailed
    loki:
    endpoint: https://loki.example.com:3100/loki/api/v1/push
    service:
    pipelines:
    traces:
    receivers: [otlp]
    exporters: [debug]
    metrics:
    receivers: [otlp]
    exporters: [debug]
    logs:
    receivers: [otlp]
    exporters: [debug, loki]
    kind: ConfigMap
  3. Update the configmap:

    kubectl apply -f /tmp/collector-config.yaml -n kube-system

    configmap/oblv-deploy-stack-oblv-deploy-chart-collector-config configured
  4. Restart the OTel collector pod:

      kubectl rollout restart \
    deployment/oblv-deploy-stack-oblv-deploy-chart-collector \
    -n kube-system

    deployment.apps/oblv-deploy-stack-oblv-deploy-chart-collector restarted