Add k8s resource attributes automatically
Co-authored-by: Romain <rtribotte@users.noreply.github.com>
This commit is contained in:
parent
7b78128d4e
commit
78cc85283c
15 changed files with 170 additions and 60 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue