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

http_sd_configs: authorization.type is not defaulted to "Bearer" as doc claims #2377

Open
resmo opened this issue Aug 27, 2023 · 0 comments
Open

Comments

@resmo
Copy link

resmo commented Aug 27, 2023

In https://prometheus.io/docs/prometheus/latest/configuration/configuration/#http_sd_config

Docs says:

# Optional `Authorization` header configuration.
authorization:
  # Sets the authentication type.
  [ type: [<string>] | default: Bearer ]

But it did not work, this config below does not send Bearer

scrape_configs:
  - job_name: xyz
    http_sd_configs:
      - url: "http://127.0.1:8000"
        authorization:
          credentials: <token>

While enabled debug on my endpoint showed, it only sends

Authorization: <token>

not the expected

Authorization: Bearer <token>

After setting the type explicitly, the config worked as expected:

scrape_configs:
  - job_name: xyz
    http_sd_configs:
      - url: "http://127.0.1:8000"
        authorization:
          credentials: <token>
          type: Bearer
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