Plugins: Tracing: Add test for composite propagation (#65917)

This commit is contained in:
Giuseppe Guerra 2023-04-04 23:16:57 +02:00 committed by GitHub
parent f932952c68
commit f1eddbad06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -304,6 +304,27 @@ func TestInitializer_tracingEnvironmentVariables(t *testing.T) {
assert.Equal(t, "GF_INSTANCE_OTLP_PROPAGATION=w3c", envVars[4])
},
},
{
name: "otlp enabled composite propagation",
cfg: &config.Cfg{
Opentelemetry: config.OpentelemetryCfg{
Address: "127.0.0.1:4317",
Propagation: "w3c,jaeger",
},
PluginSettings: map[string]map[string]string{
pluginID: {"tracing": "true"},
},
},
plugin: defaultPlugin,
exp: func(t *testing.T, envVars []string) {
assert.Len(t, envVars, 5)
assert.Equal(t, "GF_PLUGIN_TRACING=true", envVars[0])
assert.Equal(t, "GF_VERSION=", envVars[1])
assert.Equal(t, "GF_PLUGIN_VERSION=1.0.0", envVars[2])
assert.Equal(t, "GF_INSTANCE_OTLP_ADDRESS=127.0.0.1:4317", envVars[3])
assert.Equal(t, "GF_INSTANCE_OTLP_PROPAGATION=w3c,jaeger", envVars[4])
},
},
{
name: "otlp no propagation disabled by default",
cfg: &config.Cfg{