Coder Social home page Coder Social logo

grafana-google-stackdriver-datasource's Introduction

Google Stackdriver Datasource Plugin for Grafana

Setup

To use this plugin, you need to get client ID which allow to call Google Stackdriver API.

Please create OAuth 2.0 client ID at https://console.developers.google.com/apis/credentials.

After get the client ID, set the ID to datasource config.

At first time, you need to accept to open this popup window, and accept to use API.

Query editor

Please fill parameter for projects.timeSeries.list method.

You don't need to add projects/ prefix for Project ID field.

Templating

Query variable

Name Description
metrics(project_id, filter expression) Returns a list of metrics matching the filter expression.
label_values(project_id, path to label name, filter expression) Returns a list of label values matching the filter expression and the path to label name.
groups(project_id) Returns a list of groups.
group_members(project_id, group_id, path to label name, filter expression) Returns a list of group members matching the filter expression and the path to label name.

The project_id is optional.

Please specify path to label name from top of TimeSeries object. For example, if you want to get instance name, set metric.labels.instance_name to path to label name.

Changelog

v1.0.0
  • Initial release

grafana-google-stackdriver-datasource's People

Contributors

daniellee avatar mtanda avatar ygurumi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

grafana-google-stackdriver-datasource's Issues

Better documentation on setting label names

Please specify path to label name from top of TimeSeries object. For example, if you want to get instance name, set metric.labels.instance_name to path to label name.

Maybe it's my poor knowledge of Grafana, but I think that this needs to be clearer. I have no idea what you mean.

trying to use google stack driver

hello ,
I'm trying to figure out how to use the plugin , i'm confused here a bit . there might be a couple of steps missing , appreciate the effort .

Thanks

Problems adding the datasource

Hi there,

I've created a OAuth 2.0 client ID and filled in both the "Authorised JavaScript origins" and the "Authorised redirect URIs" correctly, however, when I attempt to click "Save & Test", it just hangs and nothing happens?

Can you please help me figure out what the problem could be? I've attached a screenshot.

screen shot 2017-11-15 at 17 20 03

Metrics pulled resolve to value of 0, not a numeric value

When using a singlestat panel, when I try to use the value mapping feature or the threshold feature, no matter what the numeric value is shown, the value that it resolves to is "0". I'm assuming there is a text-to-int problem somewhere here, since I confirmed it doesn't happen via other data sources (Prometheus / CloudWatch) I'm assuming this problem lies in this plugin.

After further testing, this seems to occur with ALL metrics pulled from this plugin, not limited to counts. But, I initially found this problem when using the COUNT align feature.

The following four panel screenshot below have the exact same configuration...

  • They all pull a metric which equals 1
  • They all have the threshhold coloring feature enabled
  • The right two have the value mapping feature enabled, the left two show the raw value
  • The top two are from stackdriver, the bottom two from prometheus (and working properly, as a comparison)

screen shot 2018-08-09 at 5 58 45 pm

With the following configuration...
screen shot 2018-08-09 at 5 41 24 pm
screen shot 2018-08-09 at 6 01 25 pm
The configuration (which is not relevant, as this appears to apply to ALL metrics) looks like...
screen shot 2018-08-09 at 5 41 54 pm

As I said this appears to be wide-reaching, every metric I pull from stackdriver appears to render to a value of "0" for the purposes of this the singlestat panel, effectively rendering the major visual feedback feature of the singlestat panel absolutely useless.

`Access: Server` reports 'Data source is working' but metric queries do not return results

What Grafana version are you using?

5.0.4

What datasource are you using?

https://github.com/mtanda/grafana-google-stackdriver-datasource

What OS are you running grafana on?

Linux (derived from grafana/grafana docker image)

What did you do?

  • Set the google application credentials in a docker container. See output below
root@778f9f78fcdc:/# echo $GOOGLE_APPLICATION_CREDENTIALS
/gcp-credentials.json
  • Configure the datasource, Save & Test reports it to be working. See output below

screen shot 2018-05-23 at 10 05 14 am

What was the expected result?

Access to google stackdriver metrics

What happened instead?

No response is returned from the metrics server. See console output below.

TypeError: Cannot read property 'timeSeries' of undefined
    at eval (datasource.ts:404)
    at u (angular.js:17145)
    at angular.js:17193
    at d.$digest (angular.js:18331)
    at d.$apply (angular.js:18628)
    at angular.js:18931
    at i (angular.js:6419)
    at angular.js:6699
metrics_panel_ctrl.ts:159 Panel data error: SyntaxError: Unexpected token u in JSON at position 0
    at JSON.parse (<anonymous>)
    at eval (datasource.ts:77)

screen shot 2018-05-23 at 10 14 32 am

Query inspector not working

I'm trying to debug the api calls being made by the plugin and the query inspector just seems to be stuck with the loading icon.

I'm currently running Grafana 5.0.4. Should the query inspector work?

More setup steps

For the Oauth Client Id does it need to be a web application? I'm not entirely clear on how to create the Oauth client ID. Any help would be appreciated.

Some metrics don't render as expected

Hi @mtanda !

As I dig into more metrics I'm finding a couple issues that I thought may be a bug or PEBCAK. Here's the two I'm currently experiencing...

  1. pubsub.googleapis.com/subscription/num_outstanding_messages - It renders data points but the legend and tooltip do not show any values.

  2. Can't figure out how to get any cpu/utilization metrics to render as value between 0 - 100%
    For this second one I've tried all sorts of combinations in the aggregation section and I'm seeing very large numbers so I assume there's either some option the plugin is missing or I'm using the wrong method to achieve the result desired.

Any help you can provide here is much appreciated. So far the plugin is great and a really clean addition to our insights in Grafana, so Thank you :)

Variable using stackdriver

Hi, i try to get all the bucket name in a variable. Using the doc, i try, but i have an error,

Template variables could not be initialized: Cannot read property 'client' of undefined

and this is the query variable

metrics( <my-project>, resource.labels.bucket_name, resource.type="gcs_bucket")

May be an exemple could be nice, if i know how to have this working, i can do a pr

Thanks

Internal Server Error, impossible to debug plugin setup

When trying to setup this plugin, if it doesn't work perfectly it doesn't give any meaningful feedback neither in the console, Grafana usage logs, or on the Grafana GUI on what is wrong and/or how to fix it.

POST http://localhost:3000/api/tsdb/query 500 (Internal Server Error)
datasource.ts:354 TypeError: Cannot read property '' of undefined

screen shot 2018-08-13 at 3 09 19 pm

Running Grafana in Docker on Kubernetes...

root@grafana-5ffbb7dc69-fgk9l:/# set | grep -i google
GOOGLE_APPLICATION_CREDENTIALS=/var/lib/grafana/google_stackdriver.json
root@grafana-5ffbb7dc69-fgk9l:/# cat /var/lib/grafana/google_stackdriver.json
{
  "type": "service_account",
  "project_id": "project-name-here",
  ......
}

Resource types and custom tags?

Hi,

I have been playing around with your plugin a bit and here is some feedback / questions:

  • There is definitely too little feedback/information if oauth2 dance goes wrong. Especially if you are not doing oauth stuff as daily business, the complexity when it comes to finding an error is huge. Good error messages and hints what to do would help a great deal.
  • Do you plan to support resource types and the associated additional metrics at some point? Just having the metrics types list is definitely not enough for serious work with GCP setups.
  • Do you plan to support filtering and aggregating based on resource tags/labels - it is also essential to do something useful - especially when automating dashboard creation

But thanks for the great work - stackdriver as such is not scriptable and cannot be parameterized, so sth like your plugin is essential for building on top of stackdriver.

Jan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.