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

otlp+json enums should be integers #978

Open
1 of 3 tasks
brettmc opened this issue Apr 19, 2023 · 3 comments
Open
1 of 3 tasks

otlp+json enums should be integers #978

brettmc opened this issue Apr 19, 2023 · 3 comments
Assignees
Labels
blocked this issue is blocked by another issue. pinned Will not be removed by stalebot Work In Progress This is a Work in Progress, not ready to be merged

Comments

@brettmc
Copy link
Collaborator

brettmc commented Apr 19, 2023

The otel collector currently accepts the string values of ENUMs for json-encoded payloads, but this is now prohibited and will likely be removed in a future collector release:

We currently use protobuf's serializeToJsonString() method to generate JSON payloads, which doesn't expose any options to represent enums as their integer values.

Possible solutions:

  • submit an enhancement to protobuf PHP implementations (native + extension) to add/fix/expose the option to represent ENUMs as integers
  • write a custom serializer for JSON

Additional context

Protobuf Ruby seems to support FormatEnumsAsIntegers
There is a partial implementation in the protobuf php extension for FormatEnumsAsIntegers, but it is not exposed via any public interfaces (and not available in the native library)

Tasks:

  • update protobuf to allow enums as int
  • update ProtobufSerializer to send new flag(s)
  • wait for new version of protobuf to release
@brettmc brettmc self-assigned this May 8, 2023
@brettmc
Copy link
Collaborator Author

brettmc commented May 8, 2023

PR against google/protobuf to allow formatting enums as strings for JSON output: protocolbuffers/protobuf#12707

@brettmc brettmc added the Work In Progress This is a Work in Progress, not ready to be merged label May 8, 2023
@brettmc brettmc added the blocked this issue is blocked by another issue. label May 17, 2023
@stale
Copy link

stale bot commented Jun 18, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale This issue didn't have recent activity label Jun 18, 2023
@brettmc brettmc added pinned Will not be removed by stalebot and removed stale This issue didn't have recent activity labels Jun 18, 2023
@brettmc
Copy link
Collaborator Author

brettmc commented Dec 17, 2023

Note that this has been worked around via #1192 until protobuf changes are accepted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked this issue is blocked by another issue. pinned Will not be removed by stalebot Work In Progress This is a Work in Progress, not ready to be merged
Projects
None yet
Development

No branches or pull requests

1 participant