cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to Define Metric Units and Map Entities in Dynatrace Custom Extension 2.0

kpurimitla
Participant


Question:
I have developed a Dynatrace Custom Extension 2.0 which is based on Python and it is running successfully. However, I noticed that the metadata of the metrics sent by the extension has:

Units: Unspecified
Entity: Unknown

I want to define the unit of the metric and map the entity type directly within the extension itself, rather than manually configuring them in the Dynatrace UI.

Key Questions:

1.How can I specify the unit of a metric inside the extension YAML or Python script?
2.How can I map an entity type (e.g., CUSTOM_DEVICE, HOST, PROCESS_GROUP) directly in the extension to ensure correct association?
3.When I manually configured the entity details in the Dynatrace UI, I experienced "Unknown Custom Devices." How can I avoid this and ensure the device gets its correct name?

What I Have Tried:
I have defined units in the metadata section of the YAML file, but the metrics are still showing as "unspecified." I also tried mapping the entity type but faced  unknown devices naming convention for the custom device instead of it's actual name.

Looking for Guidance On:
Best practices for defining metric units
How to ensure entity mapping works correctly
Avoiding "Unknown Custom Devices" in the Dynatrace UI

1 REPLY 1

JamesKitson
Dynatrace Guru
Dynatrace Guru

For the units, this is defined in the metrics section at root of the extension yaml document, since you haven't provided any of what you wrote their I don't know if there is some issue with what was defined.

For topology you define that in the extension yaml as well which sets: https://docs.dynatrace.com/docs/ingest-from/extend-dynatrace/extend-topology. This creates custom topology rules in the environment that will 'detect' entities from the incoming metric data points that match these rules. You don't need to do anything for the entities 'manually' in the UI. I'm not sure what you are doing so I don't know why you would be seeing unknown custom devices.

I would recommend going through our RabbitMQ example: https://developer.dynatrace.com/develop/dynatrace-extensions-vscode/guides/create_extension/

The source, including the YAML is available here: https://github.com/dynatrace-extensions/python-rabbitmq/blob/main/extension/extension.yaml

You can check to see if how you are doing things matches how it is done in this extension.

Featured Posts