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

[pkg/stanza] json null value handling #34672

Closed
newly12 opened this issue Aug 14, 2024 · 1 comment · Fixed by #34673
Closed

[pkg/stanza] json null value handling #34672

newly12 opened this issue Aug 14, 2024 · 1 comment · Fixed by #34673
Labels
bug Something isn't working pkg/stanza

Comments

@newly12
Copy link
Contributor

newly12 commented Aug 14, 2024

Component(s)

pkg/stanza

What happened?

Description

json null value handling and processing is incorrect.

Steps to Reproduce

given the input like {"empty": null} and json_parser enabled.

Expected Result

empty type

Actual Result

https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/pkg/stanza/adapter/converter.go#L326

by default given nil it returns fmt.Sprintf("%v", nil), which is "<nil>"(string)

     -> empty: Str(<nil>)

Collector version

latest

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

No response

Log output

No response

Additional context

No response

@newly12 newly12 added bug Something isn't working needs triage New item requiring triage labels Aug 14, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@djaglowski djaglowski removed the needs triage New item requiring triage label Aug 14, 2024
djaglowski pushed a commit that referenced this issue Aug 15, 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.-->

fix nil value conversion

**Link to tracking Issue:** <Issue number if applicable>

Fixes #34672 

**Testing:** <Describe what testing was performed and which tests were
added.>

added.

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

n/a
f7o pushed a commit to f7o/opentelemetry-collector-contrib that referenced this issue Sep 12, 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.-->

fix nil value conversion

**Link to tracking Issue:** <Issue number if applicable>

Fixes open-telemetry#34672 

**Testing:** <Describe what testing was performed and which tests were
added.>

added.

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

n/a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg/stanza
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants