Skip to content

Add General properties to Application Name Telemetry - #3826

Open
aaronburtle wants to merge 3 commits into
mainfrom
dev/aaronburtle/define-app-name-general-telemetry
Open

aaronburtle wants to merge 3 commits into
mainfrom
dev/aaronburtle/define-app-name-general-telemetry

Conversation

@aaronburtle

@aaronburtle aaronburtle commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Suggested title: Add general settings to application-name telemetry

Why make this change?

Closes #3792.

The application-name telemetry format reserved a General section but was initially empty. We populate it with the agreed host and data-source characteristics to improve aggregate usage visibility without collecting identifiers or secrets.

What is this change?

Adds six positional fields using the existing shared encoder/decoder design:

Position Field Values
1 Operating system Windows, Linux, macOS, Other, Unknown
2 Running in container No, Yes, Missing
3 Hosting environment Local, Azure, AWS, GCP, Other, Missing
4 Azure hosting service Container Apps, AKS, App Service, ACI, Other, Not Azure, Missing
5 Multiple parsed data sources No, Yes, Missing
6 Managed identity No, Yes, Missing

The format remains:

<marker><version>+<context>|<general>|<runtime>|<entity>+

  • Preserves compatibility: fills the reserved section without shifting Runtime or Entity positions. Older empty-General tokens, truncated tokens, hosted markers, and the existing opt-out remain supported.
  • Uses offline, conservative detection: reads OS APIs and known runtime environment signals. DAB_HOSTING_ENVIRONMENT and DAB_AZURE_HOSTING_SERVICE provide explicit overrides. Detection performs no metadata requests or credential acquisition.
  • Reports MI per data source: inspects the effective connection string, including overrides. The CLI uses the default source. Ambiguous credential chains and mixed OBO/metadata authentication report M; DefaultAzureCredential availability is not treated as proof of MI use.
  • Protects connection behavior: bounds the SQL telemetry suffix to the available application-name budget while preserving the existing custom name and OBO isolation prefix. PostgreSQL normalization remains server-side.
  • Keeps CLI inspection offline: recursively loads configurations using existing property converters without resolving Key Vault secrets or starting runtime watchers. Adds cycle/depth protection.
  • Updates the existing design documentation and adds regression coverage for detection, compatibility, authentication, privacy, and provider-specific boundaries.

How was this tested?

  • Integration Tests
  • Unit Tests

Sample Request(s)

Inspect the telemetry for a configuration:

dab appname --config dab-config.json

Decode an illustrative token:

dab appname --decode "dab_oss_1.2.3+XXSX|L1AC01|MMMM00MMM00MMMMMMMMM|MMM?MMMMMMMMM?+"

The General section, L1AC01, represents Linux, running in a container, Azure Container Apps, one data source, and explicitly configured managed identity.

Populate the reserved general section with OS, container, hosting, data-source count, and per-source managed identity flags. Preserve positional compatibility and conservative detection with explicit hosting overrides.

Bound SQL application names, respect provider credential parsing and OBO ambiguity, and keep recursive CLI inspection offline. Add regression coverage and update the existing telemetry design.

Validated full Debug solution build, 3453 non-database service tests, 348 focused telemetry/OBO tests, 12 CLI appname tests, and changed-file formatting.
Model PostgreSQL UTF-8 clipping, ASCII byte escaping, and final statistics clipping. Assert exact surviving telemetry fields with a fixed version and cover Unicode, control bytes, and multibyte boundaries. Clarify the existing documentation without changing production behavior.

Validated 18 corrected unit cases, 18 matching live PostgreSQL 16.15 fixtures, 3468 non-database service tests, and changed-file formatting.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

The broad telemetry, configuration, authentication, and CLI changes warrant final human review.

Review effort: Lite
Findings: None

What changed in this PR

Adds six host and data-source properties to application-name telemetry while preserving token compatibility and enabling offline CLI inspection.

Changes:

  • Adds environment, hosting, source-count, and managed-identity detection.
  • Preserves SQL application-name limits and connection overrides.
  • Adds recursive offline config loading, regression tests, and documentation.
File Description
src/​Service.Tests/​UnitTests/​ApplicationNameTelemetryTests.cs Updates telemetry compatibility tests.
src/​Service.Tests/​UnitTests/​ApplicationNameGeneralTelemetryTests.cs Adds General telemetry coverage.
src/​Service.Tests/​Configuration/​RuntimeConfigLoaderTests.cs Verifies multi-source telemetry.
src/​Config/​Telemetry/​ApplicationNameTelemetryEnvironment.cs Detects host environment signals.
src/​Config/​Telemetry/​ApplicationNameTelemetry.cs Encodes and decodes General fields.
src/​Config/​RuntimeConfigLoader.cs Handles effective connections and SQL limits.
src/​Config/​Azure.DataApiBuilder.Config.csproj Adds MySQL parsing support.
src/​Cli/​Commands/​AppNameOptions.cs Uses offline configuration loading.
src/​Cli/​AppNameConfigLoader.cs Loads configurations recursively offline.
src/​Cli.Tests/​EndToEndTests.cs Tests offline CLI behavior.
docs/​design/​application-name-telemetry.md Documents the expanded telemetry format.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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

Labels

telemetry feature requests/ bug reports related to telemetry

Projects

Status: Review In Progress

Development

Successfully merging this pull request may close these issues.

Add General section to App-name Telemetry

5 participants