Prometheus target does not show anything

632 Views Asked by At

I am trying to extract metrics of an application to prometheus but on prometheus dashboard, under my target I do not see anything.

I added jmx promethous exporter in jvm paremeter and configured it to expose to 5555

${PROMETHOUS_PORT} = 9000
   

javaagent:${HOME}/jmx_prometheus_exporter.jar=${PROMETHOUS_PORT}:${CONF}/config.yaml 

config.yaml

hostPort: localhost:5555
username:
password:

rules:
- pattern: ".*"

My service.yaml

    ---
apiVersion: v1
kind: Service
metadata:
  name: my-exporter
  labels:
    type: my-monitorable
spec:
  type: ClusterIP
  selector:
    app: myapp
    project: lx
  ports:
    - name: prometheus-exporter
      protocol: TCP
      port: 9000
      targetPort: 9000

My service monitor to add target:

- name: my-app
  selector:
    matchLabels:
      type: my-monitorable
  namespaceSelector:
    any: true
  endpoints:
  - port: prometheus-exporter
    interval: 30s
    path: /metrics
    scheme: http
      

What is wrong with my configuration ?

0

There are 0 best solutions below