Skip to content

feat(telemetry): update SharpLink detail policy at runtime - #600

Merged
SunSi12138 merged 20 commits into
devfrom
issue-589-runtime-telemetry-detail
Sep 8, 2026
Merged

SunSi12138 merged 20 commits into
devfrom
issue-589-runtime-telemetry-detail

Conversation

@SunSi12138

@SunSi12138 SunSi12138 commented Sep 8, 2026 •

Copy link
Copy Markdown
Owner

Closes #589

Audit boundary

The repository currently has no SharpLink-owned ActivityEvent emission sites, so this PR does not invent a parallel diagnostic event stream. OpenTelemetry sampler/exporter/provider ownership and the stable SharpLink.Client, SharpLink.Server, and SharpLink source/meter identities remain unchanged.

Runtime policy

Adds one immutable SharpLink-owned telemetry detail generation on both Client and Server.

  • Detailed is the default and preserves the historical telemetry surface.
  • Basic retains logical call activities, stable RPC identity tags, core metrics, and bounded resource-exhaustion classification.
  • Basic suppresses existing optional diagnostic/high-cardinality trace detail: Server request identity, Client lifetime-source enrichment, and retry-attempt child activities.
  • Client captures the detail generation once at the logical-call creation boundary in ResolvedCallControl; interceptor suspension, delayed stream enumeration, retry backoff, and later retry attempts therefore cannot mix detail generations within one logical RPC.
  • Server captures the current generation at the call telemetry start boundary.
  • updates are atomic control-path publications and are rejected once drain/stop/fault begins.

Ownership boundary

This API does not implement or replace OpenTelemetry sampling, exporters, processors/providers, resource configuration, or listener lifecycle. It does not replace/rename ActivitySource, Meter, or metric instruments. doc/observability.md documents this boundary explicitly.

Regression coverage

SharpLinkRuntimeTelemetryDetailPolicyTests covers:

  • Detailed -> Basic publication and same-value no-op;
  • invalid candidate rollback and Client Stop sealing;
  • Server Detailed request identity versus Basic omission while stable RPC tags remain;
  • a Client logical call captured as Basic remaining Basic after the live policy changes to Detailed;
  • Basic retry attempts preserving the prior ambient Activity.Current and emitting no attempt child Activity;
  • future Detailed calls emitting retry-attempt activities and restoring ambient context on completion.

Branch head: 94a60fb977b76af1cbef18a3b3021965d0d1dde1.
Validated target: dev@3bccdefd75fbb1f7e04ad6816f615d198004230e.

Validation

  • PR Fast 34192031561: PASS.
  • ready-state PR Fast 34192220272: PASS.
  • CodeQL 34192031623: PASS.
  • PR Extended 34192232906: PASS — Debug/Release builds, Integration Tests, NativeAOT transport/topology smoke, package contract verification/smoke, demo/load smoke, and the complete six-platform desktop codec compatibility matrix.

The first Windows ARM codec producer attempt hit a hosted-runner .NET setup CLR internal error (0x80131506) before project execution. The failed jobs were rerun on the identical PR merge ref; Windows ARM production/verification and the final codec/Extended summaries then passed.

@SunSi12138
SunSi12138 marked this pull request as ready for review September 8, 2026 05:51
@SunSi12138
SunSi12138 merged commit dd7e391 into dev Sep 8, 2026
39 of 43 checks passed
@SunSi12138
SunSi12138 deleted the issue-589-runtime-telemetry-detail branch September 8, 2026 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant