Skip to content

instance label is not included if missing #47

Open
@friedrichg

Description

@friedrichg

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions