<p>First off a little new to using helm...</p>
<p>So I'm struggling to get the helm deployment of this: <a href="https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack" rel="noreferrer">https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack</a></p>
<p>To work the way I would like in my kubernetes cluster. I like what it has done so far but how can I make it scrape a custom endpoint? I have seen this: <a href="https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus" rel="noreferrer">https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus</a></p>
<p>Under the section titled: &quot;<strong>Scraping Pod Metrics via Annotations</strong>&quot;. I have added the following annotations to the pod deployment (and then the node port service) in kubernetes:</p>
<pre><code>annotations = {
 &quot;prometheus.io/scrape&quot; = &quot;true&quot;
 &quot;prometheus.io/path&quot;   = &quot;/appMetrics/prometheusMetrics&quot;
 &quot;prometheus.io/port&quot;   = &quot;443&quot;
}
</code></pre>
<p>However, when I look in the <code>targets</code> page of prometheus I don't see it there. I also don't see it in the configuration file. So that makes me think this helm chart isn't deploying the same <code>prometheus</code> chart.</p>
<p>So now the question is, how can I setup a custom scrape endpoint using the helm chart <code>kube-prometheus-stack</code>. From my reading this is the one I should* be using, right?</p>

<p>Try this below in your custom_values.yaml and apply it.</p>
<pre><code>prometheus:
  prometheusSpec:
    additionalScrapeConfigs:
      - job_name: your_job_name
        scrape_interval: 15s
        kubernetes_sd_configs:
        - role: pod
          namespaces:
            names:
              - your_namespace
        relabel_configs:
        - source_labels: [__meta_kubernetes_namespace]
          action: replace
          target_label: namespace
        - source_labels: [__meta_kubernetes_pod_name]
          action: replace
          target_label: pod
        - source_labels: [__address__]
          action: replace
          regex: ([^:]+)(?::\d+)?
          replacement: ${1}:your_port
          target_label: __address__
        - source_labels: [__meta_kubernetes_pod_label_app]
          action: keep
          regex: your_pod_name
</code></pre>
<p>You need to replace <code>your_job_name</code>, <code>your_namespace</code>, <code>your_port</code>, <code>your_pod_name</code> to your deployment file. After I did the above metric and re-install Prometheus by helm chart, now I can see the target, and the metrics get exposed.</p>
