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
+2 -10
View File
@@ -18,6 +18,7 @@ import (
fv1 "github.com/fission/fission/pkg/apis/core/v1"
"github.com/fission/fission/pkg/fetcher"
"github.com/fission/fission/pkg/utils"
"github.com/fission/fission/pkg/utils/otel"
)
type Config struct {
@@ -283,16 +284,7 @@ func (cfg *Config) addFetcherToPodSpecWithCommand(podSpec *apiv1.PodSpec, mainCo
},
},
},
Env: []apiv1.EnvVar{
{
Name: "OPENTRACING_ENABLED",
Value: os.Getenv("OPENTRACING_ENABLED"),
},
{
Name: "OTEL_COLLECTOR_ENDPOINT",
Value: os.Getenv("OTEL_COLLECTOR_ENDPOINT"),
},
},
Env: otel.OtelEnvForContainer(),
}
// Pod is removed from endpoints list for service when it's