Skip to content
Open
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
5 changes: 3 additions & 2 deletions app/artifact-cas/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import (
"github.com/go-kratos/kratos/v2/log"
"github.com/go-kratos/kratos/v2/transport/grpc"
"github.com/go-kratos/kratos/v2/transport/http"
"go.opentelemetry.io/otel/trace"

_ "go.uber.org/automaxprocs"
)
Expand All @@ -63,7 +64,7 @@ type app struct {
backend.Providers
}

func newApp(logger log.Logger, gs *grpc.Server, hs *http.Server, ms *server.HTTPMetricsServer, providers backend.Providers) *app {
func newApp(logger log.Logger, gs *grpc.Server, hs *http.Server, ms *server.HTTPMetricsServer, providers backend.Providers, _ trace.TracerProvider) *app {
return &app{
kratos.New(
kratos.ID(id),
Expand Down Expand Up @@ -131,7 +132,7 @@ func main() {
panic(err)
}

app, cleanup, err := wireApp(bc.Server, bc.Auth, credentialsReader, logger)
app, cleanup, err := wireApp(&bc, bc.Server, bc.Auth, credentialsReader, logger)
if err != nil {
panic(err)
}
Expand Down
4 changes: 2 additions & 2 deletions app/artifact-cas/cmd/wire.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2023 The Chainloop Authors.
// Copyright 2023-2026 The Chainloop Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -31,7 +31,7 @@ import (
)

// wireApp init kratos application.
func wireApp(*conf.Server, *conf.Auth, credentials.Reader, log.Logger) (*app, func(), error) {
func wireApp(*conf.Bootstrap, *conf.Server, *conf.Auth, credentials.Reader, log.Logger) (*app, func(), error) {
panic(
wire.Build(
server.ProviderSet,
Expand Down
9 changes: 7 additions & 2 deletions app/artifact-cas/cmd/wire_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions app/artifact-cas/configs/config.devel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,12 @@ credentials_service:
address: ${VAULT_ADDRESS:http://0.0.0.0:8200}
token: ${VAULT_TOKEN:notasecret}

observability:
tracing:
enabled: false
endpoint: "localhost:4317"
insecure: true
sampling_ratio: 1.0

auth:
public_key_path: ${PUBLIC_KEY_PATH:../../devel/devkeys/cas.pub}
171 changes: 131 additions & 40 deletions app/artifact-cas/internal/conf/conf.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions app/artifact-cas/internal/conf/conf.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,24 @@ message Bootstrap {

message Observability {
Sentry sentry = 1;
Tracing tracing = 2;

// Sentry notification support
message Sentry {
string dsn = 1;
string environment = 2;
}
// OpenTelemetry tracing configuration
message Tracing {
// Whether tracing is enabled. Disabled by default for backward compatibility.
bool enabled = 1;
// OTLP gRPC exporter endpoint (e.g. "localhost:4317")
string endpoint = 2;
// Whether to use insecure connection (no TLS). Useful for local development.
bool insecure = 3;
// Sampling ratio between 0.0 and 1.0. Defaults to 1.0 (sample everything) when unset.
optional double sampling_ratio = 4;
}
}
}

Expand Down
Loading
Loading