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

Header for Oauth in targets #1010

Closed
talset opened this Issue Aug 19, 2015 · 6 comments

Comments

Projects
None yet
3 participants
@talset
Copy link

talset commented Aug 19, 2015

Some soft like Openshift provide metrics accessible through the openshit http api like. To collect metrics we need https (supported) and Oauth. But currently, we can't use Oauth.

To be able to use that, we have to add an header "Authorization: Bearer" like this :

  curl -s -k https://<host>:<port>/metrics -H "Authorization: Bearer <token>"

Idea is to have header into targets declaration like :

# The targets specified by the target group.
targets:
  [ - '<host>' ]

# Labels assigned to all metrics scraped from the targets.
labels:
  [ <labelname>: <labelvalue> ... ]

header:
  [<headername>: <headervalue> ...]

Do you think it will be possible ?

Thanks,

@jimmidyson

This comment has been minimized.

Copy link
Member

jimmidyson commented Aug 19, 2015

@talset The functionality is there to do this now in master. Scrape configs can now have bearer_token or bearer_token_file set to add in the authorization header. Not sure if I updated docs or not actually.

@jimmidyson

This comment has been minimized.

Copy link
Member

jimmidyson commented Aug 19, 2015

See here.

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Aug 19, 2015

Yup - the documentation will be added before the next release. It's tracked in prometheus/docs#152.

@talset

This comment has been minimized.

Copy link
Author

talset commented Aug 19, 2015

@jimmidyson @juliusv : Thanks a lot, it was quick :)

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Aug 19, 2015

You're welcome! Closing this issue here then.

@juliusv juliusv closed this Aug 19, 2015

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 24, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.