-
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(api): merge api-metrics into api #3374
Conversation
35a6761
to
6c69710
Compare
6c69710
to
983d966
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3374 +/- ##
==========================================
- Coverage 93.26% 93.24% -0.03%
==========================================
Files 246 247 +1
Lines 7413 7341 -72
Branches 1533 1509 -24
==========================================
- Hits 6914 6845 -69
+ Misses 499 496 -3
|
d9da2a3
to
9e09cfb
Compare
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.
I think merging these packages is the right way to go 🙂
Looks good 🙂
api/src/index.ts
Outdated
export { HrTime, TimeInput } from './common/Time'; | ||
export { Attributes, AttributeValue } from './common/Attributes'; | ||
|
||
export * from './context-api'; |
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.
It would be nice to have this as explicit (named) exports rather than implicit exports (*) to remove the unexpected inclusion of exported values from the listed files.
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.
I have updated the exports in *-api.ts file to be explicit so I export everything from *-api.ts from index.ts. Like trace-api.ts, which used to be export *
from each internal module.
In this way, we can have a relatively short index.ts and check *-api.ts for the exports of each API.
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.
I agree with @MSNev here. The index is the one source of truth to see what is exported from the API package. It is not convenient to have to go to another file to see what is exported. Also, someone may add an export to that file not realizing that index.ts has the *
export.
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.
Left a few minor suggestions..
I REALLY like the removal of the namespace references api.xxx
etc, this is one of the things I was planning for the web sandbox because of the tree-shaking improvements that this has.
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.
👍
Which problem is this PR solving?
Merge stable API packages @opentelemetry/api-metrics into @opentelemetry/api.
Fixes #3368
Notably, those packages that depend on the metrics API now declare peer dependency on @opentelemetry/api ">=1.2.0 <1.3.0" and "^1.,2.0". The version range should be updated to ">=1.3.0 <1.4.0" and "^1.3.0" respectively when metrics API is released in @opentelemetry/api v1.3.0.
Type of change
How Has This Been Tested?
Checklist: