RousselTMLEARNING

TP · Dynatrace: From Discovery to Expertise

Lab - Creating and Using Entity Selectors

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 section
  • Understand the overall structure of an Entity Selector
  • Master the basic selection criteria
An 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).
Tip: you can use the NOT operator to exclude entities, for example type("HOST"),not(tag("ENV:DEV")).
  1. 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 section
  • Write a complex Entity Selector
  • Know how to target specific entities with tags
The goal is to isolate a subset of your infrastructure. Write an 'entity selector' that targets only the machines (HOST) with the tag 'env=training'.
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.
  1. Selector syntax

    Write the query to select these entities.

  2. Full Stack Linux servers

    List all Linux servers with 'Full stack' monitoring.

  3. 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.

  1. 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.

  2. 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.

  1. 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

  • ⏱ Estimated time : ≈ 49 min

Sign in to track your progress and take notes. Sign in

💬 Ask a question

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

RUM et Synthetic Monitoring avec Datadog : synthetic transaction monitoring et expérience utilisateur

Mesurer l'expérience utilisateur avec Datadog : RUM navigateur et mobile, Core Web Vitals, Sessio...

Dynatrace : gérer les permissions (IAM, groupes, politiques et périmètres)

Gérer les accès dans Dynatrace : modèle IAM (utilisateurs, groupes, politiques, périmètres/bounda...

Métriques Dynatrace : Data Explorer, sélecteurs de métriques, API et tableaux de bord

Exploiter les métriques dans Dynatrace : métriques intégrées et personnalisées, Data Explorer, sy...

Business observability avec Dynatrace : événements métier, KPI et Business Flow

Relier technique et métier dans Dynatrace : événements métier (bizevents) captés par OneAgent, AP...

OneAgent : méthodes de collecte, installation, Kubernetes et santé

Les méthodes de collecte de Dynatrace (OneAgent, OpenTelemetry, Prometheus, API), l'installation ...

Dynatrace OneAgent : tags, props, vars CLI

Pense‑bête des commandes CLI/API pour gérer tags, propriétés, variables d'environnement, versions...

Synthetic Monitoring as Code : Industrialisez la gestion des scénarios synthétiques

Découvrez comment intégrer le Synthetic Monitoring dans vos pipelines CI/CD pour des tests de per...

Dynatrace Operator sur Kubernetes : DynaKube, modes de supervision et dépannage

Superviser Kubernetes avec le Dynatrace Operator : installation Helm, ressource DynaKube, modes c...

OpenTelemetry et Dynatrace : OTLP, collecteur et instrumentation

Intégrer OpenTelemetry à Dynatrace : endpoint OTLP et jetons, Dynatrace OTel Collector, traces, m...

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!