[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7C1YQ0BWHN8EEGKXFX4QKCN":3,"skill-same:01M7C1YQ0BWHN8EEGKXFX4QKCN":52},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M7C1YQ0BWHN8EEGKXFX4QKCN","dt-obs-tracing",null,"Distributed traces, spans, service dependencies, and request flow analysis. Use when investigating span-level details, failures, performance bottlenecks, or trace correlation. Trigger: \"trace analysis\", \"slow requests\", \"failed spans\", \"service dependencies\", \"distributed trace\", \"span details\", \"HTTP status codes in traces\", \"database query spans\", \"messaging spans\", \"gRPC calls\", \"Lambda cold starts\", \"trace ID lookup\", \"exception analysis\", \"correlate logs and traces\", \"request attributes\". Do NOT use for explaining existing queries, product documentation or configuration questions, service-level RED metrics (use dt-obs-services), log searching (use dt-obs-logs), or problem analysis (use dt-obs-problems).","om-scogo\u002Fskillsh-scraper","om-scogo","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F160466840?v=4","01M79AWB6DFVCQ7RK70CS34B96","Om Achrekar","01M79AWB6ZM9SKR8KDH1WSSM22",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fdynatrace-dynatrace-for-ai\u002Fdt-obs-tracing\u002FSkill.md",[],[],"2026-11-15 14:19:17",false,"---\nname: dt-obs-tracing\ndescription: >-\n  Distributed traces, spans, service dependencies, and request flow analysis. Use when\n  investigating span-level details, failures, performance bottlenecks, or trace correlation.\n  Trigger: \"trace analysis\", \"slow requests\", \"failed spans\", \"service dependencies\",\n  \"distributed trace\", \"span details\", \"HTTP status codes in traces\", \"database query spans\",\n  \"messaging spans\", \"gRPC calls\", \"Lambda cold starts\", \"trace ID lookup\",\n  \"exception analysis\", \"correlate logs and traces\", \"request attributes\".\n  Do NOT use for explaining existing queries, product documentation or configuration questions,\n  service-level RED metrics (use dt-obs-services), log searching (use dt-obs-logs),\n  or problem analysis (use dt-obs-problems).\nlicense: Apache-2.0\n---\n\n# Application Tracing Skill\n\n## Overview\n\nDistributed traces in Dynatrace consist of spans - building blocks representing units of work. With Traces in Grail, every span is accessible via DQL with full-text searchability on all attributes. This skill covers trace fundamentals, common analysis patterns, and span-type specific queries.\n\n---\n\n## Use Cases\n\n### 1. Investigate Slow Requests\n- **Goal:** Find and diagnose requests exceeding a latency threshold\n- **Trigger:** \"slow requests\", \"high latency\", \"p99 response time\", \"find traces over 5 seconds\"\n- **Done:** List of slow traces with duration, endpoint, service, and trace IDs for drilldown\n\n### 2. Analyze Request Failures\n- **Goal:** Identify failed requests, failure reasons, and exception patterns\n- **Trigger:** \"failed spans\", \"HTTP 500 errors\", \"exception analysis\", \"failure rate by service\"\n- **Done:** Failure breakdown by reason (HTTP code, exception, gRPC status) with exemplar traces\n\n### 3. Map Service Dependencies\n- **Goal:** Understand service-to-service communication patterns and external API calls\n- **Trigger:** \"service dependencies\", \"what services does X call\", \"outgoing HTTP calls\"\n- **Done:** Dependency map showing call counts, latency, and error rates between services\n\n---\n\n## Core Concepts\n\n### Understanding Traces and Spans\n\n**Spans** represent logical units of work in distributed traces:\n- HTTP requests, RPC calls, database operations\n- Messaging system interactions\n- Internal function invocations\n- Custom instrumentation points\n\n**Span kinds**:\n- `span.kind: server` - Incoming call to a service\n- `span.kind: client` - Outgoing call from a service\n- `span.kind: consumer` - Incoming message consumption call to a service\n- `span.kind: producer` - Outgoing message production call from a service\n- `span.kind: internal` - Internal operation within a service\n\n**Root spans**: A request root span (`request.is_root_span == true`) represents an incoming call to a service. Use this to analyze end-to-end request performance.\n\n### Key Trace Attributes\n\nEssential attributes for trace analysis:\n\n| Attribute | Description |\n|-----------|-------------|\n| `trace.id` | Unique trace identifier |\n| `span.id` | Unique span identifier |\n| `span.parent_id` | Parent span ID (null for root spans) |\n| `request.is_root_span` | Boolean, true for request entry points |\n| `request.is_failed` | Boolean, true if request failed |\n| `duration` | Span duration in nanoseconds |\n| `span.timing.cpu` | Overall CPU time of the span (stable) |\n| `span.timing.cpu_self` | CPU time excluding child spans (stable) |\n| `dt.smartscape.service` | Service Smartscape node ID |\n| `dt.service.name` | Dynatrace service name derived from service detection rules. It is equal to the Smartscape service node name.  |\n| `endpoint.name` | Endpoint\u002Froute name |\n\n### Service Context\n\nSpans reference services via Smartscape node IDs and the detected service name `dt.service.name` which is also present on every span.\n\n```dql\nfetch spans\n| summarize spans=count(), by: { dt.smartscape.service, dt.service.name }\n```\n\n**Node functions**:\n- `getNodeName(dt.smartscape.service)` - Adds `dt.smartscape.service.name` field with the human-readable service name\n- `getNodeField(dt.smartscape.service, \"attribute_name\")` - Access specific node attributes\n\n**📖 Learn more**: See [Entity Lookups](references\u002Fentity-lookups.md) for advanced entity selectors, infrastructure correlation, and hardware analysis.\n\n### Sampling and Extrapolation\n\nOne span can represent multiple real operations due to:\n- **Aggregation**: Multiple operations in one span (`aggregation.count`)\n- **ATM (Adaptive Traffic Management)**: Head-based sampling by agent\n- **ALR (Adaptive Load Reduction)**: Server-side sampling\n- **Read Sampling**: Query-time sampling via `samplingRatio` parameter\n\n**When to extrapolate**: Always extrapolate when counting actual operations (not just spans). Use the multiplicity factor:\n\n```dql\nfetch spans\n| fieldsAdd sampling.probability = (power(2, 56) - coalesce(sampling.threshold, 0)) * power(2, -56)\n| fieldsAdd sampling.multiplicity = 1 \u002F sampling.probability\n| fieldsAdd multiplicity = coalesce(sampling.multiplicity, 1)\n                         * coalesce(aggregation.count, 1)\n                         * dt.system.sampling_ratio\n| summarize operation_count = sum(multiplicity)\n```\n\n**📖 Learn more**: See [Sampling and Extrapolation](references\u002Fsampling-extrapolation.md) for detailed formulas and examples.\n\n## Common Query Patterns\n\n### Basic Span Access\n\nFetch spans and explore by type:\n\n```dql\nfetch spans | limit 1\n```\n\nExplore spans by function and type:\n\n```dql\nfetch spans\n| summarize count(), by: { span.kind, code.namespace, code.function }\n```\n\n### Request Root Filtering\n\nList request root spans (incoming service calls):\n\n```dql\nfetch spans\n| filter request.is_root_span == true\n| fields trace.id, span.id, start_time, response_time = duration, endpoint.name\n| limit 100\n```\n\n### Service Performance Summary\n\nAnalyze service performance with error rates:\n\n```dql\nfetch spans\n| filter request.is_root_span == true\n| summarize\n    total_requests = count(),\n    failed_requests = countIf(request.is_failed == true),\n    avg_duration = avg(duration),\n    p95_duration = percentile(duration, 95),\n    by: {dt.service.name}\n| fieldsAdd error_rate = (failed_requests * 100.0) \u002F total_requests\n| sort error_rate desc\n```\n\n### Trace ID Lookup\n\nFind all spans in a specific trace:\n\n```dql\nfetch spans\n| filter trace.id == toUid(\"abc123def456\")\n| fields span.name, duration, dt.service.name\n```\n\n## Performance Analysis\n\n### Response Time Percentiles\n\nCalculate percentiles by endpoint:\n\n```dql\nfetch spans\n| filter request.is_root_span == true\n| summarize {\n    requests=count(),\n    avg_duration=avg(duration),\n    p95=percentile(duration, 95),\n    p99=percentile(duration, 99)\n  }, by: { endpoint.name }\n| sort p99 desc\n```\n\n**💡 Best practice**: Use percentiles (p95, p99) over averages for performance insights.\n\n### Slow Trace Detection\n\nFind requests exceeding a threshold:\n\n```dql\nfetch spans, from:now() - 2h\n| filter request.is_root_span == true\n| filter duration > 5s\n| fields trace.id, span.name, dt.service.name, duration\n| sort duration desc\n| limit 50\n```\n\n### Duration Buckets with Exemplars\n\n```dql\nfetch spans, from:now() - 24h\n| filter http.route == \"\u002Fapi\u002Fv1\u002Fstorage\u002FfindByISBN\"\n| summarize {\n    spans=count(),\n    trace=takeAny(record(start_time, trace.id))\n  }, by: { bin(duration, 10ms) }\n| fields `bin(duration, 10ms)`, spans, trace.id=trace[trace.id], start_time=trace[start_time]\n```\n\n### Performance Timeseries\n\nExtract response time as timeseries:\n\n```dql\nfetch spans, from:now() - 24h\n| filter request.is_root_span == true\n| makeTimeseries {\n    requests=count(),\n    avg_duration=avg(duration),\n    p95=percentile(duration, 95),\n    p99=percentile(duration, 99)\n  }, by: { endpoint.name }\n```\n\n**📖 Learn more**: See [Performance Analysis](references\u002Fperformance-analysis.md) for advanced patterns and timeseries techniques.\n\n## Failure Investigation\n\n### Failed Request Summary\n\nSummarize failures by service:\n\n```dql\nfetch spans\n| filter request.is_root_span == true\n| summarize\n    total = count(),\n    failed = countIf(request.is_failed == true),\n  by: { dt.service.name }\n| fieldsAdd failure_rate = (failed * 100.0) \u002F total\n| sort failure_rate desc\n```\n\n### Failure Reason Analysis\n\nBreakdown by failure detection reason:\n\n```dql\nfetch spans\n| filter request.is_failed == true and isNotNull(dt.failure_detection.results)\n| expand dt.failure_detection.results\n| summarize count(), by: { dt.failure_detection.results[reason] }\n```\n\n**Failure reasons**:\n- `http_code` - HTTP response code triggered failure\n- `grpc_code` - gRPC status code triggered failure\n- `exception` - Exception caused failure\n- `span_status` - Span status indicated failure\n- `custom_rule` - Custom failure detection rule matched\n\n### HTTP Code Failures\n\nFind failures by HTTP status code:\n\n```dql\nfetch spans\n| filter request.is_failed == true\n| filter iAny(dt.failure_detection.results[][reason] == \"http_code\")\n| summarize count(), by: { http.response.status_code, endpoint.name }\n| sort `count()` desc\n```\n\n### Recent Failed Requests\n\nList recent failures with details:\n\n```dql\nfetch spans\n| filter request.is_root_span == true and request.is_failed == true\n| fields\n    start_time,\n    trace.id,\n    endpoint.name,\n    http.response.status_code,\n    duration\n| sort start_time desc\n| limit 100\n```\n\n**📖 Learn more**: See [Failure Detection](references\u002Ffailure-detection.md) for exception analysis and custom rule investigation.\n\n## Service Dependencies\n\n### Service-to-Service Analysis\n\nAnalyze service communication patterns:\n\n```dql\nfetch spans, from:now() - 1h\n| filter isNotNull(server.address)\n| fieldsAdd\n    remote_side = server.address\n| summarize\n    call_count = count(),\n    avg_duration = avg(duration),\n    by: {dt.service.name, remote_side}\n| sort call_count desc\n```\n\n### Outgoing HTTP Calls\n\nIdentify external API dependencies:\n\n```dql\nfetch spans\n| filter span.kind == \"client\" and isNotNull(http.request.method)\n| summarize\n    calls = count(),\n    avg_latency = avg(duration),\n    p99_latency = percentile(duration, 99),\n  by: { dt.service.name, server.address, server.port }\n| sort calls desc\n```\n\n## Trace Aggregation\n\n### Complete Trace Analysis\n\nAggregate all spans in a trace to understand full request flow:\n\n```dql\nfetch spans, from:now() - 30m\n| summarize {\n    spans = count(),\n    client_spans = countIf(span.kind == \"client\"),\n\n    \u002F\u002F Endpoints involved in the trace\n    endpoints = toString(arrayRemoveNulls(collectDistinct(endpoint.name))),\n\n    \u002F\u002F Extract the first request root in the trace\n    trace_root = takeMin(record(\n        root_detection_helper = coalesce(\n            if(request.is_root_span, 1),\n            if(isNull(span.parent_id), 2),\n            3),\n        start_time, endpoint.name, duration\n      ))\n}, by: { trace.id }\n\n| fieldsFlatten trace_root\n| fieldsRemove trace_root.root_detection_helper, trace_root\n\n| fields\n    start_time = trace_root.start_time,\n    endpoint = trace_root.endpoint.name,\n    response_time = trace_root.duration,\n    spans,\n    client_spans,\n    endpoints,\n    trace.id\n| sort start_time\n| limit 100\n```\n\n**Root detection strategy**: Use `takeMin(record(...))` with a detection helper to reliably find the root request:\n1. Priority 1: Spans with `request.is_root_span == true`\n2. Priority 2: Spans without parent (root spans)\n3. Priority 3: All other spans\n\n### Multi-Service Traces\n\nFind traces spanning multiple services:\n\n```dql\nfetch spans, from:now() - 1h\n| summarize {\n    services = collectDistinct(dt.service.name),\n    trace_root = takeMin(record(root_detection_helper = coalesce(if(request.is_root_span, 1), 2), endpoint.name))\n}, by: { trace.id }\n| fieldsAdd service_count = arraySize(services)\n| filter service_count > 1\n| fields endpoint = trace_root[endpoint.name], service_count, services = toString(services), trace.id\n| sort service_count desc\n| limit 50\n```\n\n## Request-Level Analysis\n\n### Request Attributes\n\nAccess custom request attributes captured by OneAgent on request root spans:\n\n```dql\nfetch spans\n| filter request.is_root_span == true\n| filter isNotNull(request_attribute.PaidAmount)\n| makeTimeseries sum(request_attribute.PaidAmount)\n```\n\n**Field patterns**: `request_attribute.\u003Cname>`, `captured_attribute.\u003Cname>` (always arrays)\n\n→ [Request Attributes](references\u002Frequest-attributes.md) — full patterns for request attributes, captured attributes, and request ID aggregation\n\n## Span Types\n\n| Span Type | Detection | Key Fields | Reference |\n|-----------|-----------|------------|-----------|\n| HTTP server (incoming) | `span.kind == \"server\" and isNotNull(http.request.method)` | `http.route`, `http.request.method`, `http.response.status_code` | [http-spans.md](references\u002Fhttp-spans.md) |\n| HTTP client (outgoing) | `span.kind == \"client\" and isNotNull(http.request.method)` | `server.address`, `server.port` | [http-spans.md](references\u002Fhttp-spans.md) |\n| Database | `span.kind == \"client\" and isNotNull(db.system)` | `db.system`, `db.namespace`, `db.statement` | [database-spans.md](references\u002Fdatabase-spans.md) |\n| Messaging | `isNotNull(messaging.system)` | `messaging.system`, `messaging.destination.name`, `messaging.operation.type` | [messaging-spans.md](references\u002Fmessaging-spans.md) |\n| RPC \u002F gRPC | `isNotNull(rpc.system)` | `rpc.system`, `rpc.service`, `rpc.method`, `rpc.grpc.status_code` | [rpc-spans.md](references\u002Frpc-spans.md) |\n| Serverless \u002F FaaS | `isNotNull(faas.name) and span.kind == \"server\"` | `faas.name`, `faas.trigger.type`, `cloud.provider` | [serverless-spans.md](references\u002Fserverless-spans.md) |\n\n**⚠️ Database spans**: Can be aggregated (one span = multiple calls). Always use `aggregation.count` extrapolation for accurate operation counts.\n\n**📖 Detailed patterns per span type:** See the reference files above.\n\n## Advanced Topics\n\n### Exception Analysis\n\nExceptions are stored as `span.events` within spans:\n\n```dql\nfetch spans\n| filter iAny(span.events[][span_event.name] == \"exception\")\n| expand span.events\n| fieldsFlatten span.events, fields: { exception.type }\n| summarize {\n    count(),\n    trace=takeAny(record(start_time, trace.id))\n  }, by: { exception.type }\n| fields exception.type, `count()`, trace.id=trace[trace.id], start_time=trace[start_time]\n```\n\n**💡 Tip**: Use `iAny()` to check conditions within span event arrays.\n\n→ [Logs Correlation](references\u002Flogs-correlation.md) — joining logs and traces, filtering traces by log content\n→ [Network Analysis](references\u002Fnetworking-analysis.md) — client IPs, DNS resolution, subnet analysis\n\n## Best Practices\n\n| Area | Rule |\n|------|------|\n| **Filtering** | Apply `request.is_root_span == true` and endpoint filters first |\n| **Sampling** | Use `samplingRatio` (e.g., `100` = read 1%) for performance |\n| **Percentiles** | Use p95\u002Fp99 over averages for performance analysis |\n| **Root spans** | Use `request.is_root_span == true` for end-to-end analysis |\n| **Trace grouping** | Group by `trace.id` for complete trace metrics |\n| **Request grouping** | Group by `request.id` for OneAgent-only request metrics |\n| **Extrapolation** | Always apply multiplicity for accurate operation counts |\n| **Exemplars** | Use `takeAny(record(start_time, trace.id))` to enable UI drilldown |\n\n---\n\n## Troubleshooting\n\n| Problem | Cause | Solution |\n|---------|-------|----------|\n| Duration values seem wrong (too large) | `duration` is in nanoseconds, not milliseconds | Divide by `1000000` or compare with `5s` (DQL duration literal) |\n| Span counts don't match expected request volume | Sampling or aggregation not accounted for | Use multiplicity extrapolation — see Sampling and Extrapolation reference |\n| `getNodeName(dt.smartscape.service)` returns null | Service not yet resolved or OneAgent not monitoring | Verify OneAgent monitors the service; entity resolution may have a short delay |\n| `request.is_root_span` filter returns nothing | Querying OpenTelemetry-only traces without OneAgent | Use `isNull(span.parent_id)` as fallback for root span detection |\n| `trace.id` filter returns no results | Trace ID not converted to UID format | Use `filter trace.id == toUid(\"abc123...\")` for string-based trace IDs |\n| Database span counts are too low | Database spans are aggregated (one span = N calls) | Always use `aggregation.count` extrapolation for database operation counts |\n\n## Related Skills\n\n- **dt-dql-essentials** — Core DQL syntax for querying trace data\n- **dt-app-dashboards** — Embed trace queries in dashboards\n- **dt-migration** — Smartscape entity model and relationship navigation\n\n---\n\n## References\n\nDetailed documentation for specific topics:\n\n- **[Performance Analysis](references\u002Fperformance-analysis.md)** - Advanced timeseries, duration buckets, endpoint ranking\n- **[Failure Detection](references\u002Ffailure-detection.md)** - Failure reasons, exception investigation, custom rules\n- **[Sampling and Extrapolation](references\u002Fsampling-extrapolation.md)** - Multiplicity calculation, database extrapolation\n- **[Request Attributes](references\u002Frequest-attributes.md)** - Request attributes, captured attributes, request ID aggregation\n- **[Entity Lookups](references\u002Fentity-lookups.md)** - Advanced node lookups, infrastructure correlation, hardware analysis\n- **[HTTP Span Analysis](references\u002Fhttp-spans.md)** - Status codes, payload analysis, client IPs\n- **[Database Span Analysis](references\u002Fdatabase-spans.md)** - Extrapolated counts, slow queries, statement analysis\n- **[Messaging Span Analysis](references\u002Fmessaging-spans.md)** - Kafka, RabbitMQ, SQS throughput and latency\n- **[RPC Span Analysis](references\u002Frpc-spans.md)** - gRPC, SOAP, service dependencies\n- **[Serverless Span Analysis](references\u002Fserverless-spans.md)** - Lambda, Azure Functions, cold start analysis\n- **[Logs Correlation](references\u002Flogs-correlation.md)** - Joining logs and traces, correlation patterns\n- **[Network Analysis](references\u002Fnetworking-analysis.md)** - IP addresses, DNS resolution, communication mapping\n","# Application Tracing Skill\n\n## Overview\n\nDistributed traces in Dynatrace consist of spans - building blocks representing units of work. With Traces in Grail, every span is accessible via DQL with full-text searchability on all attributes. This skill covers trace fundamentals, common analysis patterns, and span-type specific queries.\n\n---\n\n## Use Cases\n\n### 1. Investigate Slow Requests\n- **Goal:** Find and diagnose requests exceeding a latency threshold\n- **Trigger:** \"slow requests\", \"high latency\", \"p99 response time\", \"find traces over 5 seconds\"\n- **Done:** List of slow traces with duration, endpoint, service, and trace IDs for drilldown\n\n### 2. Analyze Request Failures\n- **Goal:** Identify failed requests, failure reasons, and exception patterns\n- **Trigger:** \"failed spans\", \"HTTP 500 errors\", \"exception analysis\", \"failure rate by service\"\n- **Done:** Failure breakdown by reason (HTTP code, exception, gRPC status) with exemplar traces\n\n### 3. Map Service Dependencies\n- **Goal:** Understand service-to-service communication patterns and external API calls\n- **Trigger:** \"service dependencies\", \"what services does X call\", \"outgoing HTTP calls\"\n- **Done:** Dependency map showing call counts, latency, and error rates between services\n\n---\n\n## Core Concepts\n\n### Understanding Traces and Spans\n\n**Spans** represent logical units of work in distributed traces:\n- HTTP requests, RPC calls, database operations\n- Messaging system interactions\n- Internal function invocations\n- Custom instrumentation points\n\n**Span kinds**:\n- `span.kind: server` - Incoming call to a service\n- `span.kind: client` - Outgoing call from a service\n- `span.kind: consumer` - Incoming message consumption call to a service\n- `span.kind: producer` - Outgoing message production call from a service\n- `span.kind: internal` - Internal operation within a service\n\n**Root spans**: A request root span (`request.is_root_span == true`) represents an incoming call to a service. Use this to analyze end-to-end request performance.\n\n### Key Trace Attributes\n\nEssential attributes for trace analysis:\n\n| Attribute | Description |\n|-----------|-------------|\n| `trace.id` | Unique trace identifier |\n| `span.id` | Unique span identifier |\n| `span.parent_id` | Parent span ID (null for root spans) |\n| `request.is_root_span` | Boolean, true for request entry points |\n| `request.is_failed` | Boolean, true if request failed |\n| `duration` | Span duration in nanoseconds |\n| `span.timing.cpu` | Overall CPU time of the span (stable) |\n| `span.timing.cpu_self` | CPU time excluding child spans (stable) |\n| `dt.smartscape.service` | Service Smartscape node ID |\n| `dt.service.name` | Dynatrace service name derived from service detection rules. It is equal to the Smartscape service node name.  |\n| `endpoint.name` | Endpoint\u002Froute name |\n\n### Service Context\n\nSpans reference services via Smartscape node IDs and the detected service name `dt.service.name` which is also present on every span.\n\n```dql\nfetch spans\n| summarize spans=count(), by: { dt.smartscape.service, dt.service.name }\n```\n\n**Node functions**:\n- `getNodeName(dt.smartscape.service)` - Adds `dt.smartscape.service.name` field with the human-readable service name\n- `getNodeField(dt.smartscape.service, \"attribute_name\")` - Access specific node attributes\n\n**📖 Learn more**: See [Entity Lookups](references\u002Fentity-lookups.md) for advanced entity selectors, infrastructure correlation, and hardware analysis.\n\n### Sampling and Extrapolation\n\nOne span can represent multiple real operations due to:\n- **Aggregation**: Multiple operations in one span (`aggregation.count`)\n- **ATM (Adaptive Traffic Management)**: Head-based sampling by agent\n- **ALR (Adaptive Load Reduction)**: Server-side sampling\n- **Read Sampling**: Query-time sampling via `samplingRatio` parameter\n\n**When to extrapolate**: Always extrapolate when counting actual operations (not just spans). Use the multiplicity factor:\n\n```dql\nfetch spans\n| fieldsAdd sampling.probability = (power(2, 56) - coalesce(sampling.threshold, 0)) * power(2, -56)\n| fieldsAdd sampling.multiplicity = 1 \u002F sampling.probability\n| fieldsAdd multiplicity = coalesce(sampling.multiplicity, 1)\n                         * coalesce(aggregation.count, 1)\n                         * dt.system.sampling_ratio\n| summarize operation_count = sum(multiplicity)\n```\n\n**📖 Learn more**: See [Sampling and Extrapolation](references\u002Fsampling-extrapolation.md) for detailed formulas and examples.\n\n## Common Query Patterns\n\n### Basic Span Access\n\nFetch spans and explore by type:\n\n```dql\nfetch spans | limit 1\n```\n\nExplore spans by function and type:\n\n```dql\nfetch spans\n| summarize count(), by: { span.kind, code.namespace, code.function }\n```\n\n### Request Root Filtering\n\nList request root spans (incoming service calls):\n\n```dql\nfetch spans\n| filter request.is_root_span == true\n| fields trace.id, span.id, start_time, response_time = duration, endpoint.name\n| limit 100\n```\n\n### Service Performance Summary\n\nAnalyze service performance with error rates:\n\n```dql\nfetch spans\n| filter request.is_root_span == true\n| summarize\n    total_requests = count(),\n    failed_requests = countIf(request.is_failed == true),\n    avg_duration = avg(duration),\n    p95_duration = percentile(duration, 95),\n    by: {dt.service.name}\n| fieldsAdd error_rate = (failed_requests * 100.0) \u002F total_requests\n| sort error_rate desc\n```\n\n### Trace ID Lookup\n\nFind all spans in a specific trace:\n\n```dql\nfetch spans\n| filter trace.id == toUid(\"abc123def456\")\n| fields span.name, duration, dt.service.name\n```\n\n## Performance Analysis\n\n### Response Time Percentiles\n\nCalculate percentiles by endpoint:\n\n```dql\nfetch spans\n| filter request.is_root_span == true\n| summarize {\n    requests=count(),\n    avg_duration=avg(duration),\n    p95=percentile(duration, 95),\n    p99=percentile(duration, 99)\n  }, by: { endpoint.name }\n| sort p99 desc\n```\n\n**💡 Best practice**: Use percentiles (p95, p99) over averages for performance insights.\n\n### Slow Trace Detection\n\nFind requests exceeding a threshold:\n\n```dql\nfetch spans, from:now() - 2h\n| filter request.is_root_span == true\n| filter duration > 5s\n| fields trace.id, span.name, dt.service.name, duration\n| sort duration desc\n| limit 50\n```\n\n### Duration Buckets with Exemplars\n\n```dql\nfetch spans, from:now() - 24h\n| filter http.route == \"\u002Fapi\u002Fv1\u002Fstorage\u002FfindByISBN\"\n| summarize {\n    spans=count(),\n    trace=takeAny(record(start_time, trace.id))\n  }, by: { bin(duration, 10ms) }\n| fields `bin(duration, 10ms)`, spans, trace.id=trace[trace.id], start_time=trace[start_time]\n```\n\n### Performance Timeseries\n\nExtract response time as timeseries:\n\n```dql\nfetch spans, from:now() - 24h\n| filter request.is_root_span == true\n| makeTimeseries {\n    requests=count(),\n    avg_duration=avg(duration),\n    p95=percentile(duration, 95),\n    p99=percentile(duration, 99)\n  }, by: { endpoint.name }\n```\n\n**📖 Learn more**: See [Performance Analysis](references\u002Fperformance-analysis.md) for advanced patterns and timeseries techniques.\n\n## Failure Investigation\n\n### Failed Request Summary\n\nSummarize failures by service:\n\n```dql\nfetch spans\n| filter request.is_root_span == true\n| summarize\n    total = count(),\n    failed = countIf(request.is_failed == true),\n  by: { dt.service.name }\n| fieldsAdd failure_rate = (failed * 100.0) \u002F total\n| sort failure_rate desc\n```\n\n### Failure Reason Analysis\n\nBreakdown by failure detection reason:\n\n```dql\nfetch spans\n| filter request.is_failed == true and isNotNull(dt.failure_detection.results)\n| expand dt.failure_detection.results\n| summarize count(), by: { dt.failure_detection.results[reason] }\n```\n\n**Failure reasons**:\n- `http_code` - HTTP response code triggered failure\n- `grpc_code` - gRPC status code triggered failure\n- `exception` - Exception caused failure\n- `span_status` - Span status indicated failure\n- `custom_rule` - Custom failure detection rule matched\n\n### HTTP Code Failures\n\nFind failures by HTTP status code:\n\n```dql\nfetch spans\n| filter request.is_failed == true\n| filter iAny(dt.failure_detection.results[][reason] == \"http_code\")\n| summarize count(), by: { http.response.status_code, endpoint.name }\n| sort `count()` desc\n```\n\n### Recent Failed Requests\n\nList recent failures with details:\n\n```dql\nfetch spans\n| filter request.is_root_span == true and request.is_failed == true\n| fields\n    start_time,\n    trace.id,\n    endpoint.name,\n    http.response.status_code,\n    duration\n| sort start_time desc\n| limit 100\n```\n\n**📖 Learn more**: See [Failure Detection](references\u002Ffailure-detection.md) for exception analysis and custom rule investigation.\n\n## Service Dependencies\n\n### Service-to-Service Analysis\n\nAnalyze service communication patterns:\n\n```dql\nfetch spans, from:now() - 1h\n| filter isNotNull(server.address)\n| fieldsAdd\n    remote_side = server.address\n| summarize\n    call_count = count(),\n    avg_duration = avg(duration),\n    by: {dt.service.name, remote_side}\n| sort call_count desc\n```\n\n### Outgoing HTTP Calls\n\nIdentify external API dependencies:\n\n```dql\nfetch spans\n| filter span.kind == \"client\" and isNotNull(http.request.method)\n| summarize\n    calls = count(),\n    avg_latency = avg(duration),\n    p99_latency = percentile(duration, 99),\n  by: { dt.service.name, server.address, server.port }\n| sort calls desc\n```\n\n## Trace Aggregation\n\n### Complete Trace Analysis\n\nAggregate all spans in a trace to understand full request flow:\n\n```dql\nfetch spans, from:now() - 30m\n| summarize {\n    spans = count(),\n    client_spans = countIf(span.kind == \"client\"),\n\n    \u002F\u002F Endpoints involved in the trace\n    endpoints = toString(arrayRemoveNulls(collectDistinct(endpoint.name))),\n\n    \u002F\u002F Extract the first request root in the trace\n    trace_root = takeMin(record(\n        root_detection_helper = coalesce(\n            if(request.is_root_span, 1),\n            if(isNull(span.parent_id), 2),\n            3),\n        start_time, endpoint.name, duration\n      ))\n}, by: { trace.id }\n\n| fieldsFlatten trace_root\n| fieldsRemove trace_root.root_detection_helper, trace_root\n\n| fields\n    start_time = trace_root.start_time,\n    endpoint = trace_root.endpoint.name,\n    response_time = trace_root.duration,\n    spans,\n    client_spans,\n    endpoints,\n    trace.id\n| sort start_time\n| limit 100\n```\n\n**Root detection strategy**: Use `takeMin(record(...))` with a detection helper to reliably find the root request:\n1. Priority 1: Spans with `request.is_root_span == true`\n2. Priority 2: Spans without parent (root spans)\n3. Priority 3: All other spans\n\n### Multi-Service Traces\n\nFind traces spanning multiple services:\n\n```dql\nfetch spans, from:now() - 1h\n| summarize {\n    services = collectDistinct(dt.service.name),\n    trace_root = takeMin(record(root_detection_helper = coalesce(if(request.is_root_span, 1), 2), endpoint.name))\n}, by: { trace.id }\n| fieldsAdd service_count = arraySize(services)\n| filter service_count > 1\n| fields endpoint = trace_root[endpoint.name], service_count, services = toString(services), trace.id\n| sort service_count desc\n| limit 50\n```\n\n## Request-Level Analysis\n\n### Request Attributes\n\nAccess custom request attributes captured by OneAgent on request root spans:\n\n```dql\nfetch spans\n| filter request.is_root_span == true\n| filter isNotNull(request_attribute.PaidAmount)\n| makeTimeseries sum(request_attribute.PaidAmount)\n```\n\n**Field patterns**: `request_attribute.\u003Cname>`, `captured_attribute.\u003Cname>` (always arrays)\n\n→ [Request Attributes](references\u002Frequest-attributes.md) — full patterns for request attributes, captured attributes, and request ID aggregation\n\n## Span Types\n\n| Span Type | Detection | Key Fields | Reference |\n|-----------|-----------|------------|-----------|\n| HTTP server (incoming) | `span.kind == \"server\" and isNotNull(http.request.method)` | `http.route`, `http.request.method`, `http.response.status_code` | [http-spans.md](references\u002Fhttp-spans.md) |\n| HTTP client (outgoing) | `span.kind == \"client\" and isNotNull(http.request.method)` | `server.address`, `server.port` | [http-spans.md](references\u002Fhttp-spans.md) |\n| Database | `span.kind == \"client\" and isNotNull(db.system)` | `db.system`, `db.namespace`, `db.statement` | [database-spans.md](references\u002Fdatabase-spans.md) |\n| Messaging | `isNotNull(messaging.system)` | `messaging.system`, `messaging.destination.name`, `messaging.operation.type` | [messaging-spans.md](references\u002Fmessaging-spans.md) |\n| RPC \u002F gRPC | `isNotNull(rpc.system)` | `rpc.system`, `rpc.service`, `rpc.method`, `rpc.grpc.status_code` | [rpc-spans.md](references\u002Frpc-spans.md) |\n| Serverless \u002F FaaS | `isNotNull(faas.name) and span.kind == \"server\"` | `faas.name`, `faas.trigger.type`, `cloud.provider` | [serverless-spans.md](references\u002Fserverless-spans.md) |\n\n**⚠️ Database spans**: Can be aggregated (one span = multiple calls). Always use `aggregation.count` extrapolation for accurate operation counts.\n\n**📖 Detailed patterns per span type:** See the reference files above.\n\n## Advanced Topics\n\n### Exception Analysis\n\nExceptions are stored as `span.events` within spans:\n\n```dql\nfetch spans\n| filter iAny(span.events[][span_event.name] == \"exception\")\n| expand span.events\n| fieldsFlatten span.events, fields: { exception.type }\n| summarize {\n    count(),\n    trace=takeAny(record(start_time, trace.id))\n  }, by: { exception.type }\n| fields exception.type, `count()`, trace.id=trace[trace.id], start_time=trace[start_time]\n```\n\n**💡 Tip**: Use `iAny()` to check conditions within span event arrays.\n\n→ [Logs Correlation](references\u002Flogs-correlation.md) — joining logs and traces, filtering traces by log content\n→ [Network Analysis](references\u002Fnetworking-analysis.md) — client IPs, DNS resolution, subnet analysis\n\n## Best Practices\n\n| Area | Rule |\n|------|------|\n| **Filtering** | Apply `request.is_root_span == true` and endpoint filters first |\n| **Sampling** | Use `samplingRatio` (e.g., `100` = read 1%) for performance |\n| **Percentiles** | Use p95\u002Fp99 over averages for performance analysis |\n| **Root spans** | Use `request.is_root_span == true` for end-to-end analysis |\n| **Trace grouping** | Group by `trace.id` for complete trace metrics |\n| **Request grouping** | Group by `request.id` for OneAgent-only request metrics |\n| **Extrapolation** | Always apply multiplicity for accurate operation counts |\n| **Exemplars** | Use `takeAny(record(start_time, trace.id))` to enable UI drilldown |\n\n---\n\n## Troubleshooting\n\n| Problem | Cause | Solution |\n|---------|-------|----------|\n| Duration values seem wrong (too large) | `duration` is in nanoseconds, not milliseconds | Divide by `1000000` or compare with `5s` (DQL duration literal) |\n| Span counts don't match expected request volume | Sampling or aggregation not accounted for | Use multiplicity extrapolation — see Sampling and Extrapolation reference |\n| `getNodeName(dt.smartscape.service)` returns null | Service not yet resolved or OneAgent not monitoring | Verify OneAgent monitors the service; entity resolution may have a short delay |\n| `request.is_root_span` filter returns nothing | Querying OpenTelemetry-only traces without OneAgent | Use `isNull(span.parent_id)` as fallback for root span detection |\n| `trace.id` filter returns no results | Trace ID not converted to UID format | Use `filter trace.id == toUid(\"abc123...\")` for string-based trace IDs |\n| Database span counts are too low | Database spans are aggregated (one span = N calls) | Always use `aggregation.count` extrapolation for database operation counts |\n\n## Related Skills\n\n- **dt-dql-essentials** — Core DQL syntax for querying trace data\n- **dt-app-dashboards** — Embed trace queries in dashboards\n- **dt-migration** — Smartscape entity model and relationship navigation\n\n---\n\n## References\n\nDetailed documentation for specific topics:\n\n- **[Performance Analysis](references\u002Fperformance-analysis.md)** - Advanced timeseries, duration buckets, endpoint ranking\n- **[Failure Detection](references\u002Ffailure-detection.md)** - Failure reasons, exception investigation, custom rules\n- **[Sampling and Extrapolation](references\u002Fsampling-extrapolation.md)** - Multiplicity calculation, database extrapolation\n- **[Request Attributes](references\u002Frequest-attributes.md)** - Request attributes, captured attributes, request ID aggregation\n- **[Entity Lookups](references\u002Fentity-lookups.md)** - Advanced node lookups, infrastructure correlation, hardware analysis\n- **[HTTP Span Analysis](references\u002Fhttp-spans.md)** - Status codes, payload analysis, client IPs\n- **[Database Span Analysis](references\u002Fdatabase-spans.md)** - Extrapolated counts, slow queries, statement analysis\n- **[Messaging Span Analysis](references\u002Fmessaging-spans.md)** - Kafka, RabbitMQ, SQS throughput and latency\n- **[RPC Span Analysis](references\u002Frpc-spans.md)** - gRPC, SOAP, service dependencies\n- **[Serverless Span Analysis](references\u002Fserverless-spans.md)** - Lambda, Azure Functions, cold start analysis\n- **[Logs Correlation](references\u002Flogs-correlation.md)** - Joining logs and traces, correlation patterns\n- **[Network Analysis](references\u002Fnetworking-analysis.md)** - IP addresses, DNS resolution, communication mapping\n",{"name":5,"license":15,"description":7},"main","8859218955d9504cd18b59e7892100718039d3b4","data\u002Fskills\u002Fdynatrace-dynatrace-for-ai\u002Fdt-obs-tracing",1,"https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper","https:\u002F\u002Fgithub.com\u002Fom-scogo","SDE-1 @ Scogo ","2026-07-18 12:22:46",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add om-scogo\u002Fskillsh-scraper --skill dt-obs-tracing",{"tool":38,"command":39},"bunx","bunx skills add om-scogo\u002Fskillsh-scraper --skill dt-obs-tracing",{"tool":41,"command":42},"pnpm","pnpm dlx skills add om-scogo\u002Fskillsh-scraper --skill dt-obs-tracing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fdynatrace-dynatrace-for-ai\u002Fdt-obs-tracing\u002FSkill.md",true,[46],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"metadata.json","REFERENCE","参考文档",471,"https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fdynatrace-dynatrace-for-ai\u002Fdt-obs-tracing\u002Fmetadata.json",[53,61,66,73,78,85],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":57,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M7D6MC9FAAEV4CMNYX8W7JTG","arxiv-search","Search arXiv physics, math, and computer science preprints using natural language queries. Powered by Valyu semantic search.","MIT","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fyorkeccak-scientific-skills\u002Farxiv-search\u002Fskills\u002Farxiv-search\u002FSKILL.md",[],[],{"skillNo":62,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":57,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M7D6M85CKKN87TA98VCQV4H7","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fyorkeccak-scientific-skills\u002Farxiv-search\u002FSkill.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":57,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M7D4ZTCS4DR3CE4JY06X84T2","working-with-legacy-code","Safely change and test untested codebases using Feathers' \"Working Effectively with Legacy Code\". Use when the user mentions \"legacy code\", \"no tests\", \"untested codebase\", \"how do I test this\", \"seams\", \"characterization tests\", \"golden master\", \"sprout method\", \"afraid to change this code\", \"monster method\", \"dependency breaking\", or \"inherited a messy codebase\". Also trigger when changing code without tests safely, getting a class under test when constructors, statics, or singletons block it, adding features to tangled modules, or planning incremental test coverage for an old codebase. Covers the legacy-code change algorithm, seams, characterization tests, sprout\u002Fwrap, and dependency-breaking techniques. For refactoring code that already has tests, see refactoring-patterns. For day-to-day code quality, see clean-code.","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fworking-with-legacy-code\u002Fworking-with-legacy-code\u002FSKILL.md",[],[],{"skillNo":74,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":57,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M7D4ZHZKJD2RSNGAF63V14P4","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fworking-with-legacy-code\u002FSkill.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":57,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M7D4ZB4CJBFW5JE67CPH2QRV","web-typography","Select, pair, and implement typefaces for web projects. Use when the user mentions \"font pairing\", \"which typeface\", \"line height\", \"responsive typography\", \"web font loading\", \"type hierarchy\", \"variable fonts\", \"FOUT\u002FFOIT\", \"typographic scale\", or \"the text is hard to read\". Also trigger when choosing between system fonts and web fonts, optimizing font-loading performance, or designing readable long-form content. Covers readability evaluation, CSS implementation, and performance optimization. For overall UI design systems, see refactoring-ui. For dramatic typographic experiences, see top-design.","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fweb-typography\u002Fweb-typography\u002FSKILL.md",[],[],{"skillNo":86,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":57,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7D4Z4MVYVY3NMJ18BNV6WNA","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fweb-typography\u002FSkill.md",[],[]]