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

Document public metric SDK interfaces to remain stable #4396

Merged
merged 8 commits into from Sep 6, 2023

Conversation

MrAlias
Copy link
Contributor

@MrAlias MrAlias commented Jul 31, 2023

Resolve #3673

Similar to #2012, document for developers so they are aware things should not change in the SDK.

@MrAlias MrAlias added documentation Provides helpful information pkg:SDK Related to an SDK package area:metrics Part of OpenTelemetry Metrics Skip Changelog PRs that do not require a CHANGELOG.md entry labels Jul 31, 2023
@MrAlias MrAlias marked this pull request as ready for review July 31, 2023 18:01
sdk/metric/aggregation/aggregation.go Outdated Show resolved Hide resolved
sdk/metric/exporter.go Show resolved Hide resolved
sdk/metric/reader.go Outdated Show resolved Hide resolved
@CharlieTLe
Copy link
Contributor

Would it make sense to have tests that will fail if there are any new, modified, or removed exported methods?

@MrAlias
Copy link
Contributor Author

MrAlias commented Aug 1, 2023

Would it make sense to have tests that will fail if there are any new, modified, or removed exported methods?

Adding test will only add a second place (the interface definitions in the test) where we are not allowed to change anything. I don't see that as very useful.

We could potentially look into using https://pkg.go.dev/golang.org/x/exp/cmd/gorelease to automate all release with a versioning test. It would need more evaluation though.

@MrAlias
Copy link
Contributor Author

MrAlias commented Aug 3, 2023

From IRL conversation with @pellared :

  • The Aggregation interface: is it neede?
    • Can we remove it and just export the concrete types?
    • The SDK can define its own private version of this interface to reference all the concrete types
    • The Stream will need a way to reference these types. It likely makes sense to change the field to inteface{} type
  • The Reader interface may need to be extended based on future changes to the specification.
    • We probably don't want to document the interface cannot change, but instead need a plan for how we will extend it in the future.

@MrAlias MrAlias marked this pull request as draft August 10, 2023 17:30
@MrAlias MrAlias marked this pull request as ready for review August 21, 2023 17:21
Copy link
Member

@pellared pellared left a comment

Choose a reason for hiding this comment

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

Just one comment.

sdk/metric/reader.go Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Sep 6, 2023

Codecov Report

Merging #4396 (ec06e87) into main (01d64c3) will increase coverage by 0.0%.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #4396   +/-   ##
=====================================
  Coverage   81.3%   81.3%           
=====================================
  Files        220     220           
  Lines      17670   17670           
=====================================
+ Hits       14378   14380    +2     
+ Misses      2992    2990    -2     
  Partials     300     300           
Files Changed Coverage
sdk/metric/reader.go ø

@MrAlias MrAlias merged commit 76c370f into open-telemetry:main Sep 6, 2023
27 checks passed
@MrAlias MrAlias deleted the doc-exported-metric-sdk-ifaces branch September 6, 2023 20:55
@MrAlias MrAlias added this to the v1.18.0/v0.41.0 milestone Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:metrics Part of OpenTelemetry Metrics documentation Provides helpful information pkg:SDK Related to an SDK package Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Document public interfaces with versioning policy
7 participants