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

starlark with aggregation trigger goroutine panic #7851

Closed
philographer opened this issue Jul 17, 2020 · 1 comment · Fixed by #7853
Closed

starlark with aggregation trigger goroutine panic #7851

philographer opened this issue Jul 17, 2020 · 1 comment · Fixed by #7853
Assignees
Labels
bug unexpected problem or unintended behavior
Milestone

Comments

@philographer
Copy link

Relevant telegraf.conf:

  • telegraf.conf
[agent]

[[inputs.file]]
  files = ["metrics_in_1.json"]
  data_format = "json"
  json_time_format = "unix"

[[processors.starlark]]
  order = 1
  source = '''
def apply(metric):
  metric.fields["delay"] = int(metric.time / 1000000000) - (metric.fields["time"] / 1000)
  metric.fields.pop("time")
  metric.fields.pop("timeout")
  return metric
'''

[[aggregators.minmax]]
  period = "60s"
  drop_original = true

[[outputs.file]]
  files = ["stdout", "metrics_delay_max.out"]
  • metrics_in_1.json
{"time": 1594971809000, "timeout": 100}

System info:

  • Telegraf Version: telegraf-1.15.0~rc3
  • Operating System: Mac OS 10.15.5 (19F101)

Docker

  • X

Steps to reproduce:

  • $ telegraf --config telegraf.conf

Expected behavior:

  • processor: starlark + aggregator: minmax => Aggregation Success

Actual behavior:

  • Error msg
2020-07-17T07:52:40Z D! [aggregators.minmax] Updated aggregation range [2020-07-17 16:52:40 +0900 KST, 2020-07-17 16:52:50 +0900 KST]
panic: runtime error: index out of range [0] with length 0

goroutine 12 [running]:
github.com/influxdata/telegraf/plugins/processors/starlark.(*Starlark).Add(0xc0005d5c00, 0x2f58260, 0xc0008ce380, 0x2f49200, 0xc00020a060, 0x0, 0x0)
/go/src/github.com/influxdata/telegraf/plugins/processors/starlark/starlark.go:127 +0xa4a
github.com/influxdata/telegraf/models.(*RunningProcessor).Add(0xc0000a5a70, 0x2f58260, 0xc0008ce380, 0x2f49200, 0xc00020a060, 0x0, 0x0)
/go/src/github.com/influxdata/telegraf/models/running_processor.go:95 +0x106
github.com/influxdata/telegraf/agent.(*Agent).runProcessors.func1(0xc0005d0000, 0xc0001883e0)
/go/src/github.com/influxdata/telegraf/agent/agent.go:541 +0x156
created by github.com/influxdata/telegraf/agent.(*Agent).runProcessors
/go/src/github.com/influxdata/telegraf/agent/agent.go:536 +0x90

Additional info:

@danielnelson danielnelson added this to the 1.15.0 milestone Jul 17, 2020
@danielnelson danielnelson added the bug unexpected problem or unintended behavior label Jul 17, 2020
@danielnelson
Copy link
Contributor

Thanks for the report, we will include the fix for this in 1.15.0-rc4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants