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

feat: implement named meter #691

Closed
wants to merge 9 commits into from

Conversation

xiao-lix
Copy link
Contributor

Which problem is this PR solving?

Short description of the changes

  • Implement named meters and update documentation

@dyladan
Copy link
Member

dyladan commented Jan 13, 2020

There is no reason to call the registry the "basic" registry since there is no difference between a node meter and a web meter. That distinction is only for tracing as far as I'm aware.

@@ -0,0 +1,29 @@
/*!
Copy link
Member

Choose a reason for hiding this comment

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

nit: meter_registry.ts => MeterRegistry.ts

/**
* This class represents a basic tracer registry which platform libraries can extend
*/
export class BasicMeterRegistry implements types.MeterRegistry {
Copy link
Member

@mayurkale22 mayurkale22 Jan 13, 2020

Choose a reason for hiding this comment

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

I would prefer to keep MeterRegistry instead of BasicMeterRegistry, I don;t expect to see NodeMeterRegistry or WebMeterRegistry.

import { DEFAULT_CONFIG, MeterConfig } from './types';

/**
* This class represents a basic tracer registry which platform libraries can extend
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* This class represents a basic tracer registry which platform libraries can extend
* This class represents a basic meter registry which platform libraries can extend

@mayurkale22 mayurkale22 added enhancement New feature or request size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 13, 2020
@codecov-io
Copy link

codecov-io commented Jan 13, 2020

Codecov Report

Merging #691 into master will decrease coverage by 0.18%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #691      +/-   ##
==========================================
- Coverage   89.89%   89.71%   -0.19%     
==========================================
  Files         217      216       -1     
  Lines       10276    10046     -230     
  Branches      940      936       -4     
==========================================
- Hits         9238     9013     -225     
+ Misses       1038     1033       -5
Impacted Files Coverage Δ
packages/opentelemetry-metrics/test/Meter.test.ts 100% <ø> (ø) ⬆️
...emetry-exporter-prometheus/test/prometheus.test.ts 98.6% <100%> (ø) ⬆️
.../opentelemetry-core/test/metrics/NoopMeter.test.ts 97.29% <100%> (ø) ⬆️
...s/opentelemetry-metrics/test/MeterRegistry.test.ts 100% <100%> (ø) ⬆️
...ackages/opentelemetry-metrics/src/MeterRegistry.ts 100% <100%> (ø) ⬆️
...-metrics/test/export/ConsoleMetricExporter.test.ts 100% <100%> (ø) ⬆️
...ges/opentelemetry-tracing/src/NoopSpanProcessor.ts 66.66% <0%> (-8.34%) ⬇️
...ckages/opentelemetry-core/src/common/NoopLogger.ts 50% <0%> (-7.15%) ⬇️
packages/opentelemetry-plugin-mysql/src/utils.ts 90.9% <0%> (-4.55%) ⬇️
...opentelemetry-core/src/trace/globaltracer-utils.ts 90% <0%> (-1.67%) ⬇️
... and 25 more

}

getMeter(
name: string = 'default',
Copy link
Member

Choose a reason for hiding this comment

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

This is same as open-telemetry/opentelemetry-specification#407 and #679, I would suggest to remove default for now and assign the names in examples and tests. We can come back to this and update based on the decision. @xiao-lix and @dyladan WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

Definitely name should be a required property.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good to me, but I checked out this PR #681 is approved, will it be merged? 🤔

Copy link
Member

Choose a reason for hiding this comment

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

unlikely at this point that it will be merged in its current state. in any case, the spec clearly states that name is a required attribute

Copy link
Member

Choose a reason for hiding this comment

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

instead of making name required, we are more likely to change the examples to contain better names. Right now many of them are "default" (my fault) which is not a great name and doesn't really help anyone understand the purpose of the name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see, will remove default for now and assign better names in examples and tests.

Copy link
Member

@mayurkale22 mayurkale22 left a comment

Choose a reason for hiding this comment

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

Lgtm

@mayurkale22
Copy link
Member

Please fix the build

@dyladan
Copy link
Member

dyladan commented Jan 14, 2020

Commit 59fc196 does not have your email associated with it. You must have made it from another computer. In any case the FAQ here at number 7 states that all commits must have your email. That and all subsequent commits on the PR will fail.

@mayurkale22
Copy link
Member

Could you please update the PR with respect to #699 (change "Registry" to "Provider")?

@xiao-lix xiao-lix closed this Jan 15, 2020
@xiao-lix xiao-lix deleted the xiao/meter-registry branch January 15, 2020 19:33
@dyladan
Copy link
Member

dyladan commented Jan 15, 2020

Please wait until @bogdandrutu's concerns are addressed. I don't want to have to keep changing this over and over.

pichlermarc pushed a commit to dynatrace-oss-contrib/opentelemetry-js that referenced this pull request Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Named Meters
4 participants