Skip to content
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
11 changes: 11 additions & 0 deletions cmd/cachewd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"github.com/block/cachew/internal/metadatadb"
"github.com/block/cachew/internal/metrics"
"github.com/block/cachew/internal/opa"
"github.com/block/cachew/internal/profiling"
"github.com/block/cachew/internal/reaper"
"github.com/block/cachew/internal/s3client"
"github.com/block/cachew/internal/strategy"
Expand All @@ -52,6 +53,8 @@ type CLI struct {
Schema bool `help:"Print the configuration file schema." xor:"command"`

Config *os.File `hcl:"-" help:"Configuration file path." required:"" default:"cachew.hcl"`

DDProfilingEnabled bool `help:"Enable the Datadog continuous profiler." env:"DD_PROFILING_ENABLED"`
}

func main() {
Expand All @@ -70,6 +73,14 @@ func main() {
ctx := context.Background()
logger, ctx := logging.Configure(ctx, globalConfig.LoggingConfig)

// Start the Datadog continuous profiler when enabled. The DD_*
// env vars (DD_AGENT_HOST/SERVICE/ENV/VERSION) are read by the
// dd-trace-go library directly and are wired in by the deployment
// manifest.
stopProfiler, err := profiling.Start(ctx, cli.DDProfilingEnabled)
fatalIfError(ctx, logger, err, "Failed to start Datadog profiler")
defer stopProfiler()

reaper.Start(ctx)

// Start initialising
Expand Down
13 changes: 13 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,16 @@ require (
go.opentelemetry.io/otel/sdk/metric v1.43.0
golang.org/x/mod v0.35.0
golang.org/x/sync v0.20.0
gopkg.in/DataDog/dd-trace-go.v1 v1.74.8
)

require (
github.com/DataDog/datadog-agent/pkg/trace v0.67.0 // indirect
github.com/DataDog/datadog-go/v5 v5.6.0 // indirect
github.com/DataDog/dd-trace-go/v2 v2.3.0 // indirect
github.com/DataDog/gostackparse v0.7.0 // indirect
github.com/Masterminds/semver/v3 v3.3.1 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/agnivade/levenshtein v1.2.1 // indirect
github.com/aofei/backoff v1.2.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
Expand All @@ -39,6 +46,7 @@ require (
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/goccy/go-json v0.10.5 // indirect
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 // indirect
github.com/hexops/gotextdiff v1.0.3 // indirect
Expand All @@ -60,10 +68,13 @@ require (
github.com/prometheus/common v0.67.5 // indirect
github.com/prometheus/otlptranslator v1.0.0 // indirect
github.com/prometheus/procfs v0.20.1 // indirect
github.com/puzpuzpuz/xsync/v3 v3.5.1 // indirect
github.com/rcrowley/go-metrics v0.0.0-20250401214520-65e299d6c5c9 // indirect
github.com/richardartoul/molecule v1.0.1-0.20240531184615-7ca0df43c0b3 // indirect
github.com/rs/xid v1.6.0 // indirect
github.com/segmentio/asm v1.2.1 // indirect
github.com/sirupsen/logrus v1.9.4 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/tchap/go-patricia/v2 v2.3.3 // indirect
github.com/tinylib/msgp v1.6.1 // indirect
github.com/valyala/fastjson v1.6.7 // indirect
Expand All @@ -80,10 +91,12 @@ require (
golang.org/x/net v0.52.0 // indirect
golang.org/x/sys v0.42.0 // indirect
golang.org/x/text v0.35.0 // indirect
golang.org/x/time v0.15.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 // indirect
google.golang.org/grpc v1.80.0 // indirect
google.golang.org/protobuf v1.36.11 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
sigs.k8s.io/yaml v1.6.0 // indirect
)

Expand Down
Loading