-
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
"panic: negative refcount" when mutating tags in starlark for metrics from a tail input #14484
Comments
Thanks for the issue and confirmed I see the same.
This only affects plugins that use tracking metrics, which are used to call back to the input that the metric was delivered and the input plugin can consume more metrics. Plugins like tail, mqtt, rabbitmq, etc. There have been a stream of issues around tracking metrics and starlark and we have tried to ensure we could continue tracking metrics even after they leave the starlark processor. This means we have to analyze what starlark returns and attempt to determine if the original metric was returned with no changes. One thought was to mark everything as accepted once it hits the starlark plugin to avoid this analysis, similar to the execd processor. In this case, you make a change to it, so we mark the metric as accepted since the original metric was not returned. However, this results in the output also marking the same metric accepted twice, hence the panic. The use of deepcopy is a workaround for now, except it comes at a cost of time, needing to copy the entire metric. edit: we will jump on this in the new year. |
Thanks @powersj this is all useful information. We'll use |
@paulbrimicombe can you please test the binary in PR #14523 and let me know if this fixes the issue!?! |
@srebhan I've just tested this and it's definitely fixed our tag mutation issue (there are no panics and the published metrics have the correct tags after the starlark processing). Any idea when this might be released please? |
Monday! |
Relevant telegraf.conf
Logs from Telegraf
System info
Telegraf >= 1.29.0
Docker
Here is a minimal way to reproduce the error:
docker-compose.yaml
./telegraf.conf
is the configuration file posted above./postprocess.star
./something.log
should start as an empty fileSteps to reproduce
Run the the above setup with
docker compose up
Write to
something.log
using something likeYou'll see the output of the
print
line in thestarlark
showing the metric being processedWait until the metrics are flushed to the output — at that point you'll get a
panic: negative refcount
message and the docker container will exitExpected behavior
starlark
processorActual behavior
starlark
Additional info
image
tag in thedocker-compose.yaml
file shown above)tail
inputs —file
inputs don't suffer from the same issueThe text was updated successfully, but these errors were encountered: