# Steps Required To Support Metrics Ingestion From Prometheus Server Residing in K8s Cluster

**URL:** <https://community.dynatrace.com/t/steps-required-to-support-metrics-ingestion-from-prometheus-server-residing-in-k8s-cluster/38198>\
**Category:** Open Q&A\
**Tags:** activegate, dynatrace-managed, prometheus, extensions\
**Created:** [January 30, 2023, 3:36pm UTC](https://community.dynatrace.com/t/steps-required-to-support-metrics-ingestion-from-prometheus-server-residing-in-k8s-cluster/38198 "2023-01-30T15:36:28Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ankurs](https://avatars.discourse-cdn.com/v4/letter/a/e9c0ed/32.png) [@ankurs](https://community.dynatrace.com/u/ankurs)\
**Post date:** [January 30, 2023, 3:36pm UTC](https://community.dynatrace.com/t/steps-required-to-support-metrics-ingestion-from-prometheus-server-residing-in-k8s-cluster/38198/1 "2023-01-30T15:36:28Z")

</div>

I wanted to check the feasibility and possible way to fulfill this requirement.

What is the possible solution for ingesting metrics to Dynatrace from prometheus server residing in K8s OCP cluster? I am aware of Extension 2.0 (Prometheus Datasource).&nbsp; can Extension 2.0 be used for this purpose? And while writing an extension is there any architectural point I should keep in mind?

---

<div class="post-metadata">

**Author:** ![MichalOlszewski](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@MichalOlszewski](https://community.dynatrace.com/u/MichalOlszewski)\
**Post date:** [February 3, 2023, 9:02am UTC](https://community.dynatrace.com/t/steps-required-to-support-metrics-ingestion-from-prometheus-server-residing-in-k8s-cluster/38198/2 "2023-02-03T09:02:03Z")

</div>

Hi&nbsp;[@ankurs](https://community.dynatrace.com/user/58873)

The only thing You need to do is expose prometheus endpoints to active gate You will use to monitor it with mentioned by You Extension 2.0. Prometheus can be configured to provide data in prometheus format thus Extensions 2.0 can be used to query its data just like prometheus datasource - we had a chance to do it for Spark data in prometheus&nbsp; in the past.

Bests&nbsp;  
Michał

---

<div class="post-metadata">

**Author:** ![ankurs](https://avatars.discourse-cdn.com/v4/letter/a/e9c0ed/32.png) [@ankurs](https://community.dynatrace.com/u/ankurs)\
**Post date:** [February 6, 2023, 12:11pm UTC](https://community.dynatrace.com/t/steps-required-to-support-metrics-ingestion-from-prometheus-server-residing-in-k8s-cluster/38198/3 "2023-02-06T12:11:37Z")

</div>

Hello&nbsp;[@MichalOlszewski](https://community.dynatrace.com/user/51714)&nbsp;,

Thank you for the confirmation. One follow-up question, Is this ActiveGate located inside the K8s cluster or outside?

Thanks!

-Ankur

---

<div class="post-metadata">

**Author:** ![MichalOlszewski](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@MichalOlszewski](https://community.dynatrace.com/u/MichalOlszewski)\
**Post date:** [February 6, 2023, 3:18pm UTC](https://community.dynatrace.com/t/steps-required-to-support-metrics-ingestion-from-prometheus-server-residing-in-k8s-cluster/38198/4 "2023-02-06T15:18:46Z")

</div>

Hi&nbsp;[@ankurs](https://community.dynatrace.com/user/58873)&nbsp;,

officially is better to have it outside, but You can modify config for containerized ActiveGate and it works as well, but some automation things doesn’t work thus requiring manual steps.  
Regards  
Michał

---

<div class="post-metadata">

**Author:** ![ankurs](https://avatars.discourse-cdn.com/v4/letter/a/e9c0ed/32.png) [@ankurs](https://community.dynatrace.com/u/ankurs)\
**Post date:** [February 6, 2023, 3:29pm UTC](https://community.dynatrace.com/t/steps-required-to-support-metrics-ingestion-from-prometheus-server-residing-in-k8s-cluster/38198/5 "2023-02-06T15:29:08Z")

</div>

ok. could you please confirm which module name I should choose exactly for Extension 2.0?&nbsp; I couldn’t find this in the official documentation. Even this [sample dynakube](https://github.com/Dynatrace/dynatrace-operator/blob/master/assets/samples/cloudNativeFullStack.yaml#L171)&nbsp;yaml mentions only 4 modules.

---

<div class="post-metadata">

**Author:** ![MichalOlszewski](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@MichalOlszewski](https://community.dynatrace.com/u/MichalOlszewski)\
**Post date:** [February 7, 2023, 5:04am UTC](https://community.dynatrace.com/t/steps-required-to-support-metrics-ingestion-from-prometheus-server-residing-in-k8s-cluster/38198/6 "2023-02-07T05:04:19Z")

</div>

Hi,  
It’s not exactly that easy, cause like I said it is recommended to have it outside.  
Officially having extensions on Containerized AG is not supported - please look&nbsp;[https://community.dynatrace.com/t5/Extensions/Support-for-Extension-2-0-in-containerized-ActiveGate/m-p/173065#M1717](https://community.dynatrace.com/post/173065#M1717)  
You can force it and it works for most cases. I would have to find and revive my " playing with AG env" to check what parameter was allowing to do so - but it was something obvious like extensionmodule or alike. Still there were things like pushing Extension config which wasn’t detecting ContainerizedAG as valid, so I had to push configs for that manually. Making it a little bit messy. Thus recommend using external AG and Commenting/Adding votes for DT support of EXT2.0 on Containerized ActiveGates rather that maintaining this half manual approach (that have to be redone every time AG updates)

---

<div class="post-metadata">

**Author:** ![ankurs](https://avatars.discourse-cdn.com/v4/letter/a/e9c0ed/32.png) [@ankurs](https://community.dynatrace.com/u/ankurs)\
**Post date:** [February 7, 2023, 7:51am UTC](https://community.dynatrace.com/t/steps-required-to-support-metrics-ingestion-from-prometheus-server-residing-in-k8s-cluster/38198/7 "2023-02-07T07:51:58Z")

</div>

Thanks,&nbsp;[@MichalOlszewski](https://community.dynatrace.com/user/51714)&nbsp;for your detailed explanation.

---

<div class="post-metadata">

**Author:** ![Enrico\_F](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/enrico_f/32/23774_2.png) [@Enrico\_F](https://community.dynatrace.com/u/Enrico_F)\
**Post date:** [February 13, 2023, 8:05am UTC](https://community.dynatrace.com/t/steps-required-to-support-metrics-ingestion-from-prometheus-server-residing-in-k8s-cluster/38198/8 "2023-02-13T08:05:10Z")

</div>

Actually, if you’ve already enabled monitoring of the Kubernetes cluster via the operator (see [Connect your Kubernetes/OpenShift clusters to Dynatrace](https://www.dynatrace.com/support/help/shortlink/deploy-ag-dynatrace-op) ) it’s very easy to ingest gauge, counter and&nbsp;summary&nbsp;metrics from Prometheus exporters&nbsp;in a cloud-native way by simply annotating exporter pods and/or services:

[Monitor Prometheus metrics | Dynatrace Docs](https://www.dynatrace.com/support/help/how-to-use-dynatrace/infrastructure-monitoring/container-platform-monitoring/kubernetes-monitoring/monitor-prometheus-metrics#monitor-prometheus-metrics)

---

<div class="post-metadata">

**Author:** ![mreider](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mreider/32/14971_2.png) [@mreider](https://community.dynatrace.com/u/mreider)\
**Post date:** [March 28, 2023, 12:39pm UTC](https://community.dynatrace.com/t/steps-required-to-support-metrics-ingestion-from-prometheus-server-residing-in-k8s-cluster/38198/9 "2023-03-28T12:39:30Z")

</div>

I’d like to refer people interested in Prometheus in Kubernetes clusters to this feedback thread for more input:

[https://community.dynatrace.com/t5/Feedback-channel/Feedback-Channel-for-Prometheus-Monitoring-in-Kubernetes/td-p/208264](https://community.dynatrace.com/topic/208264)

---

<div class="post-metadata">

**Author:** ![zip-chanko](https://avatars.discourse-cdn.com/v4/letter/z/8c91f0/32.png) [@zip-chanko](https://community.dynatrace.com/u/zip-chanko)\
**Post date:** [March 12, 2024, 10:50am UTC](https://community.dynatrace.com/t/steps-required-to-support-metrics-ingestion-from-prometheus-server-residing-in-k8s-cluster/38198/10 "2024-03-12T10:50:02Z")

</div>

Just in case, same question to here.

[https://community.dynatrace.com/t5/Feedback-channel/Feedback-Channel-for-Prometheus-Monitoring-in-Kubernetes/m-p/239579/highlight/true#M3118](https://community.dynatrace.com/post/239579)
