sdk
sdk copied to clipboard
Remove API `opentelemetry.IsEnabled()` from SDK and add check on OpenTelemetry into each application directly
Problem statement
The current way for enabling/disabling OpenTelemetry maybe is not clear for users. To enable it should be defined ENV https://github.com/networkservicemesh/sdk/blob/main/pkg/tools/opentelemetry/opentelemetry.go#L41
The ENV is not presented into applications env configs. So there is no way to figure out for users how to disable/enable OpenTelemetry without researching the source code.
Solution
- Remove https://github.com/networkservicemesh/sdk/blob/main/pkg/tools/opentelemetry/opentelemetry.go#L40-L50
- Add function
Enable()
into packageopentelemetry
- Add
OpenTelemetryEnabled
bolean flag into https://github.com/networkservicemesh/cmd-nsc/blob/main/internal/config/config.go#L28 - Replace https://github.com/networkservicemesh/cmd-nsc/blob/main/main.go#L103 to
confg.OpenTelemetryEnabled
- Repeat 2, 3 for each cmd-.* application
@edwarnicke Is this make sense?