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 Processor: Return multiple metrics from plugin #8371

Closed
sjwang90 opened this issue Nov 6, 2020 · 4 comments
Closed

Starlark Processor: Return multiple metrics from plugin #8371

sjwang90 opened this issue Nov 6, 2020 · 4 comments
Assignees
Labels
area/starlark feature request Requests for new plugin and for new features to existing plugins

Comments

@sjwang90
Copy link
Contributor

sjwang90 commented Nov 6, 2020

Feature Request

Opening a feature request kicks off a discussion.

Proposal:

Return multiple metrics from Starlark processor plugin

Current behavior:

Currently can only return (create) one metric from the Starlark

Desired behavior:

  • Return multiple metrics.
  • Approaches:
    1. Add a new function add() to add new metrics in the starlark processor. Use case: parse an array of json items and add one metric per item in the array
    2. Return an array or a tuple in the apply function. Currently we return the metric if we want to keep it. If we want to make multiple metrics from one, more natural to return multiple metrics rather than call an add() function

Use case:

  • Parse an array of json items and add one metric per item in the array
@sjwang90 sjwang90 added feature request Requests for new plugin and for new features to existing plugins area/starlark labels Nov 6, 2020
@srebhan
Copy link
Member

srebhan commented Nov 6, 2020

Hey @sjwang90, back when I discussed the starlark processor, @danielnelson was against handling multiple metrics as once (basically enabling aggregation etc.). I don't remember the reasoning.
Do you want multiple in, multiple out or single in multiple out?

@ssoroka ssoroka self-assigned this Nov 6, 2020
@ssoroka
Copy link
Contributor

ssoroka commented Nov 6, 2020

always single in, 0 or more out.

@essobedo
Copy link
Contributor

The corresponding PR #8423 that shows how to do it

@ssoroka
Copy link
Contributor

ssoroka commented Nov 17, 2020

fixed in #8423

@ssoroka ssoroka closed this as completed Nov 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/starlark feature request Requests for new plugin and for new features to existing plugins
Projects
None yet
Development

No branches or pull requests

4 participants