Instrumented everything but Python
This commit is contained in:
parent
11e68b3733
commit
99ce1f84c2
19 changed files with 952 additions and 24 deletions
|
@ -9,11 +9,12 @@ RUN go get -d github.com/google/uuid \
|
|||
google.golang.org/grpc/status \
|
||||
go.opencensus.io/plugin/ocgrpc \
|
||||
go.opencensus.io/exporter/stackdriver \
|
||||
go.opencensus.io/trace
|
||||
go.opencensus.io/trace \
|
||||
cloud.google.com/go/profiler
|
||||
COPY . .
|
||||
# get remaining dependencies
|
||||
RUN go get -d ./...
|
||||
RUN go build -o /checkoutservice .
|
||||
RUN go build -gcflags='-N -l' -o /checkoutservice .
|
||||
|
||||
FROM alpine as release
|
||||
RUN apk add --no-cache ca-certificates
|
||||
|
|
|
@ -18,6 +18,8 @@ import (
|
|||
|
||||
pb "checkoutservice/genproto"
|
||||
money "checkoutservice/money"
|
||||
|
||||
"cloud.google.com/go/profiler"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -35,6 +37,15 @@ type checkoutService struct {
|
|||
}
|
||||
|
||||
func main() {
|
||||
if err := profiler.Start(profiler.Config{
|
||||
Service: "cartservice",
|
||||
ServiceVersion: "1.0.0",
|
||||
// ProjectID must be set if not running on GCP.
|
||||
// ProjectID: "my-project",
|
||||
}); err != nil {
|
||||
// TODO: Handle error.
|
||||
}
|
||||
|
||||
port := listenPort
|
||||
if os.Getenv("PORT") != "" {
|
||||
port = os.Getenv("PORT")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue