Skip to content

Remove opencensus which depends on google/trillian module #184

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

Merged
merged 1 commit into from
Mar 13, 2025
Merged
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
15 changes: 1 addition & 14 deletions cmd/gcp/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"syscall"
"time"

"github.com/google/trillian/monitoring/opencensus"
"github.com/prometheus/client_golang/prometheus/promhttp"
sctfe "github.com/transparency-dev/static-ct"
"github.com/transparency-dev/static-ct/storage"
Expand All @@ -53,9 +52,6 @@ var (
metricsEndpoint = flag.String("metrics_endpoint", "", "Endpoint for serving metrics; if left empty, metrics will be visible on --http_endpoint.")
httpDeadline = flag.Duration("http_deadline", time.Second*10, "Deadline for HTTP requests.")
maskInternalErrors = flag.Bool("mask_internal_errors", false, "Don't return error strings with Internal Server Error HTTP responses.")
tracing = flag.Bool("tracing", false, "If true opencensus Stackdriver tracing will be enabled. See https://opencensus.io/.")
tracingProjectID = flag.String("tracing_project_id", "", "project ID to pass to stackdriver. Can be empty for GCP, consult docs for other platforms.")
tracingPercent = flag.Int("tracing_percent", 0, "Percent of requests to be traced. Zero is a special case to use the DefaultSampler.")
origin = flag.String("origin", "", "Origin of the log, for checkpoints and the monitoring prefix.")
bucket = flag.String("bucket", "", "Name of the bucket to store the log in.")
spannerDB = flag.String("spanner_db_path", "", "Spanner database path: projects/{projectId}/instances/{instanceId}/databases/{databaseId}.")
Expand Down Expand Up @@ -118,17 +114,8 @@ func main() {
http.Handle("/metrics", promhttp.Handler())
}

// If we're enabling tracing we need to use an instrumented http.Handler.
var handler http.Handler
if *tracing {
handler, err = opencensus.EnableHTTPServerTracing(*tracingProjectID, *tracingPercent)
if err != nil {
klog.Exitf("Failed to initialize stackdriver / opencensus tracing: %v", err)
}
}

// Bring up the HTTP server and serve until we get a signal not to.
srv := http.Server{Addr: *httpEndpoint, Handler: handler}
srv := http.Server{Addr: *httpEndpoint}
shutdownWG := new(sync.WaitGroup)
go awaitSignal(func() {
shutdownWG.Add(1)
Expand Down
Loading