Skip to content

Add --web.nginx-metrics-only flag #1245

@jensschulze

Description

@jensschulze

Is your feature request related to a problem? Please describe.

We run this exporter (alongside others, also written in Go) in a Kubernetes environment using Kuma as the service mesh.
Metrics are aggregated per pod via Kuma sidecar's metrics-hijacker feature.

When multiple containers within the same pod expose Go runtime metrics, promhttp metrics, etc., these metrics automatically receive the Kuma sidecar’s labels. As a result, Prometheus reports duplicated metrics. This issue occurs consistently in our setup.

Describe the solution you'd like

Support disabling any metrics except for the Nginx metrics in the exporters (i.e. Go runtime metrics etc.)

This is quite straightforward to implement and has a small trade-off: the runtime metrics of the exporters are not essential for us. Based on our experience, the metrics exporters have never been the cause of operational issues in our systems.

Pull Request: #1241

Describe alternatives you've considered

We identified two possible alternatives:

  • Drop any Go runtime metrics (e.g. via Prometheus relabel rules). (Just no: we operate many Go applications whose metrics we have to monitor.)
  • Add custom labels to the Go runtime metrics. (More complex and kind of odd)

Metadata

Metadata

Assignees

No one assigned

    Labels

    communityIssues or PRs opened by an external contributor

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions