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

Tagging custom metrics, API v2

Conal_Buchanan1
Participant

We are creating custom business metrics using the metrics API v2.

 

Before, when sending custom metrics with API v1 we used to tag the custom device and we could use those tags for alerting profile filters.

 

I might have missed it but I'm unsure if it's possible to tag the v2 kind of metric.

Has anyone done something similar, how do you set up the tagging rules?

 

 

 

 

4 REPLIES 4

ChadTurner
DynaMight Legend
DynaMight Legend

If you are having troubles tagging them via custom device, you can always revert to the entity selector and tag them from that standpoint. The entity selector allows you to set a tag for any entity in Dynatrace. https://www.dynatrace.com/support/help/dynatrace-api/environment-api/entity-v2/entity-selector/ 

-Chad

adam_gardner
Dynatrace Champion
Dynatrace Champion

Extending what Chad said, you might want to look at the new generic entity model. Basic workflow is:

 

  1. Create an entity type (this can be anything you could model in the physical world - let's say a soda can)
  2. Push metrics with dimensions . An entity instance (an instance of a soda can) will be created. Metrics will be automatically attached to that entity. This also works with events.
  3. Use the v2 tag API (or an autotag rule) to tag your entity with a key / value which then makes everything else easier.

 

You can see your soda cans by going to abc123.live.dynatrace.com/ui/entity/list/entity:sodacan

adam_gardner_1-1634858071339.png

 

adam_gardner_0-1634857948369.png

 

The generic entity model looks interesting.

 

So I assume we cannot tag the metric directly but define a custom entity type that matches the dimension we send in order to create the entity we tag.

I'll start digging deeper into it, thank you.

Hi Conal,

 

Correct. In this case you'd define a new generic entity called sodacan and set the extractionrule to be some string (in my case sodacanid)

 

Then whenever you pass a metric, a new entity (think of an object in OOP) will be automatically created based on that unique ID.

 

adam_gardner_0-1635114332990.png

 

Feel free to reach out on email (firstname.lastname @ dynatrace.com) if you want to describe your setup in more detail privately.

 

Featured Posts