Instrumented everything but Python
This commit is contained in:
parent
11e68b3733
commit
99ce1f84c2
19 changed files with 952 additions and 24 deletions
|
@ -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 ./
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue