-
Notifications
You must be signed in to change notification settings - Fork 821
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
feat: implement named meter #700
Conversation
} | ||
|
||
getMeter( | ||
name: string = 'default', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mayurkale22 Just to double check that we decide to have 'default' name and also give better names in examples and tests in today's SIG metting, is it correct? Thanks :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this typing has name
as an optional property. We want it to be required, but we need to check anyways since someone not using typescript may call getMeter
without name and we have to return something
Codecov Report
@@ Coverage Diff @@
## master #700 +/- ##
==========================================
+ Coverage 89.92% 92.63% +2.71%
==========================================
Files 218 227 +9
Lines 10129 10312 +183
Branches 945 938 -7
==========================================
+ Hits 9108 9553 +445
+ Misses 1021 759 -262
|
/** | ||
* This class represents a meter provider which platform libraries can extend | ||
*/ | ||
export class MeterProvider implements types.MeterProvider { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please change Provider to Registry (MeterProvider
=> MeterRegistry
), there is still confusion about the name. See: #699 (comment). We can come back to this once we have some decision.
Sorry for the confusion :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, no problem. 🤣
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@dyladan please review when you get a chance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, just a minor comments
getting-started/README.md
Outdated
``` | ||
|
||
Now, you can require this file from your application code and use the `Meter` to create and manage metrics. The simplest of these metrics is a counter. Let's create and export from our `monitoring.js` file a middleware function that express can use to count all requests by route. Modify the `monitoring.js` file so that it looks like this: | ||
|
||
```javascript | ||
'use strict'; | ||
|
||
const { Meter } = require("@opentelemetry/metrics"); | ||
const { MeterRegistry } = require("@opentelemetry/metrics"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: change all double quotes from all examples to be single quotes
@@ -1,9 +1,9 @@ | |||
"use strict"; | |||
|
|||
const { Meter } = require("@opentelemetry/metrics"); | |||
const { MeterRegistry } = require("@opentelemetry/metrics"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: please use single quotes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job !
I think this is good to go. Please rebase branch with the base branch, unable to merge w/o that. |
Which problem is this PR solving?
Short description of the changes