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 Google Cloud Monitoring input (Stackdriver) #2099

Closed
oryband opened this issue Nov 28, 2016 · 11 comments · Fixed by #5406
Closed

Add Google Cloud Monitoring input (Stackdriver) #2099

oryband opened this issue Nov 28, 2016 · 11 comments · Fixed by #5406
Labels
area/gcp Google Cloud plugins including cloud_pubsub, cloud_pubsub_push, stackdriver feature request Requests for new plugin and for new features to existing plugins
Milestone

Comments

@oryband
Copy link

oryband commented Nov 28, 2016

Feature Request

Proposal:

Google has made Stackdriver generally available, and has a metrics API.

Please add support for fetching metrics from Google Cloud Monitoring, similar to AWS CloudWatch input.

Use case

Google Cloud Platform is a major cloud provider nowadays, and I'd prefer pulling all metrics into a single backend source (InfluxDB, Prometheus) and manage alerting from there, instead of having to manage various alerting sources (in this case, Google Stackdriver along with my main monitoring/alerting backend).

@sparrc sparrc added this to the Future Milestone milestone Nov 28, 2016
@oryband
Copy link
Author

oryband commented Dec 12, 2016

Hi! Any idea when you'll start work on this issue?

@sparrc
Copy link
Contributor

sparrc commented Dec 12, 2016

@oryband we most likely won't work on this, it is up to contributors

@sparrc sparrc changed the title Add Google Cloud Monitoring input Add Google Cloud Monitoring input (Stackdriver) Feb 16, 2017
@danielnelson danielnelson removed this from the Future Milestone milestone Jun 14, 2017
@danielnelson danielnelson added feature request Requests for new plugin and for new features to existing plugins and removed plugin request labels Aug 12, 2017
@derrley
Copy link

derrley commented Jan 19, 2018

We have a use for this -- has anyone started working on it or have a non-official version we can try out? If not, I think we'll put in the effort to build it.

@danielnelson
Copy link
Contributor

@derrley No one is working on this that I am aware of, so that would be great. When you have an idea of how it will work you could post the config here for comments.

@derrley
Copy link

derrley commented Jan 24, 2018

@danielnelson I've got a basic implementation working that is more or less based on the aws cloudwatch plugin, and works with configuration like this:

[global_tags]
  test_tag = "kyle"

[agent]
  interval = "1m"

[[outputs.influxdb]]
  database = "kyledevtest"
  urls = [
    "http://localhost:9001"
  ]

[[inputs.gcp_stackdriver]]
  project = "projects/erudite-bloom-151019"
  rateLimit = 14
  exclude = [
    "agent",
    "aws",
    "custom"
  ]

It integrates against Google's V3 monitoring API (grpc) and basically just scrapes out all metrics and writes each to an independent measurement with the field name "value" and tag names which are basically the union of the metric and resource tags.

I'll probably add some configuration for specifying GCP credentials, but the integrated-against client import "cloud.google.com/go/monitoring/apiv3" is pretty good about scraping all the various different normal ways for people to configure GCP command lines tools (e.g., gcloud auth login) so I don't want to be too heavy handed there.

Anything else anyone wants to know before I start going thru the process of offering it up? Anything I should know about adding this before doing something stupid? :)

@derrley
Copy link

derrley commented Jan 24, 2018

I should add --

One thing I'd like some feedback on is how you guys think "distribution" metrics should be handled. There really is no great way of doing it. Right now I'm actually writing out all the bucket values as different fields. Another alternative is asking GCP to pre-aggregate them into percentile buckets and writing those out. Pre-aggregated buckets makes the values harder to aggregate. But raw bucket values are pretty much impossible to query in influxdb.

@danielnelson
Copy link
Contributor

@derrley Perhaps distribution metrics can be encoded in the same way the histogram aggregator does it?

@derrley
Copy link

derrley commented Jan 29, 2018 via email

@danielnelson
Copy link
Contributor

Quick explanation is that the upper bound of the bucket is encoded as a tag:

cpu,cpu=cpu1,host=localhost,le=0.0 usage_idle_bucket=0i 1486998330000000000
cpu,cpu=cpu1,host=localhost,le=50.0 usage_idle_bucket=2i 1486998330000000000
cpu,cpu=cpu1,host=localhost,le=100.0 usage_idle_bucket=2i 1486998330000000000
cpu,cpu=cpu1,host=localhost,le=+Inf usage_idle_bucket=2i 1486998330000000000

@derrley
Copy link

derrley commented Jan 29, 2018 via email

derrley pushed a commit to derrley/telegraf that referenced this issue Feb 8, 2018
derrley pushed a commit to derrley/telegraf that referenced this issue Feb 8, 2018
@russorat
Copy link
Contributor

connect #3774

@russorat russorat added this to the 1.8.0 milestone Jul 23, 2018
@russorat russorat modified the milestones: 1.8.0, 1.9.0 Sep 4, 2018
@glinton glinton modified the milestones: 1.9.0, 1.10 Oct 29, 2018
@danielnelson danielnelson added the area/gcp Google Cloud plugins including cloud_pubsub, cloud_pubsub_push, stackdriver label Feb 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gcp Google Cloud plugins including cloud_pubsub, cloud_pubsub_push, stackdriver feature request Requests for new plugin and for new features to existing plugins
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants