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

Header support for json_array_parser #30814

Merged
merged 3 commits into from
Jan 31, 2024

Conversation

RoeiDimi
Copy link
Contributor

@RoeiDimi RoeiDimi commented Jan 28, 2024

Description:

Adding a feature following #30644.
This feature allow json_array_parser parser to accept a comma-delimited header and for every json array it parses, output a map which contains the header fileds as keys and the matching values are the ones parsed from the input json array.

This feature as added mainly for performance reasons as from a functional POV, this is mostly similar to chaining the 2 operators: json_array_parser -> assign_keys
Link to tracking Issue:
#30321
Testing:

  • unittests
  • End to end tests
    Used generated traffic on a running otel collector thats using the parser and verified the data is as expected in the end table and performance looks good

Documentation:

@RoeiDimi RoeiDimi requested a review from djaglowski as a code owner January 28, 2024 11:24
@RoeiDimi RoeiDimi requested a review from a team January 28, 2024 11:24
@djaglowski djaglowski merged commit f70c8a3 into open-telemetry:main Jan 31, 2024
85 checks passed
@github-actions github-actions bot added this to the next release milestone Jan 31, 2024
cparkins pushed a commit to AmadeusITGroup/opentelemetry-collector-contrib that referenced this pull request Feb 1, 2024
**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
Adding a feature following
open-telemetry#30644.
This feature allow json_array_parser parser to accept a comma-delimited
header and for every json array it parses, output a map which contains
the header fileds as keys and the matching values are the ones parsed
from the input json array.

This feature as added mainly for performance reasons as from a
functional POV, this is mostly similar to chaining the 2 operators:
`json_array_parser -> assign_keys `
**Link to tracking Issue:** <Issue number if applicable>

open-telemetry#30321
**Testing:** <Describe what testing was performed and which tests were
added.>

- unittests
- End to end tests
Used generated traffic on a running otel collector thats using the
parser and verified the data is as expected in the end table and
performance looks good

**Documentation:** <Describe the documentation added.>

-
[json_array_parser.md](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/58cc91ca30eabbd35c074d79db8630fc474164d9/pkg/stanza/docs/operators/json_array_parser.md)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants