15 Jul 2025 05:04 PM
Dynatrace users, especially those who rely on generic entity types from integrations/extensions, can sometimes run into the default limit for the number of entities per entity type. When this limit is hit, no new entities are created for that type until the monitored entity periodic junk cleanup worker clears out old entities, allowing for new entities to be created.
While `dsfm:server.monitored_entities.entity_count_per_entity_type` metric exists, it can be inconsistent or miss some generic entities in its count.
To workaround this, I've created a Platform Workflow that uses the Dynatrace API to:
This allows us to track the per-entity-type count of entities, and optionally setup metric events and/or Davis Anomaly Detectors which can alert when a given entity type is close to reaching the limit.
Download the Workflow Template from Github > Import it into the Platform Workflows App.
Create a new Access Token with the following scopes: metrics.ingest, metrics.write, entities.read
Set this Access Token up within Credential Vault. Copy the Credential ID once created.
Edit the following lines within each JS Code Tile on the Workflow to point to the created Credential Vault Entry - Replace CREDENTIALS_VAULT-XXXX with your Credential ID:
Optionally, change the trigger be to a schedule, or leave it as an on-demand trigger. I would suggest executing this workflow at most once every hour, so as to not overload the Dynatrace API Endpoints with numerous GET requests when the numbers likely won't change super frequently on an hourly basis.
Once we've had a successful workflow execution, we should then be able to setup Metric Events/Davis Anomaly Detectors which will alert when a given entity is close to breaching the limit. We can also use Data Explorer/Dashboards to chart the entity counts per type over time.
15 Jul 2025 05:31 PM
Examples of the data we can view once we have successful Workflow execution
18 Jul 2025 03:04 AM
@bsnurka Thank you for sharing the workflow, this is very helpful and something I have been looking for 👍
One issue I noticed is the .apps and .live is being replace with just " . " and this seems to throwing up an error . It worked for me once I updated it to replace only .apps with .live
Also, is there a way we can have entity_limit_per_entity_type also extracted , this would help with understand the upper limits for breach.