dotnet / dotnet/extensions

Proposal to simplify user-facing interfaces related to latency monitoring

Open
#5,769 2 comments 0 reactions 0 assignees View on GitHub
area-telemetry untriaged
Dominant language
C#
Stars
3.2k
Forks
894
Avg merge
1d 12h
Merged PRs (30d)
23

Description

For the current implementation, a common task for latency monitoring will require 4 user-facing interfaces

1. `ILatencyContext` which holds the context
2. `ILatencyContextProvider` which creates `LatencyContext`
3. `ILatencyContextTokenIssuer` which issues tokens for `checkpoints/tags/measures`.(BTW, There is an error in the document at [README.md#latency-measurement](https://github.com/dotnet/extensions/blob/main/src/Libraries/Microsoft.Extensions.Telemetry.Abstractions/README.md#latency-measurement). It is using `ILatencyContext.GetCheckpointToken/GetMeasureToken`. Both methods are actually defined in `ILatencyContextTokenIssuer`.)
4. `ILatencyDataExporter` which exports latency data.

So the monitored code should always inject 3 interfaces(No.2~4), which is quite wordy. What's more the implementation of `LatencyContextTokenIssuer` and `LatencyContext` create their own `CheckpointTracker/MeasureTracker/TagCollection` which is redundancy.

I would like to propose merge `ILatencyContextTokenIssuer/ILatencyDataExporter` into `ILatencyContext`. `LatencyContext` can hold references to `ILatencyContextTokenIssuer/ILatencyDataExporter`. Then it becomes the only entrance to issue token and export data.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.