Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using otelcol.exporter.oltphttp to send logs to Loki OTLP points fails due to 204 response #1272

Open
loafoe opened this issue Jul 12, 2024 · 1 comment
Labels
bug Something isn't working needs-attention

Comments

@loafoe
Copy link

loafoe commented Jul 12, 2024

What's wrong?

Attempting to push logs from otelcol.exporter.olpthttp directly to a Loki 3.1.0 OTLP endpoint seems to fail i.e. logs are not acklowledged as being sent even though I can see the logs appear in Loki. This seems to be caused by Loki responding with a HTTP 204 which is not recognized as success by the oltphttp component.

I found a possible otel related upstream issue which was recently fixed:

open-telemetry/opentelemetry-cpp#2632
open-telemetry/opentelemetry-cpp#2712

If the otlphttp component is using this library then this would explain the above observation.

When I introduce a Caddy proxy in between with the following config, the problem goes away!

reverse_proxy /v1/logs {
    to loki-gateway.loki-system.svc:80
    @204 {
       status 204
    }
    handle_response @204 {
       copy_response 200
    }
    rewrite /otlp/v1/logs
}

Can alloy update to the latest opentelementry-cpp version to solve this?

Steps to reproduce

  • Set up Alloy to push OTLP logs directly to a Loki 3.1.0 OTLP endpoint
  • Observe the pipeline clogging up as delivery of logs is not acknowledged

System information

Linux grafana-alloy-1 6.1.92

Software version

Grafana Alloy v1.2.1

Configuration

loki.source.kubernetes "pods" {
  targets    = discovery.relabel.loki_relabel.output
  forward_to = [
    otelcol.receiver.loki.local.receiver,
  ]
}

otelcol.exporter.otlphttp "local" {
  client {
    # This endpoint rewrites /v1/logs to /otlp/v1/logs
    endpoint = "http://otlp-proxy.starlift-observability.svc"
    auth = otelcol.auth.headers.local.handler

    tls {
      insecure = false
    }
  }
}

Logs

ts=2024-07-12T08:18:33.463303168Z level=error msg="failed to consume log entries" component_path=/ component_id=otelcol.receiver.loki.local err="sending queue is full"
@loafoe loafoe added the bug Something isn't working label Jul 12, 2024
Copy link
Contributor

This issue has not had any activity in the past 30 days, so the needs-attention label has been added to it.
If the opened issue is a bug, check to see if a newer release fixed your issue. If it is no longer relevant, please feel free to close this issue.
The needs-attention label signals to maintainers that something has fallen through the cracks. No action is needed by you; your issue will be kept open and you do not have to respond to this comment. The label will be removed the next time this job runs if there is new activity.
Thank you for your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-attention
Projects
None yet
Development

No branches or pull requests

1 participant