17 Dec 2025
01:51 PM
- last edited on
18 Dec 2025
07:41 AM
by
MaciejNeumann
I would like to start using the Events API (v2) to post CUSTOM_DEPLOYMENT events to Dynatrace, from our CI/CD pipelines. The ultimate goal is to add this information to Dynatrace so it's useful to Davis and users to correlate deployments with issues that occur.
I am having difficulty with a couple of things, though.
1) How do I use the entitySelector? I see various examples, e.g. Events API v2 - POST an event — Dynatrace Docs, but I cannot find a good explanation of how to use it. In our case, our apps mostly run on Azure VM Scale Sets. So maybe I could use this to associate the Scale Set (I do know the scale set name during the deployment). If so, what would be the syntax for the entitySelector be?
2) Is there any other good way to associate the deployment with other things in Dynatrace? For instance, we tag a lot of objects in Dynatrace. Could I somehow "tag" this custom event as well? If so, how exactly would I do so?
17 Dec 2025 02:55 PM
@eric_h there can be many entities in Dynatrace, with entitySelector you can select entities of one type and not just for tagging.
Typically, you want to send deployment events to process groups, but it's not limited to a particular entity. For sending events, please rember a single entitySelector can select just entities of a single type. You need to call the postEvent API endpoint multiple types with different entitySelector for sending events to different types.
See an example here also have a look at the following video - Unleash the power of Events APIv2 – Integrate your DevOps Tools.
Featured Posts