sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Remove API `opentelemetry.IsEnabled()` from SDK and add check on OpenTelemetry into each application directly

Open denis-tingaikin opened this issue 3 years ago • 1 comments

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

  1. Remove https://github.com/networkservicemesh/sdk/blob/main/pkg/tools/opentelemetry/opentelemetry.go#L40-L50
  2. Add function Enable() into package opentelemetry
  3. Add OpenTelemetryEnabled bolean flag into https://github.com/networkservicemesh/cmd-nsc/blob/main/internal/config/config.go#L28
  4. Replace https://github.com/networkservicemesh/cmd-nsc/blob/main/main.go#L103 to confg.OpenTelemetryEnabled
  5. Repeat 2, 3 for each cmd-.* application

denis-tingaikin avatar Jan 17 '22 02:01 denis-tingaikin

@edwarnicke Is this make sense?

denis-tingaikin avatar Jan 17 '22 02:01 denis-tingaikin