Skip to content

Commit 10c4062

Browse files
authored
Remove opencensus which depends on google/trillian module (#184)
1 parent a3c8961 commit 10c4062

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

cmd/gcp/main.go

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import (
2828
"syscall"
2929
"time"
3030

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

121-
// If we're enabling tracing we need to use an instrumented http.Handler.
122-
var handler http.Handler
123-
if *tracing {
124-
handler, err = opencensus.EnableHTTPServerTracing(*tracingProjectID, *tracingPercent)
125-
if err != nil {
126-
klog.Exitf("Failed to initialize stackdriver / opencensus tracing: %v", err)
127-
}
128-
}
129-
130117
// Bring up the HTTP server and serve until we get a signal not to.
131-
srv := http.Server{Addr: *httpEndpoint, Handler: handler}
118+
srv := http.Server{Addr: *httpEndpoint}
132119
shutdownWG := new(sync.WaitGroup)
133120
go awaitSignal(func() {
134121
shutdownWG.Add(1)

0 commit comments

Comments
 (0)