# Prometheus Extension 2.0 best practices

**URL:** <https://community.dynatrace.com/t/prometheus-extension-2-0-best-practices/48556>\
**Category:** Extensions\
**Tags:** prometheus, extensions\
**Created:** [October 25, 2024, 12:20pm UTC](https://community.dynatrace.com/t/prometheus-extension-2-0-best-practices/48556 "2024-10-25T12:20:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SjoerdB](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/sjoerdb/32/157_2.png) [@SjoerdB](https://community.dynatrace.com/u/SjoerdB)\
**Post date:** [October 25, 2024, 12:20pm UTC](https://community.dynatrace.com/t/prometheus-extension-2-0-best-practices/48556/1 "2024-10-25T12:20:47Z")

</div>

Hi fellow Dynatracers,

I am currently writing an extension for scraping a prometheus endpoint of an appliance. This is a virtual appliance that is under update control of the supplier.

**Coding**

- What is best practice for the extension name (e.g. biz.ictcore.\<suppliername\>.\<supplierProductname\>) to use safe namespaces (ictcore.biz is my domain)?

- What is best practice for the metrics naming (\<suppliername\>.\<supplierProductname\>.\<original prometheusMetricname\>), to avoid clashes?

- This specific Prometheus reply also contains some static values, like a build\_info metric. How could I put this information into **attributes** for my topology, so that it gets visible in the **properties** (like I already put in some other info in properties)?

example for&nbsp;\<suppliername\>.\<supplierProductname\> could be paloalto.cortexxdr or f5.bigip … etc.

---

<div class="post-metadata">

**Author:** ![SjoerdB](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/sjoerdb/32/157_2.png) [@SjoerdB](https://community.dynatrace.com/u/SjoerdB)\
**Post date:** [December 4, 2024, 1:03pm UTC](https://community.dynatrace.com/t/prometheus-extension-2-0-best-practices/48556/2 "2024-12-04T13:03:23Z")

</div>

Anyone has an idea on how to get e.g. those attributes from a “static” metric? The other stuff I can just decide myself, for those questions I was only hoping for additional insights from fellow-dynatracers.

---

<div class="post-metadata">

**Author:** ![Mike\_L](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mike_l/32/11717_2.png) [@Mike\_L](https://community.dynatrace.com/u/Mike_L)\
**Post date:** [December 18, 2024, 8:57am UTC](https://community.dynatrace.com/t/prometheus-extension-2-0-best-practices/48556/3 "2024-12-18T08:57:23Z")

</div>

For question 1 and 2, I think you propose a good system for them.

As for 3, you can always download the YAML’s of existing extensions from the Dynatrace hub and have a look. the f5 contain most functionality. Here’s how it’s done as soon as the value is added as a dimension to the metric line:

```markup
topology:
  types:
    # Generic Network Types
    - name: network:device
      enabled: true
      displayName: Network device
      rules:
        - idPattern: network_device_{device.address}
          instanceNamePattern: "{instance.name}"
          iconPattern: f5
          sources:
            - sourceType: Metrics
              condition: $eq(com.dynatrace.extension.f5.bigip.sys.uptime)
          requiredDimensions:
            - key: instance.systemname
          attributes:
            - key: devMonitoringMode
              displayName: Monitoring mode
              pattern: "{monitoring.mode}"

```

---

<div class="post-metadata">

**Author:** ![SjoerdB](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/sjoerdb/32/157_2.png) [@SjoerdB](https://community.dynatrace.com/u/SjoerdB)\
**Post date:** [February 3, 2025, 1:16pm UTC](https://community.dynatrace.com/t/prometheus-extension-2-0-best-practices/48556/4 "2025-02-03T13:16:05Z")

</div>

Took me little longer to put some focus on this, but it “works like a charm”, thank you very much for this…!
