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

mockotlpserver: compare JSON serialization form to OTel Java's "Logging OTLP JSON exporter" #331

Open
trentm opened this issue Aug 12, 2024 · 2 comments

Comments

@trentm
Copy link
Member

trentm commented Aug 12, 2024

https://opentelemetry.io/docs/languages/java/configuration/#logging-otlp-json-exporter

In mockotlpserver, some serialization decisions were made the object form of an OTLP http/json service request. That form is used in our tests, and also in some OTel JS contrib repo tests via the runTestFixture facility we added in the contrib-test-utils package. I'm curious if/how this form differs from the serialization form used by the OTel Java otlp-json exporter -- an experimental exporter for dev/debugging. If there are differences, it might be good to align.

This is low prio.

@trentm
Copy link
Member Author

trentm commented Aug 12, 2024

An example of the output, I think:

[otel.javaagent 2024-07-02 10:11:07:368 +0000] [BatchLogRecordProcessor_WorkerThread-1] INFO io.opentelemetry.exporter.logging.otlp.OtlpJsonLoggingLogRecordExporter - {"resource":{"attributes":[{"key":"container.id","value":{"stringValue":"075da3b7317ceccd6df58562684a8092040aacca8b5b0c49eacb33f1d2fe15b9"}},{"key":"deployment.environment","value":{"stringValue":"staging"}},{"key":"host.arch","value":{"stringValue":"amd64"}},{"key":"host.name","value":{"stringValue":"anti-fraud-7b498c4dcb-f5wqj"}},{"key":"os.description","value":{"stringValue":"Linux 6.5.0-41-generic"}},{"key":"os.type","value":{"stringValue":"linux"}},{"key":"process.command_args","value":{"arrayValue":{"values":[{"stringValue":"/opt/java/openjdk/bin/java"},{"stringValue":"-jar"},{"stringValue":"./app.jar"}]}}},{"key":"process.executable.path","value":{"stringValue":"/opt/java/openjdk/bin/java"}},{"key":"process.pid","value":{"intValue":"1"}},{"key":"process.runtime.description","value":{"stringValue":"Eclipse Adoptium OpenJDK 64-Bit Server VM 21.0.3+9-LTS"}},{"key":"process.runtime.name","value":{"stringValue":"OpenJDK Runtime Environment"}},{"key":"process.runtime.version","value":{"stringValue":"21.0.3+9-LTS"}},{"key":"service.instance.id","value":{"stringValue":"7e31966b-5668-4338-913a-5e2601d75e25"}},{"key":"service.name","value":{"stringValue":"anti-fraud"}},{"key":"service.namespace","value":{"stringValue":"shop"}},{"key":"service.version","value":{"stringValue":"1.1"}},{"key":"telemetry.distro.name","value":{"stringValue":"grafana-opentelemetry-java"}},{"key":"telemetry.distro.version","value":{"stringValue":"2.4.0-beta.1"}},{"key":"telemetry.sdk.language","value":{"stringValue":"java"}},{"key":"telemetry.sdk.name","value":{"stringValue":"opentelemetry"}},{"key":"telemetry.sdk.version","value":{"stringValue":"1.38.0"}}]},"scopeLogs":[{"scope":{"name":"com.mycompany.antifraud.FraudDetectionController","attributes":[]},"logRecords":[{"timeUnixNano":"1719915066488000000","observedTimeUnixNano":"1719915066488267425","severityNumber":13,"severityText":"WARN","body":{"stringValue":"checkOrder(totalPrice=300, shippingCountry=, customerIpAddress=127.0.0.1) fraudScore=15, status=REJECTED"},"attributes":[{"key":"thread.id","value":{"intValue":"44"}},{"key":"thread.name","value":{"stringValue":"http-nio-8080-exec-1"}}],"flags":1,"traceId":"336f93f9f72b9fec3e4e01e38cb6a99c","spanId":"de97c85b1ee0669a"}]}]}

This is from open-telemetry/opentelemetry-collector-contrib#33846

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant