-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Metrics UpDownCounter instrument #63648
Labels
Milestone
Comments
dotnet-issue-labeler
bot
added
the
untriaged
New issue has not been triaged by the area owner
label
Jan 11, 2022
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
tarekgh
added
area-System.Diagnostics.Metric
feature-request
and removed
untriaged
New issue has not been triaged by the area owner
labels
Jan 11, 2022
10 tasks
tarekgh
added
api-needs-work
API needs work before it is approved, it is NOT ready for implementation
and removed
feature-request
labels
Jan 19, 2022
tarekgh
added
api-ready-for-review
API is ready for review, it is NOT ready for implementation
and removed
api-needs-work
API needs work before it is approved, it is NOT ready for implementation
labels
Jan 24, 2022
namespace System.Diagnostics.Metrics
{
public sealed class UpDownCounter<T> : Instrument<T> where T : struct
{
public void Add(T delta);
public void Add(T delta, KeyValuePair<string, object?> tag);
public void Add(T delta, KeyValuePair<string, object?> tag1, KeyValuePair<string, object?> tag2);
public void Add(T delta, KeyValuePair<string, object?> tag1, KeyValuePair<string, object?> tag2, KeyValuePair<string, object?> tag3);
public void Add(T delta, ReadOnlySpan<KeyValuePair<string, object?>> tags);
public void Add(T delta, params KeyValuePair<string, object?>[] tags);
public void Add(T delta, in TagList tagList);
}
public sealed class ObservableUpDownCounter<T> : ObservableInstrument<T> where T : struct
{
protected override IEnumerable<Measurement<T>> Observe();
}
public partial class Meter : IDisposable
{
public UpDownCounter<T> CreateUpDownCounter<T>(string name, string? unit = null, string? description = null) where T : struct ;
public ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(
string name,
Func<T> observeValue,
string? unit = null,
string? description = null) where T : struct;
public ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(
string name,
Func<Measurement<T>> observeValue,
string? unit = null,
string? description = null) where T : struct;
public ObservableUpDownCounter<T> CreateObservableUpDownCounter<T>(
string name,
Func<IEnumerable<Measurement<T>>> observeValues,
string? unit = null,
string? description = null) where T : struct;
}
} |
terrajobst
added
api-approved
API was approved in API review, it can be implemented
and removed
api-ready-for-review
API is ready for review, it is NOT ready for implementation
labels
Jan 25, 2022
ghost
added
the
in-pr
There is an active PR which will close this issue when it is merged
label
Jan 27, 2022
ghost
removed
the
in-pr
There is an active PR which will close this issue when it is merged
label
Jan 28, 2022
ghost
locked as resolved and limited conversation to collaborators
Feb 27, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Background and motivation
In .NET 6.0 we have exposed the Metric APIs with exposing different instrument types
Counter
,Histogram
,ObservableCounter
, andObservableGauge
. We didn't expose the remaining instrumentsUpDownCounter
andObservableUpDownCounter
. We were collecting feedback to see the demand and the scenarios needed for such instruments before exposing it. Also, we were waiting to have OpenTelemetry specs marked as stable too.Now we have the feedback, and we are seeing the demand for such instruments and the scenarios need such instruments. The proposal here is to expose these instruments.
OpenTelemetry specification
open-telemetry/opentelemetry-dotnet#2362
APIs Proposal
UpDownCounter and ObservableUpDownCounter support only the following generic parameter types:
Byte
,Int16
,Int32
,Int64
,Single
,Double
, andDecimal
.APIs Usage
The text was updated successfully, but these errors were encountered: