Skip to content

Conversation

jsvd
Copy link
Contributor

@jsvd jsvd commented Oct 13, 2025

Description

Introduce a common utility to check for the expected type and returns a consistent error message.
Also applies the use of this utility to ctxscope, ctxlog and ctxmetric.

Link to tracking issue

Fixes #40198

Testing

Adds testing for the new utility, will address any tests whose behavior is changed by this propagation of error that didn't exist before.

TODO

As it is now, the PR changes some but not all setters, I can either apply them all here or create a followup PR with more refactorings.

Alternate designs

Introducing a new helper in ctxerror was considered but it can be done at a later stage, as it requires consensus on the set of metadata that such helper would require or optional (e.g. context name, path segment).

@jsvd jsvd changed the title first attempt fix(ctxutil): enforce valid types for setters in contexts Oct 13, 2025
@jsvd jsvd force-pushed the fix_40198_simple branch from cb432ea to 34947d7 Compare October 16, 2025 09:00
@jsvd jsvd changed the title fix(ctxutil): enforce valid types for setters in contexts fix(ottl): enforce valid types for setters in contexts Oct 16, 2025
@jsvd jsvd marked this pull request as ready for review October 16, 2025 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[pkg/ottl] OTTL contexts paths are ignoring failed setters executions

2 participants