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/ottl] Add a String method to the Path interface #29922

Closed
evan-bradley opened this issue Dec 15, 2023 · 1 comment · Fixed by #31233
Closed

[pkg/ottl] Add a String method to the Path interface #29922

evan-bradley opened this issue Dec 15, 2023 · 1 comment · Fixed by #31233

Comments

@evan-bradley
Copy link
Contributor

Make a Path.String method that converts the Path back into the string representation (e.g. context.specific.path). This will make error messages clearer.

Originally posted by @evan-bradley in #29897 (comment)

Copy link
Contributor

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.

@github-actions github-actions bot added the Stale label Feb 14, 2024
evan-bradley added a commit that referenced this issue Feb 23, 2024
**Description:**
Improve OTTL context error messages when an unknown path is used.

The new error message will look like:

```
Error: invalid configuration: processors::transform: unable to parse OTTL statement "set(attributes[\"test\"], trace_id.hex)": error while parsing arguments for call to "set": invalid argument at position 1: trace_id.hex is not a valid path for the Span context - review https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/pkg/ottl/contexts/ottlspan to see all valid paths
```

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

Related to
#29871
Closes
#29922

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

Unit tests

---------

Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
XinRanZhAWS pushed a commit to XinRanZhAWS/opentelemetry-collector-contrib that referenced this issue Mar 13, 2024
**Description:**
Improve OTTL context error messages when an unknown path is used.

The new error message will look like:

```
Error: invalid configuration: processors::transform: unable to parse OTTL statement "set(attributes[\"test\"], trace_id.hex)": error while parsing arguments for call to "set": invalid argument at position 1: trace_id.hex is not a valid path for the Span context - review https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/pkg/ottl/contexts/ottlspan to see all valid paths
```

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

Related to
open-telemetry#29871
Closes
open-telemetry#29922

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

Unit tests

---------

Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants