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

[exporter/prometheus] Shutdown method does not shutdown server #35464

Open
Argannor opened this issue Sep 27, 2024 · 2 comments
Open

[exporter/prometheus] Shutdown method does not shutdown server #35464

Argannor opened this issue Sep 27, 2024 · 2 comments
Labels
bug Something isn't working exporter/prometheus

Comments

@Argannor
Copy link

Component(s)

exporter/prometheus

What happened?

Description

When the collector receives a NOHUP signal, it reloads the current configuration and calls the Shutdown method. The Shutdown method of the prometheusexporter however does only close the listener, not the http.Server. This means that the old server does not accept any new connections, but all existing connections may continue to live forever. If a client (like Prometheus) keeps the connection between scrapes alive, the requests will be served by the old instance, meaning the metrics will no longer get any updates until they disappear. This is especially difficult to debug, since requests using curl or wget will be served by the new instance, seeing completely different metrics.

Steps to Reproduce

  • Setup otel-collector with the prometheus exporter
  • Setup prometheus to scrape this instance every 60s
  • Send a NOHUP signal to prometheus
  • No metric updates will be recorded by prometheus after the NOHUP

Expected Result

  • The old server must be shutdown, so that prometheus reconnects and receives the latest metrics

Actual Result

  • The old HTTP connection continues to live on and metrics go stale in prometheus

I will provide a Pull Request for this issue

Collector version

v0.109.0/v0.110.0

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

No response

Log output

No response

Additional context

No response

@Argannor Argannor added bug Something isn't working needs triage New item requiring triage labels Sep 27, 2024
Copy link
Contributor

Pinging code owners:

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

@dashpole
Copy link
Contributor

Good find. I'll follow-up on the PR

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

No branches or pull requests

2 participants