Open tigrannajaryan opened 3 years ago
cc @bogdandrutu @MrAlias
Would like to see this as well. I'm looking to use otel in Go and it's quite confusing what is actually required, especially when looking at the compliance matrix: https://github.com/open-telemetry/opentelemetry-specification/blob/main/spec-compliance-matrix.md#environment-variables
It seems like Go could simply look at the supported SDK environment variables and completely instrument itself based on what it finds in the environment. This would heavily simplify what is actually required within the Go program itself.
The calls needed to setup and enable the emitting of telemetry by the SDK are currently quite complicated.
We should have a much simpler API for basic use-cases.
Here is what needs to be done currently to enable telemetry (copied from example code):
It will be hard for new users of OpenTelemetry to write this initialization code from scratch. They will most likely copy/paste it and modify as needed. However, there is little that needs customization in this code and little decision making that is mandatory for end user to do, which would justify forcing the user to go through this exercise.
I suggest that we come up with a simple "enable" API that has sane defaults for most users.
Here is a possible simple SDK initialization API that we could have.
Minimum version:
Use customized exporter:
Use customized trace provider:
etc, etc, with further customization possible up to the full version equivalent to the detailed initialization code that we require today.
Note: the above proposal of simpler API is for illustration only. I will happy with any other alternate that is similarly simple.