1
0
Fork 0

Add k8s resource attributes automatically

Co-authored-by: Romain <rtribotte@users.noreply.github.com>
This commit is contained in:
Kevin Pollet 2025-07-21 12:06:04 +02:00 committed by GitHub
parent 7b78128d4e
commit 78cc85283c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 170 additions and 60 deletions

View file

@ -85,7 +85,7 @@ func (h *Handler) AliceConstructor() alice.Constructor {
}
// NewHandler creates a new Handler.
func NewHandler(config *types.AccessLog) (*Handler, error) {
func NewHandler(ctx context.Context, config *types.AccessLog) (*Handler, error) {
var file io.WriteCloser = noopCloser{os.Stdout}
if len(config.FilePath) > 0 {
f, err := openAccessLogFile(config.FilePath)
@ -116,7 +116,7 @@ func NewHandler(config *types.AccessLog) (*Handler, error) {
}
if config.OTLP != nil {
otelLoggerProvider, err := config.OTLP.NewLoggerProvider()
otelLoggerProvider, err := config.OTLP.NewLoggerProvider(ctx)
if err != nil {
return nil, fmt.Errorf("setting up OpenTelemetry logger provider: %w", err)
}