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

Haproxyreceiver HTTP not supported #24440

Closed
akumetsu183 opened this issue Jul 24, 2023 · 1 comment · Fixed by #24560
Closed

Haproxyreceiver HTTP not supported #24440

akumetsu183 opened this issue Jul 24, 2023 · 1 comment · Fixed by #24560
Assignees
Labels
bug Something isn't working receiver/haproxy

Comments

@akumetsu183
Copy link

Component(s)

receiver/haproxy

What happened?

Description

HAProxy receiver readme mentions support for HTTP, but it does not work for me.

Seems to me like the functionality support is planned but not implemented yet.
If that is the case, I would be ok with that state being mentioned in the readme.

Steps to Reproduce

  1. Run v81 collector docker image
  2. Run haproxy:2.8.1 docker image (and expose HTTP stats endpoint by configuring haproxy.cfg)
frontend stats
        mode http
        bind *:8404
        stats enable
        stats uri /stats
  1. Try to scrape the HTTP endpoint with the receiver. (test in browser that it really is exposed)
receivers:
  haproxy:
    endpoint: "http://{haproxy-container-ip}:8408/stats"
    collection_interval: 30s

Expected Result

HTTP endpoint scraped as mentioned in readme.
Or readme saying it does not work for HTTP.

Actual Result

HTTP endpoint not scraped, looks like it uses the same code path as for the socket, resulting in a fail.

Collector version

0.81.0

Environment information

Environment

Collector docker image: otel/opentelemetry-collector-contrib:0.81.0

HaProxy Dockerfile

FROM haproxy:2.8.1 as updated
COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg

I just added this to haproxy.cfg to enable stats on 8404/stats

frontend stats
        mode http
        bind *:8404
        stats enable
        stats uri /stats

That exposed this.
image

OpenTelemetry Collector configuration

receivers:
  haproxy:
    endpoint: "http://{haproxy-container-ip}:8404/stats"
    collection_interval: 30s

exporters:
  otlp:
    endpoint: $OTEL_ENDPOINT
    tls:
      insecure: false
    headers: {"Authorization": $OTEL_TOKEN}

service:
  pipelines:
    metrics:
      receivers: [haproxy]
      exporters: [otlp]

Log output

2023-07-24 09:22:00 2023-07-24T07:22:00.979Z    error   scraperhelper/scrapercontroller.go:213  Error scraping metrics  {"kind": "receiver", "name": "haproxy", "data_type": "metrics", "error": "dial unix http://localhost:8404/stats: connect: no such file or directory", "scraper": ""}
2023-07-24 09:22:00 go.opentelemetry.io/collector/receiver/scraperhelper.(*controller).scrapeMetricsAndReport
2023-07-24 09:22:00     go.opentelemetry.io/collector/[email protected]/scraperhelper/scrapercontroller.go:213
2023-07-24 09:22:00 go.opentelemetry.io/collector/receiver/scraperhelper.(*controller).startScraping.func1
2023-07-24 09:22:00     go.opentelemetry.io/collector/[email protected]/scraperhelper/scrapercontroller.go:192

Additional context

No response

@akumetsu183 akumetsu183 added bug Something isn't working needs triage New item requiring triage labels Jul 24, 2023
@github-actions
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@atoulme atoulme removed the needs triage New item requiring triage label Jul 26, 2023
@atoulme atoulme self-assigned this Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working receiver/haproxy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants