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(api-metrics): rename metric instruments to match feature-freeze API specification #2496

Merged
merged 11 commits into from
Oct 15, 2021

Conversation

legendecas
Copy link
Member

@legendecas legendecas commented Sep 24, 2021

This PR applies following renames regarding to the feature-freeze metrics API spec:

  • s/ValueRecorder/Histogram/
  • s/ValueObserver/ObservableGauge/
  • s/SumObserver/ObservableCounter/
  • s/UpDownSumObserver/ObservableUpDownCounter/
  • s/BoundBaseObserver/BoundObservableBase/

There is no functional change.

@codecov
Copy link

codecov bot commented Sep 24, 2021

Codecov Report

Merging #2496 (2ad4109) into main (96dab9f) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #2496   +/-   ##
=======================================
  Coverage   93.05%   93.05%           
=======================================
  Files         139      139           
  Lines        5172     5172           
  Branches     1110     1110           
=======================================
  Hits         4813     4813           
  Misses        359      359           
Impacted Files Coverage Δ
...ackages/opentelemetry-api-metrics/src/NoopMeter.ts 82.35% <0.00%> (ø)
...ages/opentelemetry-api-metrics/src/types/Metric.ts 100.00% <0.00%> (ø)
...emetry-sdk-metrics-base/src/ValueRecorderMetric.ts
...lemetry-sdk-metrics-base/src/BaseObserverMetric.ts
...elemetry-sdk-metrics-base/src/SumObserverMetric.ts
...ry-sdk-metrics-base/src/UpDownSumObserverMetric.ts
...emetry-sdk-metrics-base/src/ValueObserverMetric.ts
...entelemetry-sdk-metrics-base/src/ObserverResult.ts
...ntelemetry-sdk-metrics-base/src/HistogramMetric.ts 100.00% <0.00%> (ø)
...-metrics-base/src/ObservableUpDownCounterMetric.ts 100.00% <0.00%> (ø)
... and 4 more

@legendecas legendecas marked this pull request as ready for review September 24, 2021 04:14
@legendecas legendecas requested a review from a team as a code owner September 24, 2021 04:14
@legendecas legendecas changed the title feat: rename metric instruments to match feature-freeze API specification feat(api-metrics): rename metric instruments to match feature-freeze API specification Sep 24, 2021
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

Copy link
Member

@pirgeo pirgeo left a comment

Choose a reason for hiding this comment

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

The specification "highly recommends" ObservableCounter, ObservableGauge, and ObservableUpDownCounter. Is there a reason or strong opinion for the deviation here (CounterObserver, GaugeObserver, UpDownCounterObserver)?

@dyladan
Copy link
Member

dyladan commented Oct 4, 2021

The specification "highly recommends" ObservableCounter, ObservableGauge, and ObservableUpDownCounter. Is there a reason or strong opinion for the deviation here (CounterObserver, GaugeObserver, UpDownCounterObserver)?

I can only guess what @legendecas logic is here, but my guess is that it is to have the least disruption to what people already know. JS already had {}Observer naming so I think he just kept it.

I would prefer to go with the spec on this one though. We will be changing a lot of the metric spec anyway so there isn't a strong reason to keep what we have.

@dyladan
Copy link
Member

dyladan commented Oct 5, 2021

@legendecas are you planning no making the suggested naming changes?

@legendecas
Copy link
Member Author

@dyladan If people are ok with the Observable* naming, I'm going to update the PR late today.

# Conflicts:
#	experimental/packages/opentelemetry-exporter-otlp-grpc/protos
#	experimental/packages/opentelemetry-exporter-otlp-proto/protos
#	experimental/tsconfig.esm.json
#	experimental/tsconfig.json
Copy link
Member

@pirgeo pirgeo left a comment

Choose a reason for hiding this comment

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

Great Work! I just added a few nits, but all of these are personal preference, so please disregard as you see fit.

@legendecas
Copy link
Member Author

@pirgeo thanks for the review, updated!

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, i think we should wait for #2485 before merging this one though

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.

Some minor things and few missing, but I also found some replacement which should be different, not sure if that is a mistake then or you rearranged the order but then maybe it will be easier to revert just the order so the replacing will be covered with those for easier review

Synchronous
Counter -> Counter
UpDownCounter -> UpDownCounter
ValueRecorder -> Histogram

Asynchronous
SumObserver -> ObservableCounter
UpDownSumObserver -> ObservableUpDownCounter
ValueObserver -> ObservableGauge

Please update also Upgrade guidelines listing what has changed and what not

examples/metrics/metrics/observer.js Outdated Show resolved Hide resolved
examples/metrics/metrics/observer.js Outdated Show resolved Hide resolved
examples/metrics/metrics/observer.js Outdated Show resolved Hide resolved
@legendecas
Copy link
Member Author

@obecny Reverted the reordering. Sorry for the inconvenience. Updated the PR with minor observable renaming.

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.

looks great, thx for changes

@obecny obecny merged commit f9f43e5 into open-telemetry:main Oct 15, 2021
@legendecas legendecas deleted the metrics-ff/metrics-type branch October 17, 2021 03:30
@dyladan dyladan added this to Done in Metrics API Oct 20, 2021
willarmiros pushed a commit to willarmiros/opentelemetry-js that referenced this pull request Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

8 participants