fix: Use standard env variables for opentelemtry (#2194)

Opentelemetry defines standard variables which are supported by multiple observability platforms.

[1] https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md
[2] https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md

By defining support for standard env vars, Fission open telemetry support can be leveraged with different
platforms such as NewRelic, SigNoz, DataDog etc.

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
Sanket Sudake
2021-09-16 17:48:26 +05:30
committed by GitHub
parent 33473a4528
commit 4a0bd1aa21
15 changed files with 253 additions and 250 deletions
+5 -1
View File
@@ -11,7 +11,11 @@ import (
)
func TracingEnabled(logger *zap.Logger) bool {
openTracingEnabled, err := strconv.ParseBool(os.Getenv("OPENTRACING_ENABLED"))
tracingEnabled := os.Getenv("TRACING_ENABLED")
if len(tracingEnabled) == 0 {
return false
}
openTracingEnabled, err := strconv.ParseBool(tracingEnabled)
if err != nil {
if logger != nil {
logger.Error("Error parsing OpenTracing enabled flag", zap.Error(err))