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

Support Integer Attributes in the telemetrygen tool #38392

Closed
feltrin-cgn opened this issue Mar 5, 2025 · 4 comments
Closed

Support Integer Attributes in the telemetrygen tool #38392

feltrin-cgn opened this issue Mar 5, 2025 · 4 comments
Labels
cmd/telemetrygen telemetrygen command enhancement New feature or request

Comments

@feltrin-cgn
Copy link

Component(s)

cmd/telemetrygen

Is your feature request related to a problem? Please describe.

The telemetrygen tool currently requires all telemetry attribute values to be strings wrapped in double quotes. This limitation makes it difficult to generate traces with integer attributes, which are often needed for realistic testing and development scenarios.

Describe the solution you'd like

Introduce support for integer attributes in the telemetrygen tool. The basic idea is to extend the existing attribute handling to recognize and correctly process integer values. The same --telemetry-attributes flag should be supported for backwards compatibility, but now values that are not quoted and are valid integers should be treated as integer attributes.

Describe alternatives you've considered

An alternative approach could be to introduce different flags for attributes of differing types, such as --telemetry-attributes-int for integer attributes.

Additional context

realistic spans:

server.port 8000
http.response.status_code 404

telemetrygen simulated spans:

server.port "8000"
http.response.status_code "404"
@feltrin-cgn feltrin-cgn added enhancement New feature or request needs triage New item requiring triage labels Mar 5, 2025
@github-actions github-actions bot added the cmd/telemetrygen telemetrygen command label Mar 5, 2025
Copy link
Contributor

github-actions bot commented Mar 5, 2025

Pinging code owners:

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

@mx-psi
Copy link
Member

mx-psi commented Mar 5, 2025

I support this

@codeboten
Copy link
Contributor

Thanks for the suggestion @feltrin-cgn! Is this something you would have time to submit a PR for?

giacomofeltrin added a commit to giacomofeltrin/opentelemetry-collector-contrib that referenced this issue Mar 6, 2025
giacomofeltrin added a commit to giacomofeltrin/opentelemetry-collector-contrib that referenced this issue Mar 6, 2025
atoulme pushed a commit that referenced this issue Mar 7, 2025
#38410)

…#38392)

**Description**  
Introduced support for integer attributes in the `telemetrygen` tool.
Previously, the tool required all telemetry attribute values to be
strings wrapped in double quotes, which limited the ability to generate
realistic test data with integer values. This change extends the
existing attribute handling to correctly process integer values. The
`--telemetry-attributes` flag now supports both quoted string values and
unquoted integer values.

**Link to tracking issue**  
Fixes
[[#38392](#38392)]

**Documentation**  
Updated documentation for the `--telemetry-attributes` flag to reflect
the new support for integer attributes and provide examples of both
string and integer usage.

---------

Co-authored-by: Andrzej Stencel <andrzej.stencel@elastic.co>
@atoulme
Copy link
Contributor

atoulme commented Mar 8, 2025

Done with #38410

@atoulme atoulme closed this as completed Mar 8, 2025
@atoulme atoulme removed the needs triage New item requiring triage label Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmd/telemetrygen telemetrygen command enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants