Suppression of warning log in `extractErrorStatus` in HttpExporter.java
Our collector service does not support grpc responses. Hence, we send back JSON to the library and any failed requests are handled at the custom exporter level where the exception is available in the CompleteableResultCode object.
This works, however, in the extractErrorStatus method, we constantly see the warning log - Unable to parse response body, HTTP status message: + statusMessage. I want to ask how can we suppress this?
Looking at the code, I see that we need to send some kind of byte-encoded response but does it require any specific format?
The code is expecting a gRPC response. To avoid the warning, you could send a static gPRC response that says "gRPC not supported".
Are you trying to use io.opentelemetry.exporter.internal.http.HttpExporter with a custom sender? If you have a fully custom exporter implementation, you should never run into any code in HttpExporter, which is internal and not really meant to be used outside of the project itself (hence the marking as "internal").
The code is expecting a gRPC response. To avoid the warning, you could send a static gPRC response that says "gRPC not supported".
But our server can only respond in json as grpc is not supported there. With json responses, the code flow still works, but we see the warning log
Are you trying to use io.opentelemetry.exporter.internal.http.HttpExporter with a custom sender? If you have a fully custom exporter implementation, you should never run into any code in HttpExporter, which is internal and not really meant to be used outside of the project itself (hence the marking as "internal").
We have a batching logic implemented on top of the otlp exporter.. and we retry failed messages based on status codes received from the server. The problem is, that the export and retry works but there is a warning log. Is there any way to suppress this log?
Are you trying to use io.opentelemetry.exporter.internal.http.HttpExporter with a custom sender? If you have a fully custom exporter implementation, you should never run into any code in HttpExporter, which is internal and not really meant to be used outside of the project itself (hence the marking as "internal").
We have a batching logic implemented on top of the otlp exporter.. and we retry failed messages based on status codes received from the server. The problem is, that the export and retry works but there is a warning log. Is there any way to suppress this log?
Currently, no.
@prasadw OpenTelemetry SDK uses java.util.logging, I think you can suppress it through java.util.logging configuration (or if you are using a different logging framework you can pipe java.util.logging to that framework and suppress it there)
@prasadw OpenTelemetry SDK uses java.util.logging, I think you can suppress it through java.util.logging configuration (or if you are using a different logging framework you can pipe java.util.logging to that framework and suppress it there)
Applying filters to the java.util.logger in our application did not work as the same filters were not applied to the opentelemetry loggers
Are you trying to use io.opentelemetry.exporter.internal.http.HttpExporter with a custom sender? If you have a fully custom exporter implementation, you should never run into any code in HttpExporter, which is internal and not really meant to be used outside of the project itself (hence the marking as "internal").
We have a batching logic implemented on top of the otlp exporter.. and we retry failed messages based on status codes received from the server. The problem is, that the export and retry works but there is a warning log. Is there any way to suppress this log?
Currently, no.
Can we raise this as a feature request then? For an environment variable or configuration option to suppress warning logs originating only from the OpenTelemetry SDK. Currently, we can’t adjust the log level at the application level to exclude warnings, since that would also suppress warning logs from our own application code.
Can we raise this as a feature request then?
A PR would be welcome 😄
For an environment variable
new env vars are not added - but declarative configuration can be used: https://opentelemetry.io/docs/languages/sdk-configuration/declarative-configuration/
Applying filters to the java.util.logger in our application did not work as the same filters were not applied to the opentelemetry loggers
hi @hsraps, can you explain why this doesn't work for you, since this is the standard solution for reducing log severity (as opposed to adding env vars around each individual logging statement)
e.g. either programmatically at startup:
Logger.getLogger("io.opentelemetry.exporter.internal.http.HttpExporter")
.setLevel(Level.SEVERE);
or via logging.properties, e.g.
# Suppress HttpExporter warnings - only show SEVERE and above
io.opentelemetry.exporter.internal.http.HttpExporter.level = SEVERE
and
java -Djava.util.logging.config.file=/path/to/logging.properties YourApp