Skip to content

Conversation

@MattKotsenas
Copy link
Contributor

Fixes #3575

Changes

Adds an initial implementation of traces and metrics for any client built on top of the Microsoft.Azure.Kusto.Cloud.Platform package (namely Microsoft.Azure.Kusto.Data and Microsoft.Azure.Kusto.Ingest).

The library generally follows the semantic conventions for dbs for both traces and metrics, importantly, it does both query summarization and sanitization. It does not support adding query parameters as tags, as those aren't available in Kusto's internal custom tracing framework. Test coverage includes unit tests, benchmarks both for end-to-end instrumentation and query processing specific, and integration tests using the existing pattern of Testcontainers.

The package is not strong-name signed because it uses Microsoft.Azure.Kusto.Language for query processing, which also is not strong-name signed.

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

@MattKotsenas MattKotsenas requested a review from a team as a code owner December 8, 2025 19:37
@github-actions github-actions bot added infra Infra work - CI/CD, code coverage, linters dependencies Pull requests that update a dependency file perf Performance related labels Dec 8, 2025
@codecov
Copy link

codecov bot commented Dec 8, 2025

Codecov Report

❌ Patch coverage is 91.04478% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.41%. Comparing base (48d18f6) to head (0256577).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...n.Kusto/Implementation/KustoTraceRecordListener.cs 83.78% 18 Missing ⚠️
.../Implementation/KustoInstrumentationEventSource.cs 0.00% 11 Missing ⚠️
...on.Kusto/Implementation/TruncatingStringBuilder.cs 97.36% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3591      +/-   ##
==========================================
+ Coverage   71.22%   71.41%   +0.19%     
==========================================
  Files         442      467      +25     
  Lines       17516    17902     +386     
==========================================
+ Hits        12475    12785     +310     
- Misses       5041     5117      +76     
Flag Coverage Δ
unittests-Contrib.Shared.Tests 86.54% <ø> (ø)
unittests-Exporter.Geneva 53.64% <ø> (-0.14%) ⬇️
unittests-Exporter.InfluxDB 95.14% <ø> (ø)
unittests-Exporter.Instana 74.86% <ø> (ø)
unittests-Exporter.OneCollector 94.62% <ø> (ø)
unittests-Extensions 90.65% <ø> (ø)
unittests-Extensions.Enrichment 100.00% <ø> (ø)
unittests-Extensions.Enrichment.AspNetCore 86.27% <ø> (ø)
unittests-Extensions.Enrichment.Http 94.33% <ø> (ø)
unittests-Instrumentation.AWS 83.80% <ø> (ø)
unittests-Instrumentation.AspNet 78.14% <ø> (ø)
unittests-Instrumentation.AspNetCore 71.69% <ø> (ø)
unittests-Instrumentation.Cassandra 23.52% <ø> (?)
unittests-Instrumentation.ConfluentKafka 14.10% <ø> (ø)
unittests-Instrumentation.ElasticsearchClient 80.12% <ø> (ø)
unittests-Instrumentation.EntityFrameworkCore 80.80% <ø> (ø)
unittests-Instrumentation.EventCounters 77.27% <ø> (ø)
unittests-Instrumentation.GrpcCore 91.42% <ø> (ø)
unittests-Instrumentation.GrpcNetClient 79.61% <ø> (ø)
unittests-Instrumentation.Hangfire 86.05% <ø> (ø)
unittests-Instrumentation.Http 74.22% <ø> (ø)
unittests-Instrumentation.Kusto 91.04% <91.04%> (?)
unittests-Instrumentation.Owin 88.62% <ø> (ø)
unittests-Instrumentation.Process 100.00% <ø> (ø)
unittests-Instrumentation.Quartz 78.76% <ø> (ø)
unittests-Instrumentation.Runtime 100.00% <ø> (ø)
unittests-Instrumentation.ServiceFabricRemoting 34.54% <ø> (ø)
unittests-Instrumentation.SqlClient 87.29% <ø> (ø)
unittests-Instrumentation.StackExchangeRedis 71.80% <ø> (ø)
unittests-Instrumentation.Wcf 79.57% <ø> (ø)
unittests-OpAmp.Client 71.55% <ø> (ø)
unittests-PersistentStorage 76.58% <ø> (ø)
unittests-Resources.AWS 74.42% <ø> (ø)
unittests-Resources.Azure 85.31% <ø> (ø)
unittests-Resources.Container 67.34% <ø> (ø)
unittests-Resources.Gcp 71.42% <ø> (ø)
unittests-Resources.Host 71.85% <ø> (ø)
unittests-Resources.OperatingSystem 76.98% <ø> (ø)
unittests-Resources.Process 100.00% <ø> (ø)
unittests-Resources.ProcessRuntime 79.59% <ø> (ø)
unittests-Sampler.AWS 93.23% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...entation/InstrumentationHandleManagerExtensions.cs 100.00% <100.00%> (ø)
....Kusto/Implementation/KustoActivitySourceHelper.cs 100.00% <100.00%> (ø)
...ation.Kusto/Implementation/KustoInstrumentation.cs 100.00% <100.00%> (ø)
...rumentation.Kusto/Implementation/KustoProcessor.cs 100.00% <100.00%> (ø)
...ntation.Kusto/Implementation/KustoStatementInfo.cs 100.00% <100.00%> (ø)
...rumentation.Kusto/Implementation/SpanExtensions.cs 100.00% <100.00%> (ø)
...tion.Kusto/Implementation/TraceRecordExtensions.cs 100.00% <100.00%> (ø)
...entation.Kusto/Implementation/TraceRecordParser.cs 100.00% <100.00%> (ø)
...entation.Kusto/KustoMeterInstrumentationOptions.cs 100.00% <100.00%> (ø)
...entation.Kusto/KustoTraceInstrumentationOptions.cs 100.00% <100.00%> (ø)
... and 5 more

... and 12 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@MattKotsenas MattKotsenas force-pushed the feature/kusto-instrumentor branch 2 times, most recently from 57b046e to 0aef4ac Compare December 8, 2025 20:30
@MattKotsenas MattKotsenas force-pushed the feature/kusto-instrumentor branch from 0aef4ac to 77819be Compare December 8, 2025 21:28
activity?.DisplayName = operationName;
activity?.AddTag(KustoActivitySourceHelper.ClientRequestIdTagKey, record.Activity.ClientRequestId.ToString());

activity?.AddTag(SemanticConventions.AttributeDbSystemName, KustoActivitySourceHelper.DbSystem);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure about the value here? Kusto seems to be the query language and not what is being called. azure.data_explorer would appear to be more accurate.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's worth raising to the group. I could go either way, but lean a bit towards retaining "Kusto" because it feels less ambiguous to me. The Saas product is called "Azure Data Explorer", but the client library is "Microsoft.Azure.Kusto.Data". The rich client UI is called "Kusto Explorer", but the web product is called "Azure Data Explorer Web UI". The provisioning library is "Azure.Provisioning.Kusto"

It's also worth calling out that you can query sources that are backed by Kusto clusters, but are not themselves the Azure Data Explorer Saas product, like Azure Log Analytics.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also a reminder for myself, if we do change the name, we need to update a few other attributes as well to use the same prefix (namely the client request id).


activity?.AddTag(SemanticConventions.AttributeDbSystemName, KustoActivitySourceHelper.DbSystem);
activity?.AddTag(SemanticConventions.AttributeDbOperationName, operationName);
meterTags.Add(SemanticConventions.AttributeDbSystemName, KustoActivitySourceHelper.DbSystem);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure about the value here? Kusto seems to be the query language and not what is being called. azure.data_explorer would appear to be more accurate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file infra Infra work - CI/CD, code coverage, linters perf Performance related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature request] Instrumentor for Azure Kusto

2 participants