You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Per the docs, setting environment variable OTEL_EXPORTER_OTLP_METRICS_PROTOCOL or setting Java system property to "http/json" is supposed to produce JSON formatted output. However, neither of the settings produce JSON.
Steps to reproduce
Any instrumented program using OtlpHttpMetricExporter.builder()....build() and run with the environment variable or system property set as described. Upon running the output is still binary/protobuf and not JSON. The Content-Type remains application/x-protobuf
What did you see instead?
Output was binary/protobuf format and not JSON. The Content-Type remains application/x-protobuf
What version and what artifacts are you using?
Artifacts: (e.g., opentelemetry-api, opentelemetry-sdk, which exporters, etc)
Version: (e.g., v0.4.0, 1eb551b, etc)
How did you reference these artifacts? (excerpt from your build.gradle, pom.xml, etc)
Environment
Compiler: Azul JDK 8
OS: Mac OS
Runtime (if different from JDK above): (e.g., "Oracle JRE 8u251")
OS (if different from OS compiled on): (e.g., "Windows Server 2019")
SDKs SHOULD support both grpc and http/protobuf transports and MUST support at least one of them. If they support only one, it SHOULD be http/protobuf. They also MAY support http/json.
The Java SDK does not have the JSON exporter implemented. Here's some more history about that: #3651#3486
I'm quite convinced we're not planning to implement it in the future -- ping @jack-berg to confirm.
Describe the bug
Per the docs, setting environment variable OTEL_EXPORTER_OTLP_METRICS_PROTOCOL or setting Java system property to "http/json" is supposed to produce JSON formatted output. However, neither of the settings produce JSON.
https://opentelemetry.io/docs/concepts/sdk-configuration/otlp-exporter-configuration/#otel_exporter_otlp_metrics_protocol
https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md#otlp-exporter-span-metric-and-log-exporters
Steps to reproduce
Any instrumented program using OtlpHttpMetricExporter.builder()....build() and run with the environment variable or system property set as described. Upon running the output is still binary/protobuf and not JSON. The Content-Type remains application/x-protobuf
What did you expect to see?
JSON formatted output. The Content-Type from the client should be "application/json" (https://opentelemetry.io/docs/specs/otlp/#json-protobuf-encoding)
What did you see instead?
Output was binary/protobuf format and not JSON. The Content-Type remains application/x-protobuf
What version and what artifacts are you using?
Artifacts: (e.g.,
opentelemetry-api
,opentelemetry-sdk
, which exporters, etc)Version: (e.g.,
v0.4.0
,1eb551b
, etc)How did you reference these artifacts? (excerpt from your
build.gradle
,pom.xml
, etc)Environment
Compiler: Azul JDK 8
OS: Mac OS
Runtime (if different from JDK above): (e.g., "Oracle JRE 8u251")
OS (if different from OS compiled on): (e.g., "Windows Server 2019")
Additional context
Looking at
opentelemetry-java/exporters/otlp/all/src/main/java/io/opentelemetry/exporter/otlp/http/metrics/OtlpHttpMetricExporterBuilder.java
Line 160 in f20ee6c
there is an exportAsJson(). But, the method is not public. Is it supposed to have been public?
The test class
opentelemetry-java/exporters/otlp/all/src/test/java/io/opentelemetry/exporter/otlp/internal/OtlpMetricExporterProviderTest.java
Line 4 in f20ee6c
also does not have any tests for "http/json", but only for "http/protobuf".
So.. is JSON output supported?
The text was updated successfully, but these errors were encountered: