dragonflydb / dragonflydb/dragonfly-operator
Issues with prom metrics
- Dominant language
- Go
- Stars
- 357
- Forks
- 111
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
I have created a PodMonitor and noticed prom can scrape the target.
Prometheus picks it up, but with scraping error `Error scraping target: non-compliant scrape target sending blank Content-Type and no fallback_scrape_protocol specified for target`.
I also tried to port forward directly to a dragonfly pod to port 9999 and visit `localhost:9999/metrics` and I get nothing.
Might have missed something obvious here...
**The PodMonitor**
```
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: dragonfly-pod
labels:
group: dragonfly
app: dragonfly-pod
spec:
selector:
matchLabels:
app: dragonfly-pod
podTargetLabels:
- app
podMetricsEndpoints:
- port: admin
```
**And the dragonfly yaml**
```
apiVersion: dragonflydb.io/v1alpha1
kind: Dragonfly
metadata:
name: dragonfly-pod
spec:
labels:
app: dragonfly-pod
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: "app"
operator: In
values:
- dragonfly-pod
topologyKey: "kubernetes.io/hostname"
image: docker.dragonflydb.io/dragonflydb/dragonfly:v1.21.2
args:
- "--cluster_mode=emulated"
- "--lock_on_hashtags"
- "--dbfilename=dragonfly-snapshot"
authentication:
passwordFromSecret:
name: dragonfly-auth-secret
key: password
replicas: 3
nodeSelector:
node.kubernetes.io/instance-type: ccx13
resources:
requests:
cpu: 500m
memory: 2Gi
limits:
cpu: 2000m
memory: 6Gi
serviceSpec:
type: LoadBalancer
snapshot:
cron: "*/5 * * * *"
persistentVolumeClaimSpec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
```
**Expected behavior**
Would assume if I just port forward to my pod and visit `/metrics` I would see prom stats but I just get an empty response.
Contributor guide
Assessment
This issue has not been assessed yet.