-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Should metrics API be developed for golang 1.18 #2494
Comments
This is something I've been wondering about myself. I think there is a very high hurdle to clear before we decide to take this path as our current policy is to support at least the current and immediately prior releases of Go, which would mean that we could not use features in 1.18 until after the release of 1.19 without changing that policy. That said, it may be worth making the change and I'd be interested in seeing what sort of improvements to the API could be offered by taking advantage of generics. |
I definitely think it is an option worth exploring. |
Go 1.18 is expected to be released in February 2022. With a 6 month cadence on these releases, that puts 1.19 being released around August 2022. This means the question becomes: should we break our compatibility guarantee with the Go project to build our metric API with generics? |
We also need to explore the feasibility of using generics in the API/SDK to motivate a decision here. This should involve building a prototype. |
I have been exploring the feasibility of using generics for the SDK in a branch here: https://github.com/open-telemetry/opentelemetry-go/compare/main...jmacd:jmacd/mapi3?expand=1 Since generics are very new, this will take developers a while to get used to. For myself, I am definitely appreciating generics to reduce the size and repetition inside the SDK. For the API, the Go team has given a canonical example of using generics in a metrics API: https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#metrics The OTel metrics API does not specify the kind of ordered-attribute interface favored inside Google, although we have discussed this as an optional support that a language could provide. I am not planning to pursue a generic API for OTel-Go, although if we want to take this topic up after GA, that's fine. (I know the Java and C++ APIs are probably going to want this.) In the 1/13/22 OTel-Go SIG I plan to briefly share the branch linked above. |
Follow on the consensus of the SIG:
I going to close this issue as this has been the consensus for a few weeks and is the approach we took with the API redesign and are taking with the SDK work. |
Related to #2528 |
It looks like golang 1.18 will support generics (see https://go.dev/doc/tutorial/generics). With that the need of "Number" for example as a public type is a bit unclear, and probably other "sdkapi" public types.
Should the opentelemetr-go be designed using generics?
The text was updated successfully, but these errors were encountered: