I have a working Hyperledger Fabric network, v2.2.2; open telemetry 1.33.0 for Java running on a Spring client application with Hyperledger-Fabric-SDK (v2.2.9) for Java that connects to the Fabric network. Working ok.
Anyway I get this recurring error in my logs... (1 entry every minute):
2024-02-08T15:05:57.491+01:00 WARN 1 --- [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
How can I solve it? I can't find any conclusive document about this on Fabric docs. Thanks.
You should be able to disable the OpenTelemetry agent in the client application by setting the environment variable
OTEL_SDK_DISABLED=true.See the OpenTelemetry documentation for details:
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md
Note that the Fabric Gateway client API for Hyperledger Fabric v2.4, which supersedes the legacy Java SDK, does not have OpenTelemetry baked in. Instead, this API gives your application code control of the gRPC connection, and you can attach an OpenTelemetry interceptor to that gRPC connection (only) if required.