-
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
Support logging in starlark #8408
Conversation
While your changes look good, I'm a bit hesitant to add this to to telegraf as IMO this should really go to starlark itself. Otherwise we are basically forking starlark... I've e.g. some time/duration module in the pipe and could also add this, but this means that we bloat telegraf by stuff that actually belongs to starlark. |
@srebhan This is what I was expecting. I don't see anything specific to logging in Starlark, and even so it'd need some tie in to our logger. This does sort of bring us to a situation where we have a sort of sub-dialect of Starlark, but I don't necessarily see that as a problem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great.
@ssoroka: Well you could easily define an interface for the logger and allow to specify this when initializing the logging module... IF we want to go the route of adding all that stuff from InfluxData side, we should actually fork starklark and add all that modules in the fork. This way we will not clutter this plugin. In the end, the real problem is where to stop. I've a date/time/duration module, someone else will come up with a math module and the next guy submits a timeseries prediction... Where do you cut this? Again, using those modules in this plugin is not my concern, just plugging more and more stuff in here... @essobedo this is no objection to your code (quite the contrary), IMO we need to get this straight now as otherwise it is hard to stop somewhere. |
Going to merge and then pull out the module to https://github.com/influxdata/starlark-go-modules afterwards. Thanks for the PR @essobedo ❤️ |
@ssoroka Is there any issue you want me to look at in particular? |
@essobedo find me on the community slack for detailed conversation... but maybe you could post your ideas on #8371 and start thinking about that. Possible options are multiple return values, or maybe if there are problems with that an exposed method to add new metrics. |
(cherry picked from commit 0c15569)
Required for all PRs:
Fix for #8402
Motivation
Logging primitives to tie into the Telegraf logger are missing
Modifications: