opentelemetry-cpp icon indicating copy to clipboard operation
opentelemetry-cpp copied to clipboard

Add JSON formatting to OStreamExporters

Open HudsonHumphries opened this issue 5 years ago • 6 comments

Is your feature request related to a problem? There is currently no way for the user to change the format that OStreamExporters export the data. If the user wants to send their data directly to a json file, it will not be in the correct format.

Describe the solution you'd like Have the user pass in a boolean for json printing in the constructor. Then in export() format the data what the user has specified. Since the user won't directly call export() it makes sense to pass the boolean in the constructor.

Describe alternatives you've considered An alternative is to support json formatting as the default and only printing. This doesn't seem ideal as most users will only print to stdout and will have a harder time reading the output.

Additional context The two exporters are 218 and 183

HudsonHumphries avatar Jul 22 '20 19:07 HudsonHumphries

This issue was marked as stale due to lack of activity. It will be closed in 7 days if no furthur activity occurs.

github-actions[bot] avatar Nov 30 '21 01:11 github-actions[bot]

I started working on this in #1111.

deejgregor avatar Dec 03 '21 17:12 deejgregor

This issue was marked as stale due to lack of activity. It will be closed in 7 days if no furthur activity occurs.

github-actions[bot] avatar Feb 02 '22 01:02 github-actions[bot]

Closed as inactive. Feel free to reopen if this is still an issue.

github-actions[bot] avatar Feb 09 '22 01:02 github-actions[bot]

Does Otel support the JSON output now? @lalitb @deejgregor Thanks.

yinfangchen avatar Jan 06 '24 22:01 yinfangchen

Does Otel support the JSON output now? @lalitb @deejgregor Thanks.

Not yet, I create #2482 to track this.

owent avatar Jan 10 '24 03:01 owent