Assign teams to monitored entities
This guide explains how to assign team ownership to Dynatrace entities, allowing you to easily identify which team is responsible for each monitored entity.
Common use casesโ
- Quickly determine which team owns a specific entity and contact them when needed.
Prerequisitesโ
This guide assumes the following:
- You have a Port account and you have completed the onboarding process.
- You have installed Port's Dynatrace integration.
- You have entities from cloud providers configured on Dynatrace. See Dynatrace documentation for this.
Set up data modelโ
To establish team ownership, we will modify the Dynatrace Entity
blueprint by adding an owned_by
relation.
Follow the steps below to update the Dynatrace Entity
blueprint:
-
Go to the data model page of your portal, and locate the
Dynatrace Entity
blueprint. -
Hover over it, click on the
...
button on the right, and select "Edit JSON". -
Add the
owned_by
relation as shown below, then clickSave
:Team relation (Click to expand)
"relations": {
"owned_by": {
"title": "Owned By",
"target": "dynatraceTeam",
"required": false,
"many": true
}
}
Creating the mapping configurationโ
Now that the relationship between teams and monitored entities is defined, the next step is to assign the appropriate team to each Dynatrace Entity
. This can be done by adding mapping logic based on your ingested resources.
Dynatrace supports multiple methods for assigning team ownership, including Kubernetes labels and annotations, host metadata, environment variables, and tags.
To set up the mapping, navigate to the Dynatrace integration in the Data Sources page and add the following mapping based on your preferred method:
Dynatrace ownership configuration using Kubernetes labels and annotations
deleteDependentEntities: true
createMissingRelatedEntities: true
enableMergeEntity: true
resources:
- kind: entity
selector:
query: 'true'
entityTypes:
- `CLOUD_APPLICATION`
- `KUBERNETES_SERVICE`
- `KUBERNETES_CLUSTER`
# Add more entity types
entityFields: firstSeenTms,lastSeenTms,tags,properties,managementZones,fromRelationships,toRelationships
port:
entity:
mappings:
identifier: .displayName | gsub(" "; "-")
title: .displayName
blueprint: '"dynatraceEntity"'
properties:
firstSeen: .firstSeenTms / 1000 | todate
lastSeen: .lastSeenTms / 1000 | todate
type: .type
tags: .tags[].stringRepresentation
relations:
owned_by: .properties.kubernetesLabels | to_entries | map(select(.key == "dt.ower" or .key == "owner") | .value) | if length == 0 then null else . end
In this example, the dt.owner
and owner
keys from Kubernetes resource labels are used to define ownership. You should use the keys configured in your Dynatrace environment. For more details on setting up ownership keys, refer to the Dynatrace documentation
Dynatrace ownership configuration using tags
deleteDependentEntities: true
createMissingRelatedEntities: true
enableMergeEntity: true
resources:
- kind: entity
selector:
query: 'true'
entityTypes:
- `cloud:gcp:k8s_cluster`
- `cloud:gcp:pubsub_subscription`
- `cloud:gcp:pubsub_topic`
- `cloud:gcp:gcs_bucket`
- `cloud:gcp:gae_app`
- `cloud:aws:acmprivateca`
- `cloud:aws:api_gateway`
- `cloud:aws:app_runner`
- `cloud:aws:appstream`
- `cloud:aws:appsync`
- `cloud:azure:apimanagement:service`
- `cloud:azure:app:containerapps`
- `cloud:azure:app:managedenvironments`
- `cloud:azure:appconfiguration:configurationstores`
- `cloud:azure:appplatform:spring`
# see below section for more entity types
port:
entity:
mappings:
identifier: .displayName | gsub(" "; "-")
title: .displayName
blueprint: '"dynatraceEntity"'
properties:
firstSeen: .firstSeenTms / 1000 | todate
lastSeen: .lastSeenTms / 1000 | todate
type: .type
tags: .tags[] | map(.stringRepresentation)
relations:
owned_by: .tags | map(select(.key == "dt.owner" or .key == "owner") | .value) | if length == 0 then null else . end
In this example, the dt.owner
and owner
keys from the tags are used to define ownership. You should use the keys configured in your Dynatrace environment. For more details on setting up ownership keys, refer to the Dynatrace documentation
Next, click on the resync button and watch your Dynatrace entities
being mapped to the teams
as shown below in this example: