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!: remove label keys as they are no longer part of the spec #1126

Merged
merged 9 commits into from
Jun 9, 2020

Conversation

naseemkullah
Copy link
Member

@naseemkullah naseemkullah commented May 31, 2020

Which problem is this PR solving?

Short description of the changes

  • Removed or replaced all occurrences of labelKeys

  • Removed or replaced all occurrences of prom-clients's labelValues

  • Removed no longer used private _getLabelValues()

  • All metrics now have all labels associated to them, tests adjusted accordingly

Signed-off-by: Naseem <naseem@transit.app>
@codecov
Copy link

codecov bot commented May 31, 2020

Codecov Report

Merging #1126 into master will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1126      +/-   ##
==========================================
- Coverage   92.32%   92.31%   -0.02%     
==========================================
  Files         116      116              
  Lines        3402     3395       -7     
  Branches      689      688       -1     
==========================================
- Hits         3141     3134       -7     
  Misses        261      261              
Impacted Files Coverage Δ
packages/opentelemetry-api/src/metrics/Metric.ts 100.00% <ø> (ø)
packages/opentelemetry-metrics/src/Metric.ts 100.00% <ø> (ø)
packages/opentelemetry-metrics/src/export/types.ts 100.00% <ø> (ø)
packages/opentelemetry-metrics/src/types.ts 100.00% <ø> (ø)
...pentelemetry-exporter-prometheus/src/prometheus.ts 91.39% <100.00%> (-0.61%) ⬇️
...ckages/opentelemetry-metrics/src/export/Batcher.ts 100.00% <100.00%> (ø)

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.

Added a few comments.

packages/opentelemetry-metrics/test/Batcher.test.ts Outdated Show resolved Hide resolved
packages/opentelemetry-metrics/test/Batcher.test.ts Outdated Show resolved Hide resolved
@mayurkale22
Copy link
Member

Are you planning to update examples (https://github.com/open-telemetry/opentelemetry-js/blob/master/examples/prometheus/index.js#L23) in separate PR?

@naseemkullah naseemkullah changed the title feat: remove label keys as they are no longer part of the spec feat!: remove label keys as they are no longer part of the spec May 31, 2020
Co-authored-by: Mayur Kale <mayurkale@google.com>
@naseemkullah
Copy link
Member Author

naseemkullah commented May 31, 2020

Are you planning to update examples (https://github.com/open-telemetry/opentelemetry-js/blob/master/examples/prometheus/index.js#L23) in separate PR?

Ah, no, will do it here, thanks.

edit: done

Naseem added 4 commits May 31, 2020 16:27
Signed-off-by: Naseem <naseem@transit.app>
…(_batchMap)

Signed-off-by: Naseem <naseem@transit.app>
Signed-off-by: Naseem <naseem@transit.app>
@mayurkale22
Copy link
Member

@open-telemetry/javascript-approvers would like to get more reviews on this.

@@ -19,7 +19,6 @@ const meter = new MeterProvider({

const otelCpuUsage = meter.createObserver('metric_observer', {
Copy link
Member

Choose a reason for hiding this comment

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

out of curiosity, how am I able to create a labels at this moment after this change. What would be a correct way of doing it now, if for any reason I want to have labels ?

Copy link
Member

Choose a reason for hiding this comment

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

You can't. Labels are now applied only by binding them to an instrument, or calling the instrument method with labels as the second argument like add(10, { core: 1 })

Copy link
Member

@vmarchaud vmarchaud 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 mayurkale22 requested a review from obecny June 6, 2020 18:57
Copy link
Member

@obecny obecny 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 mayurkale22 merged commit c24d992 into open-telemetry:master Jun 9, 2020
@naseemkullah naseemkullah deleted the remove-label-keys branch April 9, 2021 18:18
dyladan pushed a commit to dyladan/opentelemetry-js that referenced this pull request Sep 9, 2022
dyladan added a commit to dyladan/opentelemetry-js that referenced this pull request Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants