Datadog APM & Distributed Tracing Fundamentals study materials
Datadog APM & Distributed Tracing Fundamentals study resources

Datadog APM & Distributed Tracing Fundamentals practice questions

One question at a time. Build your Datadog APM & Distributed Tracing Fundamentals understanding.

First 50 of 200 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.

Continue in the practice tool above to load more questions, 50 at a time.

Question 1APM fundamentals

In Datadog APM, what is the primary purpose of the service field on a span?

  1. It determines the sampling priority applied at the Agent.
  2. It records the HTTP status code returned by the downstream dependency.
  3. It stores the deployment version string used by the version tag.
  4. It identifies the logical application or component that emitted the span, grouping traces by service in APM views. Correct answer.

Explanation

The service field names the logical application or component responsible for producing the span, and Datadog uses it to aggregate traces, compute service-level metrics, and populate the Service Catalog. It is independent of resource, status code, or sampling decisions.

Question 2APM fundamentals

Which span attribute represents the specific action or operation being measured, such as an endpoint route or SQL statement?

  1. resource Correct answer.
  2. env
  3. service
  4. span.type

Explanation

The resource attribute describes the particular action or operation a span represents, for example an HTTP route, a database query, or a queue operation. Datadog uses resource to break down traces within a service.

Question 3APM fundamentals

What does the trace_id field accomplish in a distributed trace?

  1. It identifies the parent span within a single service.
  2. It links all spans that belong to the same end-to-end request across services. Correct answer.
  3. It carries the sampling priority of the trace.
  4. It records the elapsed duration of an individual span.

Explanation

A trace_id is propagated across service boundaries so that every span generated for one request shares the same identifier and can be assembled into a single trace. The parent_id, by contrast, identifies the immediate caller span.

Question 4APM fundamentals

Which Datadog component receives traces from instrumented applications and forwards them to the Datadog backend?

  1. The Continuous Profiler
  2. The Datadog Agent Correct answer.
  3. The Service Catalog
  4. The Datadog tracer library

Explanation

Instrumented applications send traces to the Datadog Agent, which buffers and forwards them to the Datadog backend. The tracer library generates spans inside the process but does not transmit them directly to the backend by default.

Question 5APM fundamentals

What is the default behavior of head-based sampling in Datadog APM?

  1. Sampling is applied independently per span without regard to the trace.
  2. The sampling decision is deferred until the full trace is assembled at the backend.
  3. The sampling decision is made at the start of the trace, typically by the first instrumented service. Correct answer.
  4. Sampling is disabled unless the user configures a retention filter.

Explanation

Head-based sampling decides whether to keep a trace when it begins, and that decision is propagated via the sampling priority so downstream services honor it consistently. Tail-based retention filters, by contrast, operate on already-ingested traces at the backend.

Question 6APM fundamentals

A developer wants to see how much time a request spent in a downstream database call versus the application code. Which Datadog APM feature directly supports this?

  1. The deployment tracking overlay on dashboards
  2. The flame graph in the trace view, which shows span durations nested by hierarchy Correct answer.
  3. The log pipeline processor configuration
  4. The Service Map, which shows only request rates between services

Explanation

The flame graph visualizes each span's duration and nesting within a trace, making it possible to attribute latency to specific operations such as database calls or application code. The Service Map shows topology and request flow rather than per-span timing detail.

Question 7APM fundamentals

Which tag is used by Datadog to distinguish traces from different deployment environments such as production and staging?

  1. service
  2. operation_name
  3. version
  4. env Correct answer.

Explanation

The env tag identifies the deployment environment and is a reserved tag used across Datadog products to scope data. Version is a separate reserved tag used to track code deployments.

Question 8APM fundamentals

What does the span type 'web' indicate in Datadog APM?

  1. The span represents a request served by a web framework, such as an inbound HTTP request. Correct answer.
  2. The span represents a background job processed from a queue.
  3. The span represents a custom business-logic operation.
  4. The span represents an outbound call to an external HTTP API.

Explanation

The web span type marks spans that represent requests handled by a web server or framework, typically inbound HTTP traffic. Outbound HTTP calls are usually typed as http, and custom operations are typed as custom.

Question 9APM fundamentals

Which mechanism propagates trace context between two services that communicate over HTTP?

  1. The sampling priority stored in the span's resource field
  2. The Agent's local socket connection between hosts
  3. Injected HTTP headers such as x-datadog-trace-id and x-datadog-parent-id Correct answer.
  4. A shared database table written by the tracer

Explanation

Trace context travels across process boundaries through injected headers, for example the x-datadog-trace-id, x-datadog-parent-id, and x-datadog-sampling-priority headers. The receiving service extracts these headers to continue the same trace.

Question 10APM fundamentals

A team wants to reduce ingestion cost while still keeping all error traces. Which Datadog approach best fits this requirement?

  1. Disable tracing on all services except the frontend
  2. Lower the head-based sampling rate and add a retention filter that keeps traces containing errors Correct answer.
  3. Remove the env tag so traces are not billed
  4. Increase the Agent buffer size so more traces are queued

Explanation

Reducing head-based sampling lowers the volume of traces sent, while a retention filter configured to retain error traces ensures those are kept at the backend. Combining both controls cost without losing error visibility.

Question 11APM fundamentals

What distinguishes a root span from a child span in a trace?

  1. The root span is always generated by the Agent rather than the tracer.
  2. The root span carries no trace_id.
  3. The root span always has the longest duration in the trace.
  4. The root span has no parent span and represents the entry point of the trace. Correct answer.

Explanation

A root span is the first span in a trace and has no parent, marking the entry point of the request. Child spans reference a parent span and share the same trace_id.

Question 12APM fundamentals

An engineer sees a service in the Service Map with no inbound edges despite receiving traffic. Which cause is most consistent with Datadog APM behavior?

  1. The trace retention filter is set to keep error traces
  2. The upstream service is not propagating trace context headers, so calls appear as separate traces Correct answer.
  3. The service has too many custom spans defined
  4. The service's env tag differs from the upstream service's env tag

Explanation

The Service Map builds edges from parent-child span relationships across services, which depend on context propagation. If upstream callers do not inject and downstream services do not extract trace headers, the calls cannot be linked into shared traces.

Question 13APM fundamentals

Which statement correctly describes the relationship between the operation_name and resource attributes?

  1. operation_name is set by the Agent, while resource is set by the backend
  2. operation_name is a low-cardinality identifier for the kind of work, while resource is a higher-cardinality description of the specific instance Correct answer.
  3. operation_name identifies the service, while resource identifies the environment
  4. operation_name and resource are aliases and always hold identical values

Explanation

operation_name groups spans by the kind of operation (for example http.request), while resource captures the specific instance such as the exact route or query. This distinction keeps operation_name low-cardinality for aggregation.

Question 14APM fundamentals

A trace shows a parent span for an HTTP request and a child span for a database query. What does the parent_id of the database span reference?

  1. The sampling priority of the trace
  2. The service name of the database
  3. The trace_id of the entire trace
  4. The span_id of the HTTP request span Correct answer.

Explanation

The parent_id of a child span points to the span_id of its immediate parent, establishing the hierarchy within the trace. The trace_id is shared by all spans and does not encode the parent relationship.

Question 15APM fundamentals

Which Datadog feature allows searching and filtering individual spans across retained traces by tag values?

  1. Trace Search and Analytics Correct answer.
  2. Synthetic Monitoring
  3. The Continuous Profiler
  4. The Log Explorer

Explanation

Trace Search and Analytics lets users query retained spans by tags and attributes and build analytics on span-level data. It operates on indexed spans rather than raw profiles or logs.

Question 16APM fundamentals

What is the effect of setting the DD_TRACE_SAMPLE_RATE environment variable on a tracer?

  1. It controls how many traces the Agent discards on overflow
  2. It sets the proportion of traces the tracer marks for keeping at the head of the trace Correct answer.
  3. It sets the percentage of spans within each trace that are recorded
  4. It configures the backend retention filter percentage

Explanation

DD_TRACE_SAMPLE_RATE controls head-based sampling, determining the fraction of new traces the tracer marks to keep. The decision is propagated downstream so all services in a trace honor it.

Question 17APM fundamentals

Why does Datadog recommend keeping operation_name low-cardinality?

  1. High-cardinality operation names disable the flame graph view
  2. High-cardinality operation names prevent the Agent from forwarding traces
  3. High-cardinality operation names cause context propagation to fail between services
  4. High-cardinality operation names fragment aggregation and make service-level metrics and overviews harder to interpret Correct answer.

Explanation

operation_name is used for aggregation in service overviews and analytics, so unbounded values fragment metrics and reduce their usefulness. Specific details belong in resource or tags instead.

Question 18APM fundamentals

A service's p99 latency in APM increased after a deploy, but the flame graph shows no change in span structure. Which explanation is most plausible?

  1. The service's trace_id format changed after the deploy
  2. The env tag was renamed during the deploy
  3. A downstream dependency's span duration increased, inflating the parent request time Correct answer.
  4. The sampling rate was reduced, changing which traces are recorded

Explanation

If span structure is unchanged but latency rose, the added time likely comes from an existing child span such as a downstream call taking longer. The flame graph would show the longer child duration nested under the parent.

Question 19APM fundamentals

Which reserved tag is used to correlate APM traces with a specific code deployment so regressions can be attributed to a release?

  1. host
  2. service
  3. env
  4. version Correct answer.

Explanation

The version reserved tag records the code revision deployed and is used to correlate traces with deployments. Datadog can then surface latency or error changes associated with a specific version.

Question 20APM fundamentals

In a microservices architecture, Service A calls Service B, which calls Service C. All three are instrumented and propagating context. How many services and how many spans would typically appear for one request?

  1. One service and one span because only the entry point is recorded
  2. Three services and three separate traces with no linkage
  3. Three services and at least three spans forming one trace Correct answer.
  4. Two services and two spans because the middle service is merged

Explanation

Each instrumented service appears as its own service, and each generates at least one span. Because context is propagated, the spans share a trace_id and form a single trace with a hierarchy.

Question 21APM fundamentals

What is the role of the sampling priority value in a distributed trace?

  1. It determines which retention filter is applied at the backend
  2. It ranks spans by duration for the flame graph
  3. It sets the trace's billing tier
  4. It communicates the head-based keep or drop decision so downstream services sample consistently Correct answer.

Explanation

The sampling priority is propagated in context headers and tells downstream services whether the trace was kept at the head. This consistency prevents partial traces where some services sample and others do not.

Question 22APM fundamentals

An engineer wants to add business-specific context, such as a customer tier, to traces so it can be filtered in Trace Search. What is the appropriate approach?

  1. Set a custom span tag such as customer_tier on the relevant spans Correct answer.
  2. Rename the service field to include the customer tier
  3. Encode the tier into the trace_id
  4. Change the span type to custom for every span

Explanation

Custom tags add arbitrary key-value context to spans and become searchable facets in Trace Search and Analytics. Encoding information into reserved fields like service or trace_id breaks their intended semantics.

Question 23APM fundamentals

A team observes that only some traces are complete while others contain spans from a subset of services. Which condition most directly explains partial traces?

  1. The use of the web span type on inbound requests
  2. Excessive custom tags on the entry span
  3. Inconsistent sampling decisions caused by missing or ignored sampling priority propagation Correct answer.
  4. A retention filter that keeps error traces

Explanation

Partial traces typically occur when the sampling decision is not propagated consistently, so some services keep the trace while others drop it. Ensuring the sampling priority header is injected and extracted keeps the decision uniform across services.

Question 24APM fundamentals

How do retention filters differ from head-based sampling in Datadog APM?

  1. Retention filters select which already-ingested traces to index for 15-minute retention, while head-based sampling decides which traces are sent at all Correct answer.
  2. Retention filters are configured in the tracer, while head-based sampling is configured in the Datadog UI
  3. Retention filters decide which traces are sent, while head-based sampling indexes spans at the backend
  4. Retention filters apply per span, while head-based sampling applies per service

Explanation

Head-based sampling at the tracer reduces the volume of traces transmitted to Datadog, whereas retention filters operate on the ingested stream to decide which traces are indexed and retained for search. They act at different stages of the pipeline.

Question 25APM fundamentals

Which scenario best justifies using distributed tracing rather than only host-level metrics?

  1. Detecting that a host's CPU usage crossed a threshold
  2. Tracking the total number of requests received by a load balancer
  3. Diagnosing which specific downstream call adds latency to a request that spans multiple services Correct answer.
  4. Alerting when disk space on a node is low

Explanation

Distributed tracing captures per-request span hierarchies across services, allowing engineers to pinpoint which downstream call contributes latency. Host metrics show resource utilization but cannot attribute time to specific inter-service calls.

Question 26APM fundamentals

In Datadog APM, which term describes a single timed unit of work within a trace, such as one HTTP handler call or one database query?

  1. A log event
  2. A dashboard widget
  3. A span Correct answer.
  4. A metric series

Explanation

A trace is composed of spans, and each span records one timed operation with a service, resource, and duration. Metrics, logs, and dashboards are separate Datadog data types that do not model the parent-child timing structure of a request.

Question 27APM fundamentals

Which statement best describes what a Datadog trace represents?

  1. A snapshot of host CPU and memory usage collected by the Agent
  2. A collection of log lines grouped by their service attribute
  3. The complete path of a request through one or more services, made of linked spans Correct answer.
  4. A single aggregated latency percentile for one service over a time window

Explanation

A trace is the end-to-end record of a request, composed of spans that are linked by parent-child relationships across services. Percentiles, host metrics, and log groupings are separate observability constructs that do not preserve the causal path of a request.

Question 28APM fundamentals

What does the span duration in Datadog APM measure?

  1. The retention period configured for the trace in Datadog
  2. The total lifetime of the trace from the first root span to the last child span
  3. The elapsed time between the start and end of that individual span's operation Correct answer.
  4. The time between two consecutive deploys of the instrumented service

Explanation

Duration is recorded per span and reflects only the time spent inside that specific operation, which is why child durations can be summed to attribute time within a trace. Trace lifetime, deploy intervals, and retention settings are unrelated to a single span's measured duration.

Question 29APM fundamentals

Which Datadog APM view is designed to show the breakdown of time spent across spans within a single trace, including nested child spans?

  1. The flame graph in the trace view Correct answer.
  2. The Service Map topology view
  3. The host map view
  4. The monitor status page

Explanation

The flame graph visualizes each span as a horizontal bar whose width reflects duration, making nested child spans and time attribution visible for one trace. The Service Map shows service dependencies, the host map shows infrastructure, and monitor status pages show alert state.

Question 30APM fundamentals

A developer wants to record a custom unit of work, such as a call to an internal pricing engine, as part of an existing trace. Which Datadog tracer API accomplishes this?

  1. Emit a custom metric with the pricing latency value
  2. Create a new dashboard for the pricing service
  3. Write a log line containing the pricing latency
  4. Start a new span with the active span as its parent Correct answer.

Explanation

Creating a span parented to the active span attaches the pricing work to the current trace so its timing appears in the flame graph. Metrics and logs can record latency but do not insert a nested timed span into the trace structure.

Question 31APM fundamentals

Which attribute identifies the specific operation being measured, such as 'http.request' or 'sql.query', in a Datadog span?

  1. The span service
  2. The span resource
  3. The span type Correct answer.
  4. The span duration

Explanation

The span type classifies the kind of work being performed, for example web, db, or cache, and drives how Datadog aggregates and displays the span. Resource names the specific instance of that work, service names the emitting application, and duration is a measurement rather than a classifier.

Question 32APM fundamentals

A trace contains a root span for an inbound HTTP request and a child span for a cache lookup. Which attribute on the cache span points to the HTTP span?

  1. trace_id
  2. resource
  3. service
  4. parent_id Correct answer.

Explanation

The parent_id of a span references the span_id of its immediate parent, which establishes the nesting shown in the flame graph. trace_id is shared by all spans in the trace but does not identify the direct parent, while service and resource are descriptive attributes.

Question 33APM fundamentals

Which Datadog tag is used to attribute a trace to the specific version of a service that handled it?

  1. version Correct answer.
  2. host
  3. service
  4. env

Explanation

The version tag records which build or release of a service produced a span, enabling comparison of behavior across deployments. The env tag separates environments, service names the application, and host identifies the machine.

Question 34APM fundamentals

An engineer needs to search retained traces for all requests where a custom tag 'customer_tier' equals 'gold'. Which Datadog capability supports this directly?

  1. Trace Search with a tag-based query in the APM traces view Correct answer.
  2. The host map filtered by availability zone
  3. The log pipeline configured with a grok parser
  4. The monitor status page filtered by alert type

Explanation

Trace Search allows querying retained traces by tag values, so a custom tag such as customer_tier can be used as a filter. Host maps, monitor status pages, and log parsers operate on infrastructure, alerts, and logs rather than trace tags.

Question 35APM fundamentals

What is the primary purpose of the service attribute on a Datadog span?

  1. It stores the numeric latency of the operation
  2. It records the deployment environment of the emitting host
  3. It identifies the exact endpoint or SQL statement being executed
  4. It groups spans under the application or component that emitted them Correct answer.

Explanation

The service attribute names the application or component that produced the span, which is how Datadog aggregates traces into services and builds the Service Map. Environment, endpoint detail, and latency are captured by other attributes.

Question 36APM fundamentals

A team wants to instrument a background job that is not triggered by an inbound request. Which approach correctly creates a new trace for that job in Datadog APM?

  1. Attach the job to the most recent inbound web span
  2. Disable tracing for the job and rely on logs only
  3. Start a root span for the job so it becomes the first span of a new trace Correct answer.
  4. Set the span type to web so it is treated as a request

Explanation

A job with no upstream parent needs its own root span, which begins a new trace and allows the job's child spans to nest beneath it. Reusing an unrelated web span would corrupt the trace structure, and disabling tracing or mislabeling the span type would not produce a valid new trace.

Question 37APM fundamentals

An engineer observes that a trace's total duration is much longer than the sum of its child span durations. Which explanation is most consistent with this observation?

  1. The trace_id was regenerated for each child span
  2. Time was spent in the parent span outside of any instrumented child operation Correct answer.
  3. The spans were emitted by different Datadog Agents
  4. The child spans were sampled at a different rate than the parent span

Explanation

Span durations measure only instrumented operations, so uninstrumented work in the parent, such as local computation or an untraced call, appears as a gap between parent and child totals. Sampling, trace_id generation, and Agent placement do not explain unaccounted elapsed time within a single trace.

Question 38APM fundamentals

Which statement correctly describes how the Datadog Agent participates in APM tracing?

  1. It receives spans from tracers and forwards them to the Datadog backend Correct answer.
  2. It stores all traces indefinitely on the local host
  3. It generates spans on behalf of services that lack instrumentation
  4. It assigns trace_id values to spans before they are created

Explanation

Tracers send spans to the local Agent, which buffers and forwards them to Datadog's backend for processing and retention. The Agent does not author spans, assign trace identifiers, or keep traces indefinitely on the host.

Question 39APM fundamentals

A service emits spans with a very high-cardinality resource value, such as a full URL including user IDs. What is the most likely consequence in Datadog APM?

  1. The trace_id is regenerated for each unique resource value
  2. Resource-level aggregation becomes fragmented and less useful for analysis Correct answer.
  3. The spans are automatically dropped before reaching the backend
  4. The service is removed from the Service Map

Explanation

Datadog aggregates span data by resource, so unique values per request scatter statistics across many buckets and make latency trends hard to read. High cardinality does not cause automatic dropping, trace_id regeneration, or removal from the Service Map.

Question 40APM fundamentals

An engineer wants to trace a call from a Python service to a Java service and keep both spans in the same trace. Which requirement must be met?

  1. Trace context must be propagated from the caller to the callee across the network boundary Correct answer.
  2. Both services must share an identical service name
  3. The Java service must use the same sampling rate as the Python service
  4. Both services must run on the same host and Agent

Explanation

Distributed traces stay connected only when the caller injects trace context into the outgoing request and the callee extracts it to continue the trace. Co-location, matching sampling rates, and identical service names are not required and would not substitute for context propagation.

Question 41Application instrumentation with Datadog

A developer adds the Datadog tracing library to a Python service and wants every incoming HTTP request to produce a trace. Which configuration is required for the tracer to emit spans?

  1. Set DD_RUNTIME_METRICS_ENABLED to true and configure a DogStatsD port.
  2. Set DD_TRACE_ENABLED to true and provide DD_API_KEY (or an Agent) so spans can be sent. Correct answer.
  3. Set DD_LOGS_INJECTION to false and rely on the default sampler.
  4. Set DD_PROFILING_ENABLED to true and restart the process.

Explanation

The tracer must be enabled and must have a destination: either a local Datadog Agent reachable on its trace port or a direct API key configuration. Without an enabled tracer and a valid destination, spans are created in memory but never ingested. Profiling, log injection, and runtime metrics are separate products that do not control trace submission.

Question 42Application instrumentation with Datadog

Which Datadog term describes the total time a span occupies, including any child spans it waits on?

  1. Span service
  2. Span start offset
  3. Span duration Correct answer.
  4. Span type

Explanation

Duration is the elapsed time recorded for a span, measured from its start to its finish, and therefore includes time spent in child operations. Start offset positions the span on the timeline but is not a length. Service and type are classification attributes rather than timing measurements.

Question 43Application instrumentation with Datadog

A team wants one trace to connect a browser request, an API gateway, and a backend database call. What must be propagated between the services?

  1. The service name and environment tag only.
  2. The sampling priority alone, without identifiers.
  3. The span type and resource name of the root span.
  4. The trace ID and parent span ID, typically via the x-datadog-* headers. Correct answer.

Explanation

Distributed context propagation requires the trace ID plus the parent span ID so each downstream service can attach its spans to the same trace. Datadog transmits these in its own headers (such as x-datadog-trace-id and x-datadog-parent-id) or in W3C traceparent format. Service names, tags, and sampling priority alone cannot reconstruct parent-child relationships.

Question 44Application instrumentation with Datadog

A Java service is instrumented with the Datadog tracing library and a developer wants a custom span around a business method. Which approach follows Datadog conventions?

  1. Wrap the method in a try/catch and log the elapsed time as a metric.
  2. Enable profiling and read the method duration from the flame graph.
  3. Create a new trace by generating a random trace ID for each method call.
  4. Open a span with the tracer's scope manager, set tags on it, and close the scope in a finally block. Correct answer.

Explanation

Custom instrumentation uses the tracer API: activate a span through the scope manager so it becomes the active parent, attach tags describing the operation, and always close the scope so the span is finished and flushed. Logging elapsed time or reading profiler output produces no trace data, and inventing trace IDs breaks trace continuity.

Question 45Application instrumentation with Datadog

Which Datadog tag is reserved to represent the logical operation being performed, such as a route or SQL statement?

  1. env
  2. host
  3. version
  4. resource Correct answer.

Explanation

The resource tag names the specific operation a span represents, for example an HTTP route, a database statement, or a queue operation. It drives the resource list in the trace explorer. Env, version, and host are reserved infrastructure and deployment tags rather than operation names.

Question 46Application instrumentation with Datadog

What is the purpose of the service tag on a span?

  1. It sets the retention period for the underlying log data.
  2. It records the exact hostname of the process that emitted the span.
  3. It groups spans into a logical application component shown as a service in the APM UI. Correct answer.
  4. It determines the sampling rate applied to the trace.

Explanation

Service is the grouping key that defines a service in Datadog APM; spans sharing a service name appear together in the service catalog and service pages. Hostname is captured separately as host, sampling is governed by sampling rules and priority, and retention is a log setting.

Question 47Application instrumentation with Datadog

A Node.js application already uses the Datadog tracer. Which change is needed to see database query spans from a supported PostgreSQL client?

  1. Set DD_TRACE_DEBUG to true so queries are captured as debug logs.
  2. Enable the database integration in tracer configuration so the library is auto-instrumented. Correct answer.
  3. Manually create a span for every query and disable auto-instrumentation.
  4. Add the database host to the service's env tag.

Explanation

Datadog tracing libraries auto-instrument many third-party clients when the integration is enabled in configuration. For supported database drivers this yields query spans with db tags without hand-written code. Debug logging only changes tracer log verbosity, and env tags do not create spans.

Question 48Application instrumentation with Datadog

What does the sampling priority value attached to a trace control?

  1. Which log pipeline processes correlated logs.
  2. How long spans are retained in the trace index.
  3. Whether the trace is kept or dropped by the Agent and backend. Correct answer.
  4. Which service name is displayed as the trace root.

Explanation

Sampling priority is a decision propagated with the trace context that tells downstream components to keep or drop the trace, so all services agree on the outcome. It does not rename services, set retention, or route logs. Consistent propagation prevents partial traces where some services keep and others drop.

Question 49Application instrumentation with Datadog

A service's trace list shows the operation as an auto-generated name like 'tornado.request' rather than the HTTP route. What should the developer do to improve readability?

  1. Change the service name to include the route path.
  2. Increase the sampling rate so more spans are captured.
  3. Set the resource name on the span to the route template, such as GET /users/:id. Correct answer.
  4. Disable auto-instrumentation for the web framework.

Explanation

The resource attribute is what the trace explorer displays as the operation, so setting it to a stable route template groups requests meaningfully. Raising sampling changes volume, not naming. Encoding routes into service names would explode the service catalog, and disabling instrumentation removes the spans entirely.

Question 50Application instrumentation with Datadog

A team wants spans from their Go service to include the deployment version so they can compare latency across releases. Which approach is correct?

  1. Encode the version into the trace ID.
  2. Add version as a child span tag on the root span only.
  3. Set the version tag in tracer configuration or via the DD_VERSION environment variable. Correct answer.
  4. Set the version as the span resource name.

Explanation

Version is a reserved tag that should be applied uniformly through tracer configuration or the DD_VERSION environment variable so every span carries it and the deployment can be tracked. Encoding it into identifiers or resource names breaks grouping and correlation. Tagging only the root span inconsistently limits filtering.