Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(parca-dev#4262): init logger #4291

Merged
merged 5 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pkg/debuginfo/debuginfod.go
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -81,6 +81,7 @@ type ParallelDebuginfodClients struct {
}

func NewDebuginfodClients(
logger log.Logger,
reg prometheus.Registerer,
tracerProvider trace.TracerProvider,
upstreamServerHosts []string,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
}
}

Expand Down
4 changes: 3 additions & 1 deletion pkg/debuginfo/debuginfod_test.go
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -197,6 +198,7 @@ func TestHTTPDebugInfodCache(t *testing.T) {
}

cache := NewDebuginfodClientWithObjectStorageCache(
log.NewNopLogger(),
objstore.NewInMemBucket(),
c,
)
Expand Down
1 change: 1 addition & 0 deletions pkg/parca/parca.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading