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

Add exec plugin #92

Merged
merged 2 commits into from Aug 6, 2015
Merged

Add exec plugin #92

merged 2 commits into from Aug 6, 2015

Conversation

alvaromorales
Copy link
Contributor

Adds an exec plugin suggested in #24. The plugin reads flattened metrics from one or more commands that output JSON to stdout.

Collaborated with @jpalay

return err
}

jsonOut, err := simplejson.NewJson(out)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using simplejson, could we just use the standard library "encoding/json" here? I think something like this should work:

var jsonOut interface{}
err := json.Unmarshal(out, &jsonOut)

@sparrc
Copy link
Contributor

sparrc commented Aug 6, 2015

@alvaromorales thanks much! looks good other than I think that we can eliminate the dependency on simplejson.

The reason being that telegraf can start to get pretty bloated with dependencies and I'd prefer to tend towards standard libraries where possible.

@alvaromorales
Copy link
Contributor Author

Thanks for the feedback! I agree with eliminating dependencies where possible.

sparrc added a commit that referenced this pull request Aug 6, 2015
@sparrc sparrc merged commit 96014f8 into influxdata:master Aug 6, 2015
@sparrc sparrc mentioned this pull request Aug 6, 2015
srfraser pushed a commit to srfraser/telegraf that referenced this pull request Aug 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants