Skip to content

[processor/transform] Add ability to add element in array #37672

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

Closed
adelbot opened this issue Feb 4, 2025 · 4 comments
Closed

[processor/transform] Add ability to add element in array #37672

adelbot opened this issue Feb 4, 2025 · 4 comments
Labels
enhancement New feature or request needs triage New item requiring triage processor/transform Transform processor Stale

Comments

@adelbot
Copy link

adelbot commented Feb 4, 2025

Component(s)

No response

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

I use an attributes that it is an array.
The collector receive this attributes and i must add a new element into.

The transform with "set" update this attributes.
The insert seem not exist

Describe the solution you'd like

Before

scope = ["aaa"]

transform/scope:
error_mode: ignore
trace_statements:
- context: resource
statements:
- insert(attributes["scope"], ["xxx"] )

After

scope = [ "aaa","xxx"]

Describe alternatives you've considered

No response

Additional context

No response

@adelbot adelbot added enhancement New feature or request needs triage New item requiring triage labels Feb 4, 2025
@github-actions github-actions bot added the processor/transform Transform processor label Feb 4, 2025
Copy link
Contributor

github-actions bot commented Feb 4, 2025

Pinging code owners:

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

@edmocosta
Copy link
Contributor

edmocosta commented Feb 4, 2025

Hi @adelbot! I think the append function would work for your use case:

trace_statements:
 - context: resource
   statements:
    - append(attributes["scope"], "xxx") # single value
    - append(attributes["scope"], values = ["aaaa", "bbb"]) # multiple values

Copy link
Contributor

github-actions bot commented Apr 7, 2025

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

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

@atoulme
Copy link
Contributor

atoulme commented Apr 20, 2025

Closing as unplanned, see suggestion for resolution.

@atoulme atoulme closed this as not planned Won't fix, can't repro, duplicate, stale Apr 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage New item requiring triage processor/transform Transform processor Stale
Projects
None yet
Development

No branches or pull requests

3 participants