1
0
Fork 0

OpenTelemetry Logs and Access Logs

Co-authored-by: Kevin Pollet <pollet.kevin@gmail.com>
This commit is contained in:
Romain 2024-12-06 14:50:04 +01:00 committed by GitHub
parent 33c1d700c0
commit 826a2b74aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 2297 additions and 475 deletions

View file

@ -30,7 +30,6 @@ import (
"github.com/traefik/traefik/v3/pkg/provider/kv/zk"
"github.com/traefik/traefik/v3/pkg/provider/rest"
traefiktls "github.com/traefik/traefik/v3/pkg/tls"
"github.com/traefik/traefik/v3/pkg/tracing/opentelemetry"
"github.com/traefik/traefik/v3/pkg/types"
)
@ -831,6 +830,25 @@ func TestDo_staticConfiguration(t *testing.T) {
MaxAge: 3,
MaxBackups: 4,
Compress: true,
OTLP: &types.OTelLog{
ServiceName: "foobar",
ResourceAttributes: map[string]string{
"foobar": "foobar",
},
GRPC: &types.OTelGRPC{
Endpoint: "foobar",
Insecure: true,
Headers: map[string]string{
"foobar": "foobar",
},
},
HTTP: &types.OTelHTTP{
Endpoint: "foobar",
Headers: map[string]string{
"foobar": "foobar",
},
},
},
}
config.AccessLog = &types.AccessLog{
@ -854,18 +872,46 @@ func TestDo_staticConfiguration(t *testing.T) {
},
},
BufferingSize: 42,
OTLP: &types.OTelLog{
ServiceName: "foobar",
ResourceAttributes: map[string]string{
"foobar": "foobar",
},
GRPC: &types.OTelGRPC{
Endpoint: "foobar",
Insecure: true,
Headers: map[string]string{
"foobar": "foobar",
},
},
HTTP: &types.OTelHTTP{
Endpoint: "foobar",
Headers: map[string]string{
"foobar": "foobar",
},
},
},
}
config.Tracing = &static.Tracing{
ServiceName: "myServiceName",
ResourceAttributes: map[string]string{
"foobar": "foobar",
},
GlobalAttributes: map[string]string{
"foobar": "foobar",
},
SampleRate: 42,
OTLP: &opentelemetry.Config{
HTTP: &types.OtelHTTP{
OTLP: &types.OTelTracing{
HTTP: &types.OTelHTTP{
Endpoint: "foobar",
TLS: nil,
Headers: map[string]string{
"foobar": "foobar",
},
},
GRPC: &types.OTelGRPC{
Endpoint: "foobar",
Insecure: true,
Headers: map[string]string{
"foobar": "foobar",
},