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

Arbitrary headers for push_metrics #507

Open
felipesere opened this issue Dec 14, 2023 · 0 comments
Open

Arbitrary headers for push_metrics #507

felipesere opened this issue Dec 14, 2023 · 0 comments

Comments

@felipesere
Copy link

Is your feature request related to a problem? Please describe.
Our pushgateway is behind a gateway and we need to pass credentials through headers which are not basic auth.

Describe the solution you'd like
When calling push_metrics I'd like pass a collection of arbitrary headers that get added to the request:

            let outcome = push_metrics::<RandomState>(
                "deployment-notifier",
                HashMap::from([
                    ("repo".to_string(), repo),
                    ("app".to_string(), workload.name),
                ]),
                "http://foo.example.com/bar",
                mfs,
                None, // basic auth here
                Some(HashMap::from([("key", "value"), ("other-key", "other-value")])), // <-- new map with headers that will be added to the request
            );

Describe alternatives you've considered
In a different place we have basically vendored push_metrics but that feels too blunt. We already depend on rust-prometheus and this is such a tiny detail.

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

No branches or pull requests

1 participant