Skip to content

Newt Helm chart requires manual NEWT_METRICS_PROMETHEUS_ENABLED=true and non-loopback adminAddr for Prometheus scraping #16

Description

@slydlake

Summary

In my Kubernetes setup (Flux + Prometheus Operator), Newt metrics only work when we manually set both:

  • extraEnv.NEWT_METRICS_PROMETHEUS_ENABLED: "true"
  • global.metrics.adminAddr: "0.0.0.0:9090"

Without these overrides, ServiceMonitor scraping fails.

Environment

  • Helm chart: fosrl/newt (1.2.0)
  • Deployment method: Flux HelmRelease
  • Monitoring: Prometheus Operator (ServiceMonitor)
  • Metrics service enabled via chart values (global.metrics.service.enabled: true)
  • ServiceMonitor enabled via chart values (global.metrics.serviceMonitor.enabled: true)

What I observe

  • Metrics Service and Endpoints are created and point to port 9090.
  • ServiceMonitor scrapes the metrics service port.
  • Newt pod does not expose working metrics unless we set both values above.

Observed failure modes:

  • connection refused on podIP:9090 when Newt is still bound to loopback/default admin address.
  • 404 /metrics when Prometheus exporter is not explicitly enabled.

Why both settings are required in my environment

1) NEWT_METRICS_PROMETHEUS_ENABLED: "true"

global.metrics.enabled: true in chart values does not reliably enable the Newt Prometheus exporter at runtime by itself.

In our rendered deployment:

  • NEWT_METRICS_PROMETHEUS_ENABLED is not present by default.
  • --metrics CLI flag is also not present.

Result: /metrics is not served (404), even if admin HTTP is reachable.

2) adminAddr: "0.0.0.0:9090"

Default admin binding is loopback-oriented (127.0.0.1:2112 behavior path), which is not reachable through Kubernetes Service/Endpoints scraping from outside the container namespace.

My ServiceMonitor path is:
Prometheus -> Service -> PodIP:9090

Therefore Newt must bind to a non-loopback address and matching port.
0.0.0.0:9090 satisfies this and aligns with the chart’s metrics service defaults.

Important: ":9090" is not accepted by chart schema (requires host:port format), so 0.0.0.0:9090 is required.

Current workaround

values:
  global:
    extraEnv:
      NEWT_METRICS_PROMETHEUS_ENABLED: "true"
    metrics:
      enabled: true
      adminAddr: "0.0.0.0:9090"
      service:
        enabled: true
      serviceMonitor:
        enabled: true

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