http_sd_configs: authorization.type is not defaulted to "Bearer" as doc claims
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 717
- Forks
- 1.2k
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 19
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked Prometheus configuration documentation and its http_sd_config authorization section, then compare the documented default with the supplied YAML examples and observed header behavior. Done means the documentation accurately matches the supported behavior and clearly explains whether type must be set explicitly.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100