infra/home/cluster/tmobile-exporter/service.yaml
Graham McIntire 8466e4590f
tmobile-exporter: switch to stock json_exporter + nginx sidecar
Replaces the vendored Go exporter with two pre-built upstream images:
- quay.io/prometheuscommunity/json-exporter:v0.7.0 maps the gateway JSON
  into prometheus metrics via JSONPath. The G4AR keys signal blocks as
  "5g" / "4g" (digit-prefixed), which the k8s client-go JSONPath dialect
  only reaches via bracket-with-single-quote notation.
- nginxinc/nginx-unprivileged:1.27-alpine-slim sidecar rewrites
  GET /metrics → GET /probe?module=tmhi&target=http://192.168.12.1/...
  so the existing kubernetes-services scrape job picks it up over the
  apiserver proxy with no Prometheus-side config changes.

Avoiding caddy here: its binary carries cap_net_bind_service file caps,
which the kernel refuses to exec under no_new_privs as a non-root user.

Dashboard "Gateway up" panel now reads up{service="tmobile-exporter"}
(Prometheus's built-in scrape-success gauge) since json_exporter's
/probe endpoint does not emit probe_success.
2026-05-10 17:57:13 -05:00

18 lines
377 B
YAML

apiVersion: v1
kind: Service
metadata:
name: tmobile-exporter
namespace: monitoring
labels:
app.kubernetes.io/name: tmobile-exporter
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "9099"
spec:
selector:
app.kubernetes.io/name: tmobile-exporter
ports:
- name: metrics
port: 9099
targetPort: metrics
protocol: TCP