# Prometheus extension dimensions

**URL:** <https://community.dynatrace.com/t/prometheus-extension-dimensions/47431>\
**Category:** Extensions\
**Tags:** dynatrace-managed, prometheus, extensions\
**Created:** [September 2, 2024, 11:10am UTC](https://community.dynatrace.com/t/prometheus-extension-dimensions/47431 "2024-09-02T11:10:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PeterKenyeres](https://avatars.discourse-cdn.com/v4/letter/p/838e76/32.png) [@PeterKenyeres](https://community.dynatrace.com/u/PeterKenyeres)\
**Post date:** [September 2, 2024, 11:10am UTC](https://community.dynatrace.com/t/prometheus-extension-dimensions/47431/1 "2024-09-02T11:10:53Z")

</div>

Hi all,

I’m making a prometheus extension where metrics named with the id of the producer thread as in the code example. Right now each thread generates a separate dynatrace metric, but I would prefer the thread id as a dimension and only one metric named myapp.Smscntr. Is there any solution to this?

My current code:

```auto
prometheus:
  - group: myapp metrics 0
    interval:
      minutes: 1
    featureSet: all
    dimensions:
      - key: myapp
        value: const:myapp
    subgroups:

    - subgroup: myapp global gauge
      dimensions:
        - key: global_gauges
          value: const:global_gauges
      metrics:

        - key: myapp.Smscntr_Thread_0
          value: metric:Smscntr_Thread:0
          type: gauge
          featureSet: all

        - key: myapp.Smscntr_Thread_1
          value: metric:Smscntr_Thread:1
          type: gauge
          featureSet: all

        - key: myapp.Smscntr_Thread_2
          value: metric:Smscntr_Thread:2
          type: gauge
          featureSet: all

```

Thanks,  
Peter

---

<div class="post-metadata">

**Author:** ![rastislav\_danis](https://avatars.discourse-cdn.com/v4/letter/r/b9bd4f/32.png) [@rastislav\_danis](https://community.dynatrace.com/u/rastislav_danis)\
**Post date:** [September 2, 2024, 1:30pm UTC](https://community.dynatrace.com/t/prometheus-extension-dimensions/47431/2 "2024-09-02T13:30:03Z")

</div>

Any chance you can modify your prometheus source? If your source will be like:

```auto
Smscntr_Thread{thread="0"} value_0
Smscntr_Thread{thread="1"} value_1
Smscntr_Thread{thread="2"} value_2

```

then you can just use:

```auto
value: metric:Smscntr_Thread

```

and you will end with one metric with 3 dimensions.

---

<div class="post-metadata">

**Author:** ![PeterKenyeres](https://avatars.discourse-cdn.com/v4/letter/p/838e76/32.png) [@PeterKenyeres](https://community.dynatrace.com/u/PeterKenyeres)\
**Post date:** [September 3, 2024, 11:41am UTC](https://community.dynatrace.com/t/prometheus-extension-dimensions/47431/3 "2024-09-03T11:41:05Z")

</div>

Hello&nbsp;[@rastislav\_danis](https://community.dynatrace.com/user/38440)&nbsp;,

Thanks for the suggestion.&nbsp;Unfortunately changing the source is not possible.

---

<div class="post-metadata">

**Author:** ![rastislav\_danis](https://avatars.discourse-cdn.com/v4/letter/r/b9bd4f/32.png) [@rastislav\_danis](https://community.dynatrace.com/u/rastislav_danis)\
**Post date:** [September 3, 2024, 12:40pm UTC](https://community.dynatrace.com/t/prometheus-extension-dimensions/47431/4 "2024-09-03T12:40:39Z")

</div>

Then i’m afraid it’s not easily possible. There is no ootb option how to map 3 different prometheus metric endpoints into 1 dynatrace metric via prometheus v2 extension. You can use f.e. python v2 extension to achieve this.
