Skip to content

kimtth/azure-distributed-trace-azure-monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Azure Monitor + @distributed_trace

πŸ“¦ Azure Monitor integration with OpenTelemetry via @distributed_trace annotation πŸ”

Configuration

Create a .env file in the project root β€” see .env.sample for reference.

Kusto Queries

1. Retrieve traces from the last hour

traces
| where timestamp > ago(1h)
| where message contains "Sample"
| project timestamp, message, customDimensions
| order by timestamp desc

2. Logs sent by AzureMonitorLogExporter

traces
| where timestamp > ago(1h)
| where message contains "Processing" or message contains "Processed"
| project timestamp, message, severityLevel, customDimensions
| order by timestamp desc

3. Spans sent by AzureMonitorTraceExporter

SpanKind Azure Monitor Table Description
INTERNAL traces Background operations or internal logic
SERVER requests Incoming HTTP or RPC requests
CLIENT dependencies Outgoing calls to external services
PRODUCER dependencies Messages sent to queues/topics
CONSUMER dependencies Messages received from queues/topics

Combined logs and spans

union traces, dependencies, requests, exceptions
| where timestamp > ago(1h)
| where message contains "Processing" or message contains "Processed"
| project timestamp, itemType, message, operation_Name, severityLevel, customDimensions
| order by timestamp desc

Aggregate logs by severity

traces
| where timestamp > ago(1h)
| summarize Count = count() by severityLevel
| order by severityLevel

Aggregate spans by operation name

traces
| where timestamp > ago(1h)
| summarize Count = count() by operation_Name
| order by Count desc

Span extraction (dependencies, requests, traces)

union dependencies, requests, traces
| where timestamp > ago(1h)
| project timestamp, itemType, operation_Name, id, duration, customDimensions
| order by timestamp desc

View INTERNAL span

traces
| where timestamp > ago(1h)
| where message contains "Internal operation span"
| project timestamp, message, customDimensions

View SERVER span

requests
| where timestamp > ago(1h)
| where name == "server_span"
| project timestamp, name, operation_Name, customDimensions

View CLIENT span

dependencies
| where timestamp > ago(1h)
| where name == "client_span"
| project timestamp, name, target, operation_Name

View PRODUCER & CONSUMER spans

dependencies
| where timestamp > ago(1h)
| where name in ("producer_span", "consumer_span")
| project timestamp, name, operation_Name, target

About

πŸ“¦ Azure Monitor integration with OpenTelemetry via "@distributed_trace" annotation πŸ”

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages