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",
},

View file

@ -315,7 +315,17 @@
"maxSize": 5,
"maxAge": 3,
"maxBackups": 4,
"compress": true
"compress": true,
"otlp": {
"serviceName": "foobar",
"grpc": {
"endpoint": "xxxx",
"insecure": true
},
"http": {
"endpoint": "xxxx"
}
}
},
"accessLog": {
"filePath": "xxxx",
@ -340,18 +350,35 @@
}
}
},
"bufferingSize": 42
"bufferingSize": 42,
"otlp": {
"serviceName": "foobar",
"grpc": {
"endpoint": "xxxx",
"insecure": true
},
"http": {
"endpoint": "xxxx"
}
}
},
"tracing": {
"serviceName": "myServiceName",
"globalAttributes": {
"resourceAttributes": {
"foobar": "foobar"
},
"sampleRate": 42,
"otlp": {
"grpc": {
"endpoint": "xxxx",
"insecure": true
},
"http": {
"endpoint": "xxxx"
}
},
"globalAttributes": {
"foobar": "foobar"
}
},
"hostResolver": {
@ -370,11 +397,11 @@
"certificatesDuration": 42,
"dnsChallenge": {
"provider": "DNSProvider",
"delayBeforeCheck": "42ns",
"resolvers": [
"xxxx",
"xxxx"
],
"delayBeforeCheck": "42ns",
"disablePropagationCheck": true
},
"httpChallenge": {