-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Allow to manage errors that occur in the apply function #8401
Conversation
I like where you're going with this. I'm guessing in this case you specifically don't want the error to prevent the metric from being parsed? or are you just trying to make the error visible? |
I would answer both, I want to have the full control if an error occurs. But initially my use case was indeed to ensure that the metric is processed in case of an error. With the current code, if you have an error, the metric is lost while I would like to keep it and add the error message to it. |
I agree the user should have full control over what happens. I was thinking there should be some logging primitives, too, to tie into the Telegraf logger. something like I'd also like the ability to explicitly return an error. I believe starlark has a built-in |
Have any interest in adding the other functions I mentioned in another PR? I've got a list of outstanding starlark issues here, and I'd be more than happy for the assistance. area/starlark |
also feel free to join the #Telegraf channel on InfluxData slack, and consider writing starlark-based tests in the future as they get executed and double as documentation |
Thanks for proposing, yes I'm interested in helping you if I can. I will try to propose a PR asap for the logging, I guess it is #8402 |
feel free to add to that issue. it's mostly just a placeholder to attach work and descriptions to later. |
(cherry picked from commit ca04106)
Required for all PRs:
Fix for #8354
Motivation
There is no way to manage error returned in the apply function.
Modifications:
catch
based on the function of the same name ofstarlarktest
README.md
to describe how to use it