Skip to content

Add a self-healthcheck capability to the otelcol-contrib bundle #40517

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

Open
trajano opened this issue Jun 6, 2025 · 4 comments
Open

Add a self-healthcheck capability to the otelcol-contrib bundle #40517

trajano opened this issue Jun 6, 2025 · 4 comments

Comments

@trajano
Copy link

trajano commented Jun 6, 2025

Component(s)

No response

Is your feature request related to a problem? Please describe.

https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/healthcheckv2extension provides a healthcheck extension that is accessed externally. Can the contrib image include a tool like curl or something fancier like grpcurl that does the healthcheck on the container itself?

Describe the solution you'd like

The Dockerfile that builds the otelcol-contrib image adds HEALTHCHECK and uses grpcurl to check the health of otelcol-contrib and the default config comes with healthcheckv2extension enabled.

The HEALTHCHECK should be disabled by default and enabled only if the environment variable SELF_HEALTHCHECK=1 is set (this ensures backwards compatibility)

Describe alternatives you've considered

Well the only other alternative I can think of is to make a custom otelcol-contrib image that adds grpcurl and the healthcheck

Additional context

No response

@trajano trajano added enhancement New feature or request needs triage New item requiring triage labels Jun 6, 2025
@trajano
Copy link
Author

trajano commented Jun 6, 2025

Actually instead of grpcurl you can add another command otelcol-contrib healthcheck --if-environment-set that would perform the check

@axw
Copy link
Contributor

axw commented Jun 6, 2025

Actually instead of grpcurl you can add another command otelcol-contrib healthcheck --if-environment-set that would perform the check

Adding a new command makes sense to me. I could see a couple of different ways to go about this:

  1. Enable extensions to define new sub-commands. e.g. you could add a command to the healthcheckv2 extension, and then add some new configuration the collector that tells it to define a new "healthcheck" command that uses the healthcheckv2 extension.
  2. Just add a healthcheck command, which would internally use some code shared by the healthcheckv2 extension

Option 1 would be most powerful and flexible, but likely has a longer path to implementation, if others even think it's a good idea. Also, a challenge with that approach would be that the command would only be available in some configurations, which may complicate adding a container HEALTHCHECK - but maybe that's OK.

I'll tag the healthcheckv2 code owners and then we can see if others should be pulled in.

Copy link
Contributor

github-actions bot commented Jun 6, 2025

Pinging code owners for extension/healthcheckv2: @mwear. See Adding Labels via Comments if you do not have permissions to add labels yourself. For example, comment '/label priority:p2 -needs-triaged' to set the priority and remove the needs-triaged label.

@trajano
Copy link
Author

trajano commented Jun 6, 2025

The advantage of curl or grpcurl approach is that it "avoids" changing otelcol-contrib too much and shows an example of testing it from outside. But whatever the approach a self-healthcheck would be good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants