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

[cmd/telemetrygen] Support boolean values in attributes #34558

Merged

Conversation

Frapschen
Copy link
Contributor

Description: Support boolean values in attributes

Link to tracking Issue: Resolves #18928

Testing:

Documentation:

@Frapschen Frapschen requested a review from a team August 9, 2024 09:16
@github-actions github-actions bot added the cmd/telemetrygen telemetrygen command label Aug 9, 2024
@@ -36,6 +37,12 @@ func (v *KeyValue) Set(s string) error {
return errFormatOTLPAttributes
}
val := kv[1]
parsedBool, err := strconv.ParseBool(val)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This accepts also 0 and 1, which is ambiguous (I would expect if I set an attribute to 1 it would be set to the integer 1, not the boolean value true). Could we just parse true and false? Or explicitly exclude 0 and 1

@Frapschen Frapschen requested a review from mx-psi August 9, 2024 09:58
Copy link
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!!

@mx-psi mx-psi merged commit 148f5e3 into open-telemetry:main Aug 9, 2024
154 checks passed
@github-actions github-actions bot added this to the next release milestone Aug 9, 2024
@Frapschen Frapschen deleted the telemetrygen-attribute-support-boolean branch August 9, 2024 10:56
f7o pushed a commit to f7o/opentelemetry-collector-contrib that referenced this pull request Sep 12, 2024
…ry#34558)

**Description:** Support boolean values in attributes


**Link to tracking Issue:** Resolves
open-telemetry#18928

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

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

---------

Signed-off-by: Murphy Chen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmd/telemetrygen telemetrygen command
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support BooleanAttributes in the telemetrygen tool
3 participants