Coder Social home page Coder Social logo

tkuennen / monitoring-dashboard-samples Goto Github PK

View Code? Open in Web Editor NEW

This project forked from googlecloudplatform/monitoring-dashboard-samples

0.0 1.0 0.0 10.67 MB

License: Apache License 2.0

Python 14.32% HCL 58.14% Makefile 0.31% Shell 16.27% PowerShell 10.96%

monitoring-dashboard-samples's Introduction

Cloud Monitoring Dashboard Samples

This repository contains samples that may be used with the Cloud Monitoring Dashboards API.

How to use the samples

  1. Check it out from GitHub. For example, you can do it in Cloud Shell by clicking the button below:

    Open this project in Cloud Shell

  2. Use these commands to import the dashboard.

    First, set your environment variables, replacing the following values with your values:

    • PROJECT_ID you wish to import the dashboard to
    • FILE_NAME with the input filename for the dashboard JSON config
    export PROJECT_ID=<PROJECT_ID>
    
    export FILE_NAME=<DASH_FILE_NAME>
  3. Use the provided script to create a dashboard.

    scripts/dashboard/dashboard.sh import $PROJECT_ID $FILE_NAME

Alternatively, you can run the following command via curl. Use the projects.dashboards.create to call the Dashboards API with the sample JSON and create a new dashboard. Make sure you replace the [project-id] and [file-name.json] in the command:

curl -X POST -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
https://monitoring.googleapis.com/v1/projects/[project-id]/dashboards -d @[file-name.json]

Steps to get the JSON configuration

If you want to export a dashboard to a JSON file and share it, you can use the following steps.

  1. Create the dashboard in the Monitoring UI (or even better, share one that you’ve already developed and used).

  2. Open the dashboard and copy the dashboard ID from the URL (the string is in the URL after the /monitoring/dashboards/custom/ ˆprefix). For example, 10768789961894600977 is the dashboard ID in the URL below:

    https://console.cloud.google.com/monitoring/dashboards/custom/10768789961894600977?project=sd-uxr-001&timeDomain=1h

  3. Use these commands to export the JSON configuration for your dashboard.

    First, set your environment variables, replacing the following values with your values:

    • DASH_ID with the dashboard ID copied from step #2
    • PROJECT_ID with your project id that contains the dashboard
    • FILE_NAME with the output filename for the dashboard JSON config
    export DASH_ID=<YOUR_DASH_ID>
    
    export PROJECT_ID=<PROJECT_ID>
    
    export FILE_NAME=<DASH_FILE_NAME>
  4. Use the gcloud command line to export the dashboard to a JSON file.

    scripts/dashboard/dashboard.sh export $DASH_ID $PROJECT_ID $FILE_NAME

Sample Dashboards Contributor Guidelines

Screenshots

Please add a screenshot with your dashboard. All screenshots should live in the same directory as the sample dashboard specification.

Filenames

If there is only a single screenshot, the name should match the dashboard specification but with a PNG extension. For example:

cloudrun-monitoring.json
cloudrun-monitoring.png

If there are multiple screenshots, a two digit number should be added between the name and file extension. For example:

gke-cluster-monitoring.json
gke-cluster-monitoring.01.png
gke-cluster-monitoring.02.png

Update README

Please also update the README.md file in the same directory of your dashboard file.

monitoring-dashboard-samples's People

Contributors

xiangshen-dk avatar schmikei avatar jsirianni avatar draffensperger avatar eliotw avatar charlesbaer avatar djaglowski avatar kj1724 avatar yuriatgoogle avatar bianpengyuan avatar joyw-2018 avatar jonathanwamsley avatar arman-rye avatar mashun4ek avatar hurier-m avatar punya avatar dknezicd avatar

Watchers

 avatar

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.