Skip to content

Commit

Permalink
[go services]: workaround: disable grpc metrics (#1205)
Browse files Browse the repository at this point in the history
* workaround: disable grpc metrics

Signed-off-by: Pierre Tessier <pierre@pierretessier.com>

* workaround: disable grpc metrics

Signed-off-by: Pierre Tessier <pierre@pierretessier.com>

---------

Signed-off-by: Pierre Tessier <pierre@pierretessier.com>
  • Loading branch information
puckpuck authored Nov 1, 2023
1 parent 3a00b49 commit 526a8d3
Show file tree
Hide file tree
Showing 5 changed files with 345 additions and 66 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ release.
([#1151](https://github.com/open-telemetry/opentelemetry-demo/pull/1151))
* [opensearch] Add Grafana dashboard panels for OpenSearch log data
([#1193](https://github.com/open-telemetry/opentelemetry-demo/pull/1193))
* [go-sdk] Workaround: disable gRPC metrics in Go services
([#1205](https://github.com/open-telemetry/opentelemetry-demo/pull/1205))

## 1.5.0

Expand Down
5 changes: 5 additions & 0 deletions src/checkoutservice/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"context"
"encoding/json"
"fmt"
"go.opentelemetry.io/otel/sdk/instrumentation"
semconv "go.opentelemetry.io/otel/semconv/v1.19.0"
"net"
"net/http"
Expand Down Expand Up @@ -110,6 +111,10 @@ func initMeterProvider() *sdkmetric.MeterProvider {
mp := sdkmetric.NewMeterProvider(
sdkmetric.WithReader(sdkmetric.NewPeriodicReader(exporter)),
sdkmetric.WithResource(initResource()),
sdkmetric.WithView(sdkmetric.NewView(
sdkmetric.Instrument{Scope: instrumentation.Scope{Name: "go.opentelemetry.io/contrib/google.golang.org/grpc/otelgrpc"}},
sdkmetric.Stream{Aggregation: sdkmetric.AggregationDrop{}},
)),
)
otel.SetMeterProvider(mp)
return mp
Expand Down
44 changes: 21 additions & 23 deletions src/productcatalogservice/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,37 @@ go 1.17
require (
github.com/golang/protobuf v1.5.3
github.com/sirupsen/logrus v1.9.3
golang.org/x/net v0.11.0 // indirect
google.golang.org/grpc v1.56.1
golang.org/x/net v0.17.0 // indirect
google.golang.org/grpc v1.59.0
)

require (
go.opentelemetry.io/contrib/instrumentation/runtime v0.42.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.39.0
go.opentelemetry.io/otel/sdk v1.16.0
go.opentelemetry.io/otel/sdk/metric v0.39.0
go.opentelemetry.io/otel/trace v1.16.0
go.opentelemetry.io/contrib/instrumentation/runtime v0.45.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.42.0
go.opentelemetry.io/otel/sdk v1.19.0
go.opentelemetry.io/otel/sdk/metric v1.19.0
go.opentelemetry.io/otel/trace v1.19.0
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0
google.golang.org/protobuf v1.30.0
google.golang.org/protobuf v1.31.0
)

require (
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.16.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.39.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.16.0 // indirect
go.opentelemetry.io/otel/metric v1.16.0 // indirect
go.opentelemetry.io/proto/otlp v0.20.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.42.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 // indirect
go.opentelemetry.io/otel/metric v1.19.0 // indirect
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
)

require (
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.42.0
go.opentelemetry.io/otel v1.16.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.16.0
golang.org/x/sys v0.9.0 // indirect
golang.org/x/text v0.10.0 // indirect
google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.45.0
go.opentelemetry.io/otel v1.19.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
)
Loading

0 comments on commit 526a8d3

Please sign in to comment.