Skip to content

Commit

Permalink
Allow uploading JSON-per-line OTLP data (#2380)
Browse files Browse the repository at this point in the history
OpenTelemetry specifies that JSON line files can contain valid JSON
objects which are seperated with a newline character. The existing
readJsonFile function couldn't handle those instances, this PR fixes
that, along with test cases to verify.

## Which problem is this PR solving?
Resolves #2225 

## Description of the changes
A new try catch block was inserted, for files that weren't parsed by the
usual JSON.parse, would be parsed by the catch block assuming the
objects are seperated by newline (which is mentioned in opentelemetry)

## How was this change tested?
Test cases, and manual testing

## Checklist
- [ X ] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [ X ] I have signed all commits
- [ X ] I have added unit tests for the new functionality
- [ X ] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: Muthukumar <muthuku37@gmail.com>
Signed-off-by: Yuri Shkuro <github@ysh.us>
Co-authored-by: Yuri Shkuro <github@ysh.us>
  • Loading branch information
BenzeneAlcohol and yurishkuro committed Jul 17, 2024
1 parent 52a7809 commit 8772ad6
Show file tree
Hide file tree
Showing 5 changed files with 805 additions and 19 deletions.
Loading

0 comments on commit 8772ad6

Please sign in to comment.