K8s metrics endpoint not working

kubectl port-forward svc/dragonflydb 6379:6379

curl -v http://localhost:6379/metrics

  • Trying [::1]:6379…
  • Connected to localhost (::1) port 6379

GET /metrics HTTP/1.1
Host: localhost:6379
User-Agent: curl/8.4.0
Accept: /

  • Received HTTP/0.9 when not allowed
  • Closing connection
    curl: (1) Received HTTP/0.9 when not allowed

it’s possible port can accept both protocols within container, but for some reason doesn’t allow it when exposed as pod/service port.

Also tried from pod in same namespace:
root@redis-pod:/data# curl http://production-raptor-cache:6379/metrics
curl: (1) Received HTTP/0.9 when not allowed

Metrics are available on admin port 9999. If you want to setup monitoring, we have some documentation Integrate Prometheus with the Dragonfly Operator | Dragonfly. You can follow that.

1 Like

Thank you - I got it working with port 9999 on kubernetes clusterIP service.

  • this page might need edit because 6379 port for svc doesn’t work for /metrics (but the port works on docker container port forward) - must be due to how kubernetes handles ports.
1 Like