Skip to content

Conversation

@btimby
Copy link

@btimby btimby commented Mar 1, 2024

I needed HTTP basic auth for my metrics. This PR adds two optional CLI args: --http-username and --http-password.

@danihodovic
Copy link
Owner

What's the use case here? Are you connecting to the exporter over the public internet? Is it possible to place Nginx in front?

@btimby
Copy link
Author

btimby commented Mar 2, 2024 via email

@danihodovic
Copy link
Owner

danihodovic commented Mar 7, 2024

This is the first request I receive for baking in HTTP basic auth. I'd prefer to keep the code base small so I won't be merging this. Feel free to fork the repo with the added changes and deploy your own patched exporter.

If you're using Grafana for visualizations here are two charts designed for the exporter:

@danihodovic
Copy link
Owner

I've changed my mind. I think we can merge this. Can you resolve the conflicts and I will take a look?

@btimby
Copy link
Author

btimby commented Jul 15, 2025

Sure thing.

Copy link

@bgirschig bgirschig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR. I'm interested in this as well !

Comment on lines +130 to +135
@click.option(
"--http-username", default=None, help="Basic auth username for /metrics endpoint."
)
@click.option(
"--http-password", default=None, help="Basic auth password for /metrics endpoint."
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to add an envvar to these ? I want to avoid passwords in commands

Suggested change
@click.option(
"--http-username", default=None, help="Basic auth username for /metrics endpoint."
)
@click.option(
"--http-password", default=None, help="Basic auth password for /metrics endpoint."
)
@click.option(
"--http-username",
default=None,
help="Basic auth username for /metrics endpoint.",
envvar="CELERY_EXPORTER_HTTP_USERNAME"
)
@click.option(
"--http-password",
default=None,
help="Basic auth password for /metrics endpoint.",
envvar="CELERY_EXPORTER_HTTP_PASSWORD"
)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants