Skip to content
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

Adding the Metrics Counter API #1578

Merged
merged 16 commits into from
Mar 30, 2021

Conversation

reyang
Copy link
Member

@reyang reyang commented Mar 25, 2021

Changes

During the 03/18/2021 Metrics API/SDK SIG Meeting, we've agreed to focus on Counter as the 1st step to tackle the instruments.

This will be discussed during the upcoming (3/25) Metrics API/SDK SIG meeting.

Related issues #

Related oteps OTEP146

@reyang reyang requested a review from a team as a code owner March 25, 2021 07:29
@reyang reyang requested a review from a team March 25, 2021 07:29
@reyang reyang requested a review from a team as a code owner March 25, 2021 07:29
specification/metrics/new_api.md Outdated Show resolved Hide resolved
specification/metrics/new_api.md Outdated Show resolved Hide resolved
specification/metrics/new_api.md Outdated Show resolved Hide resolved
Copy link
Member

@bogdandrutu bogdandrutu left a comment

Choose a reason for hiding this comment

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

If I were you I would split this into 2 PRs:

  • One that clarifies instrument properties
  • One that adds the Counter details

specification/metrics/new_api.md Outdated Show resolved Hide resolved
specification/metrics/new_api.md Show resolved Hide resolved
specification/metrics/new_api.md Show resolved Hide resolved
specification/metrics/new_api.md Show resolved Hide resolved

var counterPowerUsed = meter.CreateCounter<double, PowerConsumption>("power_consumption", unit="kWh");
counterPowerUsed.Add(13.5, new PowerConsumption { customer = "Tom" });
counterPowerUsed.Add(200, new PowerConsumption { customer = "Jerry" }, ("is_green_energy", true));
Copy link

@noahfalk noahfalk Mar 27, 2021

Choose a reason for hiding this comment

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

While I don't anticipate our .NET 6 implementation to include this strongly typed struct capability it does do a good job indicating the kind of flexibility we'd like language implementors to have.

Copy link
Contributor

@jsuereth jsuereth left a comment

Choose a reason for hiding this comment

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

Meta Comment:

Strings in OTel Specification SHOULD be specified somewhere globally and you should just denote that things are strings, referencing that specification. We have a lot off "string" references in the Trace Spec where this spec is far more explicit.

I think it's worth opening a bug to address that and not blocking this PR. That said, not 100% happy with ASCII vs BMP and wanted to understand why.

specification/metrics/new_api.md Show resolved Hide resolved
specification/metrics/new_api.md Outdated Show resolved Hide resolved
reyang and others added 2 commits March 30, 2021 08:19
Co-authored-by: Leighton Chen <lechen@microsoft.com>
Co-authored-by: Leighton Chen <lechen@microsoft.com>
Co-authored-by: Leighton Chen <lechen@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

10 participants