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
💬 Recent discussions about this course
- Dynatrace : mes pods Kubernetes ne sont pas instrumentés malgré le DynaKube✓ solved · 1 reply(ies)
Ask a question about this lesson →See all discussions about this course
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.
Core Web Vitals
Set of three metrics defined by Google to measure the real experience of a web page: loading (LCP (Largest Contentful Paint)), responsiveness (INP (In...
LCP (Largest Contentful Paint)
Time until the largest visible element of the page (image, video or text block) is rendered: it shows when the main content appears. Loading metric of...
INP (Interaction to Next Paint)
Latency of interactions (click, tap, key press) observed over the whole visit: the delay between the user's action and the next paint. The reported va...
CLS (Cumulative Layout Shift)
Measure of visual stability: the sum of unexpected layout shifts (a button moving just as you click, text pushed down by an ad). Unitless, computed ov...
FCP (First Contentful Paint)
Time until the first content (text, image, SVG) is rendered: the moment the user sees the page start loading. It is not a Core Web Vital, but it helps...
TTFB (Time to First Byte)
Time between the start of navigation and the arrival of the first byte of the response: it adds up redirects, DNS, TCP/TLS connection and server proce...
FID (First Input Delay)
Former responsiveness metric of the Core Web Vitals: the delay before the browser starts handling the first interaction (good ≤ 100 ms). It ignored la...
TBT (Total Blocking Time)
Lab metric (Lighthouse): the sum, between FCP (First Contentful Paint) and the end of loading, of the blocking part of each long task (over 50 ms) on ...
CrUX (Chrome UX Report)
Google's public dataset aggregating the Core Web Vitals measured from real Chrome users (at the 75th percentile, per origin and URL, over a rolling 28...
Lighthouse
Google's free audit tool, built into Chrome DevTools and PageSpeed Insights: it loads the page in a simulated environment and scores performance, acce...
Apdex
Application Performance Index: a satisfaction score between 0 and 1 based on a time threshold T. Requests under T are “satisfied”, between T and 4T “t...
Recommended Articles
Dynatrace: mastering entity selectors for observability at scale
Discover the strategic importance of entity selectors, master their advanced syntax, and adopt th...
Dynatrace: management zones, segments and IAM policies
Management zones on the classic platform, segments on the new platform and IAM policies: what eac...
Dynatrace metrics: Data Explorer, metric selectors, API and dashboards
Use metrics in Dynatrace: built-in and custom metrics, Data Explorer, metric selector syntax, Met...
Segments and the new platform: replacing management zones
Understand segments in the new Dynatrace platform: differences from management zones, inclusion r...
oneagentctl and API cheat sheet: OneAgent tags, properties, host group, network and modes
oneagentctl commands and API calls to manage tags, host properties, host group, network zone, pro...
Service types in Dynatrace: web, database, messaging, custom and unified services
What a service is for Dynatrace, the automatically detected service types (web requests, web serv...
ActiveGate and network zones: architecture, routing and high availability
Understand and deploy ActiveGate in Dynatrace: roles (routing, API, cloud integrations, extension...
Dynatrace best practices guide: towards mature observability
Optimize your Dynatrace platform with our expert recommendations: automated tagging, segmentation...
Synthetic monitoring as code: industrializing synthetic scenario management
Learn how to integrate synthetic monitoring into your CI/CD pipelines for automated, resilient pe...