Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to see the metrics of port 4317 #3652

Open
siddhant16 opened this issue Feb 18, 2025 · 1 comment
Open

Not able to see the metrics of port 4317 #3652

siddhant16 opened this issue Feb 18, 2025 · 1 comment
Assignees
Labels
api: spanner Issues related to the googleapis/java-spanner API.

Comments

@siddhant16
Copy link

Hi Team,

I'm creating the SdkMeterProvider like below (referred from UserGuide)

SdkMeterProvider sdkMeterProvider = SdkMeterProvider.builder()
// Use Otlp exporter or any other exporter of your choice.
  .registerMetricReader(PeriodicMetricReader.builder(OtlpGrpcMetricExporter.builder().build())
  .build())
  .build();

I'm able to create the spanner instance and my application is getting started, However, I do not see metrics on the default endpoint. When I run my application I see below log

2025-02-18T09:40:02.473-08:00  WARN 30365 --- [alhost:4317/...] i.o.exporter.internal.grpc.GrpcExporter  : Failed to export metrics. Server responded with gRPC status code 2. Error message: Failed to connect to localhost/[0:0:0:0:0:0:0:1]:4317

The error message indicates that the OTLP GRPC Metric Exporter is unable to connect to the OpenTelemetry Collector on localhost:4317. This is the default port used by the OpenTelemetry Collector to receive metrics.

Is there any additional setting that I need to add so that the metrics would be exported correctly? I'm able to view the metrics when I use the Prometheus Exporter.

@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/java-spanner API. label Feb 18, 2025
@surbhigarg92
Copy link
Contributor

@siddhant16 This code is expecting OpenTelemetry collector to be run on your local machine at 4317 port or modify it to point to the right Collector endpoint of you have it running elsewhere.

Please refer to OpenTelemetry Collector on how to configure and run the collector.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/java-spanner API.
Projects
None yet
Development

No branches or pull requests

3 participants