diff --git a/pkg/debuginfo/debuginfod.go b/pkg/debuginfo/debuginfod.go index 8345818a857..4e50b19235e 100644 --- a/pkg/debuginfo/debuginfod.go +++ b/pkg/debuginfo/debuginfod.go @@ -1,4 +1,4 @@ -// Copyright 2022-2023 The Parca Authors +// Copyright 2022-2024 The Parca Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -81,6 +81,7 @@ type ParallelDebuginfodClients struct { } func NewDebuginfodClients( + logger log.Logger, reg prometheus.Registerer, tracerProvider trace.TracerProvider, upstreamServerHosts []string, @@ -98,6 +99,7 @@ func NewDebuginfodClients( prometheus.WrapRegistererWith(prometheus.Labels{"cache": "debuginfod_exists", "debuginfod_host": host}, reg), 8*1024, NewDebuginfodClientWithObjectStorageCache( + logger, objstore.NewPrefixedBucket(bucket, host), NewHTTPDebuginfodClient( tracerProvider, @@ -214,12 +216,14 @@ func NewHTTPDebuginfodClient( // NewDebuginfodClientWithObjectStorageCache creates a new DebuginfodClient that caches the debug information in the object storage. func NewDebuginfodClientWithObjectStorageCache( + logger log.Logger, bucket objstore.Bucket, client DebuginfodClient, ) DebuginfodClient { return &DebuginfodClientObjectStorageCache{ client: client, bucket: bucket, + logger: logger, } } diff --git a/pkg/debuginfo/debuginfod_test.go b/pkg/debuginfo/debuginfod_test.go index a1e6fa9b9ac..6ac20819e7a 100644 --- a/pkg/debuginfo/debuginfod_test.go +++ b/pkg/debuginfo/debuginfod_test.go @@ -1,4 +1,4 @@ -// Copyright 2022-2023 The Parca Authors +// Copyright 2022-2024 The Parca Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -28,6 +28,7 @@ import ( "testing" "time" + "github.com/go-kit/log" "github.com/stretchr/testify/require" "github.com/thanos-io/objstore" "go.opentelemetry.io/otel/trace/noop" @@ -197,6 +198,7 @@ func TestHTTPDebugInfodCache(t *testing.T) { } cache := NewDebuginfodClientWithObjectStorageCache( + log.NewNopLogger(), objstore.NewInMemBucket(), c, ) diff --git a/pkg/parca/parca.go b/pkg/parca/parca.go index af706ad592e..9bec9acae87 100644 --- a/pkg/parca/parca.go +++ b/pkg/parca/parca.go @@ -422,6 +422,7 @@ func Run(ctx context.Context, logger log.Logger, reg *prometheus.Registry, flags var debuginfodClients debuginfo.DebuginfodClients = debuginfo.NopDebuginfodClients{} if len(flags.Debuginfod.UpstreamServers) > 0 { debuginfodClients = debuginfo.NewDebuginfodClients( + logger, reg, tracerProvider, flags.Debuginfod.UpstreamServers,