open-telemetry / open-telemetry/opentelemetry-cpp

Add JSON formatting to OStreamExporters

Open
#202 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:exporter do-not-stale enhancement
Dominant language
C++
Stars
1.4k
Forks
632
Avg merge
1d 13h
Merged PRs (30d)
75

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the OStreamExporters introduced or discussed in pull requests 218 and 183, then read their constructors and export() implementations. Confirm how the requested boolean should select human-readable versus JSON output, and define completion as both exporters producing valid output in the selected format, with coverage for the new behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
observability-sre
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.