open-telemetry / opentelemetry-proto

OpenTelemetry protocol (OTLP) specification and Protobuf definitions
https://opentelemetry.io/docs/specs/otlp/
Apache License 2.0
576 stars 253 forks source link

Add OTLP JSON payload examples #463

Closed joaopgrassi closed 1 year ago

joaopgrassi commented 1 year ago

Fixes #462

I was not sure where to add the files, so I just went with some initial idea. I'm open to suggestions on where to put them/refer to them.

I tested it with a local collector and all works.

cc @tigrannajaryan

tigrannajaryan commented 1 year ago

Yes more checks would be useful. Related: we have a PR coming that adds link checking: https://github.com/open-telemetry/opentelemetry-proto/pull/459

joaopgrassi commented 1 year ago

I was also thinking if we shouldn't publish a json schema for OTLP. That way the guess work of writing OTLP JSON is removed and we could also check it against the schema in a gh action. I saw some tool to generate JSON schema from proto files but didn't have time to check. If you think it's valid, I can create issues and maybe work on it.

tigrannajaryan commented 1 year ago

I was also thinking if we shouldn't publish a json schema for OTLP. That way the guess work of writing OTLP JSON is removed and we could also check it against the schema in a gh action. I saw some tool to generate JSON schema from proto files but didn't have time to check. If you think it's valid, I can create issues and maybe work on it.

I would not want to maintain another schema definition. The Protobuf definitions are the source of truth. If we could generate JSON schema from Protobufs that would be great.

tigrannajaryan commented 1 year ago

Merging. @joaopgrassi it would be great if you could follow up with a PR to add JSON checks.

joaopgrassi commented 1 year ago

Will do!

chalin commented 1 year ago

Hi all, I've posted a suggestion to:

Comments are welcome.