What you will learn in this TP
- Confirm access to the Dynatrace cluster
- Generate an API Token with the correct permissions
- Understand the overall structure of an Entity Selector
- Master the basic selection criteria
- Write a complex Entity Selector
- Know how to target specific entities with tags
- Create an API Token with the necessary permissions
- Test an Entity Selector query via the REST API v2
- Dynamically validate the result returned by Dynatrace
- Create a Segment in the Dynatrace console
- Apply an Entity Selector rule to a segment
Prerequisites #
What you will learn in this section
- Confirm access to the Dynatrace cluster
- Generate an API Token with the correct permissions
You need a Dynatrace cluster (SaaS or Managed) with agents deployed, as well as an API Token with entity read permissions (`entities.read`).
Reminder: Syntax and Key Operators #
What you will learn in this sectionAn Entity Selector is a string used to filter Dynatrace entities. It's made up of selection criteria separated by commas (which act as a logical AND operator).
- Understand the overall structure of an Entity Selector
- Master the basic selection criteria
Tip: you can use the NOT operator to exclude entities, for example type("HOST"),not(tag("ENV:DEV")).The main criteria
Here are the most commonly used operators for targeting your entities:- type(): filters by entity type (e.g. HOST, SERVICE, APPLICATION).
- tag(): filters by tag. Accepts the key:value format (e.g.
tag("env:training")). - entityName(): filters by entity name, very useful with wildcard characters like
*.
Creating an Entity Selector #
What you will learn in this sectionThe goal is to isolate a subset of your infrastructure. Write an 'entity selector' that targets only the machines (HOST) with the tag 'env=training'.
- Write a complex Entity Selector
- Know how to target specific entities with tags
Golden design rule (scaling): for every selection rule, you must always define either an Entity ID (the entity's unique identifier) or an Entity type.
Best practice: using fixed Entity IDs should be avoided in production, since they're too specific and rigid. To ensure management at scale that stays compatible with the dynamic lifecycle of your infrastructure, use only the Entity type combined with dynamic attributes or tags.
Selector syntax
Write the query to select these entities.
Full Stack Linux servers
List all Linux servers with 'Full stack' monitoring.
Tomcat and Docker services
Display the services using the 'Apache Tomcat' and 'Docker' technologies.
Validation via API #
What you will learn in this section
- Create an API Token with the necessary permissions
- Test an Entity Selector query via the REST API v2
- Dynamically validate the result returned by Dynatrace
Before applying a rule to a Management Zone or a Segment, it's strongly recommended to test it. Use the Dynatrace API (v2) to check which entities are returned by your selector.
Creating the token
To query the Dynatrace API, you need an API Token with the `entities.read` permission. Create this token in your Dynatrace environment.
Testing the queries
Use the following `curl` commands to test the Entity Selectors you created. Don't forget to replace `{YOUR_TOKEN}` with your API token and to adapt your environment's URL if needed (here `https://demo.dynatrace.rousseltm.fr`).Tip: URL-encoding special characters (like quotes `"`, which become `%22`) is crucial for `curl` requests.
Creating segments #
What you will learn in this section
- Create a Segment in the Dynatrace console
- Apply an Entity Selector rule to a segment
Now that your 'entity selector' is validated, use it to create a new segment named after your first name.
Configuration in the console
Describe the steps to create the Segment based on the 'Tomcat and Docker services' selector in the Dynatrace interface.
Difficulty level : ●●●○○ (3/5)
My progress
Sign in to track your progress and take notes. Sign in
Course Glossary
AIOps (Artificial Intelligence for IT Operations)
The use of artificial intelligence and machine learning to automate and improve IT operations (e.g., anomaly detection, reducing alert noise).
OpenTelemetry
An open source framework providing standards, APIs, and SDKs to collect and export observability data (traces, metrics, logs) in an agnostic way.
Recommended Articles
Dynatrace : Maîtriser les Entity Selectors pour une observabilité à grande échelle
Découvrez l'importance stratégique des Entity Selectors, maîtrisez leur syntaxe avancée, et adopt...
Dynatrace : Management Zones vs Segments
Comprenez les différences fondamentales entre les Management Zones et les Segments dans Dynatrace...
Segments et nouvelle plateforme : remplacer les management zones
Comprendre les segments de la nouvelle plateforme Dynatrace : différences avec les management zon...
Guide des Bonnes Pratiques Dynatrace : Vers une Observabilité Mature
Optimisez votre plateforme Dynatrace grâce à nos recommandations d'experts : automatisation du ta...
ActiveGate et network zones : architecture, routage et haute disponibilité
Comprendre et déployer ActiveGate dans Dynatrace : rôles (routage, API, intégrations cloud, exten...
Exploiter l'API Dynatrace v2 : Guide Complet de l'Automatisation
Apprenez à utiliser l'API Dynatrace pour automatiser votre observabilité : gestion des scopes, ro...
Logs avancés avec OpenPipeline : traitement, masquage, buckets et rétention
Gérer les logs dans Dynatrace avec OpenPipeline : ingestion, routage, traitement DQL (parsing, en...
Dynatrace Synthetic Monitoring : Guide complet et bonnes pratiques
Découvrez comment utiliser le Synthetic Monitoring de Dynatrace pour surveiller proactivement vos...
Davis AI avancé : détection d'anomalies, IA causale, prédictive et générative
Comprendre Davis AI : seuils statiques, baselines auto-adaptatives et saisonnières, analyse causa...