Instrumented everything but Python

This commit is contained in:
morganmclean 2018-07-16 11:25:10 -07:00
parent 11e68b3733
commit 99ce1f84c2
19 changed files with 952 additions and 24 deletions

View file

@ -13,7 +13,8 @@ RUN go get -d github.com/google/uuid \
go.opencensus.io/plugin/ochttp \
go.opencensus.io/plugin/ochttp/propagation/b3 \
go.opencensus.io/exporter/stackdriver \
go.opencensus.io/trace
go.opencensus.io/trace \
cloud.google.com/go/profiler
# copy go-only part of the build
COPY *.go ./

View file

@ -7,6 +7,7 @@ import (
"os"
"time"
"cloud.google.com/go/profiler"
"github.com/gorilla/mux"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
@ -61,6 +62,16 @@ type frontendServer struct {
}
func main() {
// Profiler initialization, best done as early as possible.
if err := profiler.Start(profiler.Config{
Service: "frontendservice",
ServiceVersion: "1.0.0",
// ProjectID must be set if not running on GCP.
// ProjectID: "my-project",
}); err != nil {
// TODO: Handle error.
}
ctx := context.Background()
log := logrus.New()
log.Level = logrus.DebugLevel