Skip to content

Lack of server label - Multi-Target Support #888

Closed
@rafal-skurka

Description

@rafal-skurka

Some of the metrics don't have a "server" label it's quite problematic in Multi-Target Support because we can't distinguish database servers and some useful graphs in the Grafana dashboard view incorrect data. In my opinion, that label should be added to every single metric to avoid mixing up data between different database servers.

Number of metrics with and without the "server" label

# with
➜  x git:(x) ✗ curl -s localhost:9187/metrics | grep -ci server 
    1465
#without 
➜  x git:(x) ✗ curl -s localhost:9187/metrics | grep -civ server 
    1338

Example metric without server label:

pg_database_size_bytes{container="prometheus-postgres-exporter", datname="green", endpoint="http", instance="192.168.226.57:9187", job="postgres-exporter-prometheus-postgres-exporter", namespace="monitoring", pod="postgres-exporter-prometheus-postgres-exporter-84675c5cfc-hbt77", service="postgres-exporter-prometheus-postgres-exporter"}
pg_database_size_bytes{container="prometheus-postgres-exporter", datname="blue", endpoint="http", instance="192.168.226.57:9187", job="postgres-exporter-prometheus-postgres-exporter", namespace="monitoring", pod="postgres-exporter-prometheus-postgres-exporter-84675c5cfc-hbt77", service="postgres-exporter-prometheus-postgres-exporter"}

Expected output from this metric:

pg_database_size_bytes{container="prometheus-postgres-exporter", datname="green",<trimmed>,server="green-server:5432"}
pg_database_size_bytes{container="prometheus-postgres-exporter", datname="blue",<trimmed>,server="blue-server:5432"}

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