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

instance label is not included if missing #47

Open
friedrichg opened this issue Nov 5, 2023 · 0 comments · May be fixed by #48
Open

instance label is not included if missing #47

friedrichg opened this issue Nov 5, 2023 · 0 comments · May be fixed by #48

Comments

@friedrichg
Copy link

friedrichg commented Nov 5, 2023

Prometheus always includes instance label in federation
https://github.com/prometheus/prometheus/blob/7a07a279c90e5eed35069a4d5cecb15e0aa7ec8b/web/federate.go#L180C2-L182

This proxy does not do that, but it could be added. Along with support for external labels.

Example

$ cat prometheus.yml
rule_files:
- recording.rules
$ cat recording.rules
groups:
  - name: example
    rules:
    - record: test
      expr: 1
$ prometheus
ts=2023-11-05T15:56:15.361Z caller=main.go:556 level=info msg="Starting Prometheus Server" mode=server version="(version=2.42.0, branch=non-git, revision=non-git)"
...
curl -v 'http://127.0.0.1:9090/federate?match[]=test'
*   Trying 127.0.0.1:9090...
* Connected to 127.0.0.1 (127.0.0.1) port 9090 (#0)
> GET /federate?match[]=test HTTP/1.1
> Host: 127.0.0.1:9090
> User-Agent: curl/7.88.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: text/plain; version=0.0.4; charset=utf-8
< Date: Sun, 05 Nov 2023 15:54:34 GMT
< Content-Length: 54
<
# TYPE test untyped
test{instance=""} 1 1699199580857
* Connection #0 to host 127.0.0.1 left intact
@friedrichg friedrichg linked a pull request Nov 6, 2023 that will close this issue
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 a pull request may close this issue.

1 participant