Repository navigation
Track dropped extension telemetry reports - #9783
Rick Winter (RickWinter) merged 9 commits into
Conversation
|
Azure Pipelines: Successfully started running 1 pipeline(s). 20 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Copilot review overview
Review tier: Balanced
Findings: 2
New issues introduced by this change (3)
| Severity | Finding |
|---|---|
cli/azd/internal/grpcserver/telemetry_service.go — This branch cannot observe real unauthenticated RPCs: the server-wide tokenAuthInterceptor… |
|
cli/azd/internal/grpcserver/telemetry_service.go — This records the raw extension ID before the official-source gate, including for… |
|
cli/azd/internal/grpcserver/telemetry_service.go — This count goes into the process-global usage bag. For azd up,… |
What changed in this PR
Adds command-span telemetry for extension usage reports rejected by the host.
Changes:
- Adds bounded drop reasons and counts.
- Tests validation and operational drop paths.
- Documents telemetry contracts, diagnostics, and privacy.
| File | Description |
|---|---|
docs/specs/metrics-audit/telemetry-schema.md |
Defines the new telemetry fields. |
docs/specs/metrics-audit/feature-telemetry-matrix.md |
Updates extension telemetry coverage. |
docs/reference/telemetry-data.md |
Documents public telemetry fields. |
docs/architecture/adr-001-extension-telemetry-events.md |
Records the aggregation design. |
cli/azd/internal/tracing/fields/fields.go |
Declares drop attributes. |
cli/azd/internal/grpcserver/telemetry_service.go |
Records drop reasons and counts. |
cli/azd/internal/grpcserver/telemetry_service_test.go |
Tests drop behavior. |
cli/azd/docs/extensions/extension-telemetry.md |
Adds diagnostic guidance and queries. |
cli/azd/cmd/telemetry_test.go |
Verifies field keys. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Copilot review overview
Review tier: Balanced
Findings: 2
New issues introduced by this change (2)
| Severity | Finding |
|---|---|
docs/reference/telemetry-data.md — The preceding sentence says unofficial and over-budget reports “record nothing,” but this new… |
|
docs/specs/metrics-audit/telemetry-schema.md — The Eligibility and Volume rows immediately above still say these calls are dropped “without… |
Issues resolved since last review (3)
| Severity | Finding |
|---|---|
cli/azd/internal/grpcserver/telemetry_service.go — This count goes into the process-global usage bag. For azd up,… View resolved comment |
|
cli/azd/internal/grpcserver/telemetry_service.go — This records the raw extension ID before the official-source gate, including for… View resolved comment |
|
cli/azd/internal/grpcserver/telemetry_service.go — This branch cannot observe real unauthenticated RPCs: the server-wide tokenAuthInterceptor… View resolved comment |
There was a problem hiding this comment.
Copilot review overview
Review tier: Balanced
Findings: 1
New issues introduced by this change (3)
| Severity | Finding |
|---|---|
cli/azd/internal/cmd/up_graph.go — Filtering only the synthetic azd up spans does not keep these fields command-span-only.… |
|
docs/specs/metrics-audit/telemetry-schema.md — This table now includes drop observability, but the Purpose rule at line 256 still says every… |
|
docs/specs/metrics-audit/feature-telemetry-matrix.md — The matrix says every drop records an extension ID, but the implementation deliberately uses… |
Issues resolved since last review (2)
| Severity | Finding |
|---|---|
docs/specs/metrics-audit/telemetry-schema.md — The Eligibility and Volume rows immediately above still say these calls are dropped “without… View resolved comment |
|
docs/reference/telemetry-data.md — The preceding sentence says unofficial and over-budget reports “record nothing,” but this new… View resolved comment |
hemarina
left a comment
There was a problem hiding this comment.
Thanks for adding bounded observability for dropped extension telemetry. The overall privacy design looks sound. Pre-admission failures use the fixed unattributed identity, extension IDs enter the signal only after official-source admission, and reasons are fixed host-defined enums. Rejected caller-provided event names, keys, values, sources, and unverified IDs are not copied.
The new extension.usage.dropped and extension.usage.dropped.count properties should not create Unclassified entries in the GDPR telemetry catalog. Both are exported AttributeKey definitions classified as SystemMetadata / PerformanceAndHealth, and the count is marked as a measurement. This assumes official extension IDs remain registry-controlled system metadata. The existing extension admission and privacy-review process must also continue to prevent accepted dynamic ext.* attributes from carrying PII or Customer Content.
The unresolved VS RPC accounting issue should be fixed before merging. The drop aggregate is stored in the process-global usage bag, and the pre-existing vsrpc/server.go path copies that bag onto every completed vsrpc.* span. Because the bag persists for the lifetime of azd vs-server and the count is cumulative, a single drop is repeated on later unrelated RPC spans.
Since every span is exported to the requests table—and VS RPC spans have separate operation_Id values—this inflates both documented queries:
- Summing
extension.usage.dropped.countovercounts dropped reports. - Counting distinct
operation_Idvalues overcounts affected invocations.
This contradicts the documentation stating that the fields appear only on the hosting command span. The PR already filters them from synthetic azd up spans to prevent equivalent duplication. Please apply the same exclusion to VS RPC spans, preferably through a shared filter, and add sequential and concurrent RPC regression coverage.
Please also resolve the remaining documentation inconsistencies:
- The schema says extension telemetry is always
FeatureInsight, while these fields are declared asPerformanceAndHealth. - The feature matrix uses
<extension-id>@<reason>, although pre-admission failures use<extension-id-or-unattributed>@<reason>.
The VS RPC issue affects telemetry accuracy rather than GDPR handling. With that duplication fixed and the documentation synchronized, the approach looks sound.
|
Hi @Rick Winter (@RickWinter). Thank you for your interest in helping to improve the Azure Developer CLI experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment. Otherwise, we'll close this out in 7 days. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Documentation inconsistencies and incomplete synthetic-span integration coverage remain.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
cli/azd/internal/cmd/up_graph_telemetry_test.go — This test exercises only the filtering helper, so it would still pass if UpGraphAction.Run… |
Issues resolved since last review (3)
| Severity | Finding |
|---|---|
docs/specs/metrics-audit/feature-telemetry-matrix.md — The matrix says every drop records an extension ID, but the implementation deliberately uses… View resolved comment |
|
docs/specs/metrics-audit/telemetry-schema.md — This table now includes drop observability, but the Purpose rule at line 256 still says every… View resolved comment |
|
cli/azd/internal/cmd/up_graph.go — Filtering only the synthetic azd up spans does not keep these fields command-span-only.… View resolved comment |
Suppressed comments (3)
Previously missed (2) — in code that hasn't changed since the last review.
cli/azd/docs/extensions/extension-telemetry.md:139
- The Bounds section still says a per-event violation “records nothing,” which now contradicts this newly documented command-span drop signal. Change that earlier wording to say no
ext.usagespan is produced while the drop aggregate is recorded.
This issue also appears on line 180 of the same file.
docs/architecture/adr-001-extension-telemetry-events.md:76
- This format omits the fixed
unattributedidentity used for pre-admission failures, even though the detailed decision below documents it. Use the same<extension-id-or-unattributed>@<reason>contract as the schema and public reference.
cli/azd/docs/extensions/extension-telemetry.md:181
- These reasons expose response outcomes that the preceding response tables omit:
lookup_failedreturnsInternal, whilesource_check_failedreturnsAccepted: falsewithout an error (a third non-error outcome despite the text saying there are two). Add both outcomes so extension authors can interpret the API response consistently with this reason list.
| `lookup_failed` | `azd` could not read the installed extension record |
| `source_check_failed` | `azd` could not verify the configured registry source |
hemarina
left a comment
There was a problem hiding this comment.
Thank you for adding this!
5752d91 to
83aa261
Compare
|
Hi @Rick Winter (@RickWinter). Thank you for your interest in helping to improve the Azure Developer CLI experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment. Otherwise, we'll close this out in 7 days. |
Malformed reports return InvalidArgument again for every install source, while the drop summary keeps unadmitted extensions unattributed. Workflow step command spans no longer copy invocation drop totals, and phase span coverage now checks the emitted spans.
3e65910 to
00e68b5
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The telemetry workflow test fails with -count=2 because the cached tracer sends second-run spans to the first recorder, leaving the new recorder empty and failing the cmd.provision assertion.
1 open issue
2 resolved since last review
Review effort: Balanced
There was a problem hiding this comment.
🔵 Needs a closer look
Required privacy sign-off for the new unhashed telemetry fields, including raw official-extension IDs and drop-reason data, is not established by the supplied evidence.
No open issues 🎉
1 resolved since last review
Review effort: Balanced
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|





Summary
Record rejected and dropped extension telemetry reports as a bounded aggregate on the hosting command span. This makes missing extension telemetry diagnosable without recording rejected payload content.
extension.usage.droppedcontains unique<extension-id-or-unattributed>@<reason>values, andextension.usage.dropped.countrecords the total number of dropped reports. The reasons cover validation, installation, source eligibility, authentication, and event budget failures. Extension IDs are included only after the installed record passes the official-source check. Earlier failures useunattributed. Repeated failures increase the count without adding duplicate values.Payload bounds are checked before installation and source eligibility, so malformed reports return
InvalidArgumentfor every install source, including local development. A shared filter keeps the aggregate off syntheticazd upphase spans, workflow step command spans, and VS RPC spans to avoid double counting. Accepted report behavior and the existing event budget remain unchanged. The authentication interceptor counts missing or invalid tokens on stable v1, preview v1beta, and legacy telemetry RPCs.Updates the telemetry reference, schema, feature matrix, extension guide, and architecture decision with the fields, reason values, privacy classification, and query examples. The workflow regression test reuses the process-wide tracer provider and isolates each run's span recorder.
The rebase retains main's configurable cross-build timeout: 90 minutes for Linux ARM64 and 20 minutes for other cross-builds. It also includes the upstream release-artifact fix that installs jsonschema2md using the selected Python interpreter. The earlier PR-specific timeout change is superseded and no longer included in the diff.
The pipeline no longer removes the shared
/tmp/.dotnetruntime IPC directory or a hard-coded NuGet scratch path. It continues to clear NuGet's actual cache and temporary paths withdotnet nuget locals all --clear.Fixes #9527.
Testing
mage preflightpassed before the latest fixes.go test ./cmd/middleware ./internal/cmd ./internal/grpcserver ./internal/vsrpc ./internal/tracing -count=1with Go 1.26.4 after the rebase.go test ./cmd -run 'TestTelemetryFieldConstants|TestNoRawTelemetryAttributes' -count=1andgo test ./extensions/telemetry -count=1with Go 1.26.4 after the rebase.go test ./cmd/middleware -run '^TestTelemetryMiddleware_WorkflowStepsExcludeExtensionDrops$' -count=5andgo test ./cmd/middleware -shuffle=on -count=2with Go 1.26.4 after the rebase.golangci-lint,go fix -diff, and spelling checks passed after the rebase.1a45d6ad. Azure DevOps build 7023071 succeeded, includingInstall jsonschema2md,GenerateReleaseArtifacts, and LinuxCleanup NuGet cache.Telemetry Change Checklist
New Fields
fields/fields.go.docs/specs/metrics-audit/telemetry-schema.md.unattributedidentity, and host-defined reasons.New Events
Privacy
CustomerContentemitted in telemetry.Testing
azd upphase spans and workflow step command spans exclude drop fields.Downstream
Documentation