Wrong Content-Type for the /metrics endpoint
- Dominant language
- C++
- Stars
- 194
- Forks
- 34
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I deployed the daemonset and the service+servicemonitor resources on my cluster, but was having an error in prometheus. The issue is related to the content type of the /metrics endpoint being html instead of `text/plain; version=0.0.4`, which Prometheus doesn´t like. I had to patch the servicemonitor to set the `fallbackScrapeProtocol` to `PrometheusText0.0.4`.
Here's my full kustomization:
```yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- https://github.com/intel/xpumanager//deployment/kubernetes/daemonset/base/?timeout=120&ref=V1.2.39
- https://raw.githubusercontent.com/intel/xpumanager/refs/tags/V1.2.39/deployment/kubernetes/monitoring/service-intel-xpum.yaml
- https://raw.githubusercontent.com/intel/xpumanager/refs/tags/V1.2.39/deployment/kubernetes/monitoring/servicemonitor-intel-xpum.yaml
patches:
- patch: |
- op: remove
path: /spec/namespaceSelector
- op: add
path: /spec/fallbackScrapeProtocol
value: PrometheusText0.0.4
target:
kind: ServiceMonitor
```
I think this should be addressed in the server exposing the metrics
Contributor guide
Assessment
This issue has not been assessed yet.