<p>Good afternoon everyone, I have a question about adding monitoring of the application itself to prometheus.
I am using spring boot actuator and see the values for prometheus accordingly: <a href="https://example.com/actuator/prometheus" rel="nofollow noreferrer">https://example.com/actuator/prometheus</a>
I have raised prometheus via the default helm chart (<code> helm -n monitor upgrade -f values.yaml pg prometheus-community/kube-prometheus-stack</code> )by adding default values for it:</p>
<pre><code>additionalScrapeConfigs:
  job_name: prometheus
  scrape_interval: 40s
  scrape_timeout: 40s
  metrics_path: /actuator/prometheus
  scheme: https
</code></pre>
<p>Prometheus itself can be found at <a href="http://ex.com/prometheus" rel="nofollow noreferrer">http://ex.com/prometheus</a>
The deployment.yaml file of my springboot application is as follows:</p>
<pre><code>apiVersion : apps/v1
kind: Deployment
metadata:
  name: {{ .Release.Name }}
spec:
  replicas: {{ .Values.replicaCount }}
  selector:
    matchLabels:
      app: backend
  template:
    metadata:
      labels:
        app: backend
      annotations:
        prometheus.io/path: /actuator/prometheus
        prometheus.io/scrape: &quot;true&quot;
        prometheus.io/port: &quot;8080&quot;
    spec:
      containers:
      - env:
        - name: DATABASE_PASSWORD
          value: {{ .Values.DATABASE_PASSWORD }}
        - name: DATASOURCE_USERNAME
          value: {{ .Values.DATASOURCE_USERNAME }}
        - name: DATASOURCE_URL
          value: jdbc:postgresql://database-postgresql:5432/dev-school
        name : {{ .Release.Name }}
        image: {{ .Values.container.image }}
        ports:
        - containerPort : 8080
</code></pre>
<p>However, after that prometheus still can't see my values.
Can you tell me what the error could be?</p>

Denis
<p>In prometheus-operator,</p>
<p><code>additionalScrapeConfigs</code> is not used in this way.</p>
<p>According to documentation <a href="https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/additional-scrape-config.md" rel="nofollow noreferrer">Additional Scrape Configuration</a>:
<strong>AdditionalScrapeConfigs</strong> allows specifying a key of a Secret containing additional Prometheus scrape configurations.</p>
<p>The easiest way to add new scrape config is to use a <code>servicemonitor</code>, like the example below:</p>
<pre><code>apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: example-app
  labels:
    team: frontend
spec:
  selector:
    matchLabels:
      app: backend
  endpoints:
  - port: web
</code></pre>
