Skip to content

Commit

Permalink
Disable client side gRPC metrics (#703)
Browse files Browse the repository at this point in the history
Seems there is no need for the client side metrics. Cloud Run gives us a pretty good server side observability.

Plus included architecture in attributes to distinguish vetu hosts.
  • Loading branch information
fkorotkov authored Mar 26, 2024
1 parent 1b4629b commit 4911a08
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 5 additions & 1 deletion internal/opentelemetry/opentelemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
sdktrace "go.opentelemetry.io/otel/sdk/trace"
semconv "go.opentelemetry.io/otel/semconv/v1.24.0"
"os"
"runtime"
)

func Init(ctx context.Context) (func(), error) {
Expand All @@ -31,8 +32,11 @@ func Init(ctx context.Context) (func(), error) {

customResource, err := resource.New(ctx,
resource.WithSchemaURL(semconv.SchemaURL),
resource.WithHost(),
resource.WithOSType(),
resource.WithHost(),
resource.WithAttributes(
semconv.HostArchKey.String(runtime.GOARCH),
),
resource.WithAttributes(
semconv.ServiceName("cirrus-cli"),
semconv.ServiceVersion(version.Version),
Expand Down
5 changes: 0 additions & 5 deletions internal/worker/upstream/upstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import (
"github.com/cirruslabs/cirrus-ci-agent/pkg/grpchelper"
"github.com/cirruslabs/cirrus-cli/internal/executor/endpoint"
"github.com/sirupsen/logrus"
"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
"go.opentelemetry.io/otel/metric/noop"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/credentials/insecure"
Expand Down Expand Up @@ -122,9 +120,6 @@ func (upstream *Upstream) Connect(ctx context.Context) error {
// https://github.com/grpc/grpc-go/blob/master/Documentation/concurrency.md
conn, err := grpc.DialContext(ctx, upstream.rpcTarget, rpcSecurity,
grpc.WithUnaryInterceptor(deadlineUnaryInterceptor(defaultDeadlineInSeconds*time.Second)),
grpc.WithStatsHandler(otelgrpc.NewClientHandler(
otelgrpc.WithMeterProvider(noop.NewMeterProvider()),
)),
)
if err != nil {
return fmt.Errorf("%w: failed to dial upstream %s: %v",
Expand Down

0 comments on commit 4911a08

Please sign in to comment.