Skip to content

fix: read the Pushgateway scheme property - #2692

Merged
zeitlinger merged 2 commits into
prometheus:mainfrom
sharanggupta:pushgateway-scheme-property
Nov 17, 2026
Merged

zeitlinger merged 2 commits into
prometheus:mainfrom
sharanggupta:pushgateway-scheme-property

Conversation

@sharanggupta

Copy link
Copy Markdown
Contributor

Setting io.prometheus.exporter.pushgateway.scheme makes PushGateway.builder().build() fail with "Invalid Pushgateway address. Expecting :": the property only accepts http or https, but the builder resolves it with Scheme.valueOf, which expects HTTP or HTTPS. It now uses Scheme.fromString; PushGatewayTest#testSchemeFromProperties fails without the change.

The scheme property only accepts "http" or "https", but the builder
resolved it with Scheme.valueOf, which expects the constant name, so
setting the property made build() fail with "Invalid Pushgateway
address". It now uses Scheme.fromString.

Signed-off-by: Sharang Gupta <sharang@sharanggupta.dev>
A scheme set as "HTTPS" through the properties builder was accepted
before, so keep accepting it.

Signed-off-by: Sharang Gupta <sharang@sharanggupta.dev>
@zeitlinger
zeitlinger merged commit 7cf92fe into prometheus:main Nov 17, 2026
24 checks passed
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.

2 participants