GithubHelp home page GithubHelp logo

Comments (3)

busunkim96 avatar busunkim96 commented on June 10, 2024

Hi @leigh-johnson,

The full list of monitoring samples is at https://cloud.google.com/monitoring/docs/samples

Are any of those helpful for what you're trying to do?

from python-monitoring.

arindamchoudhury avatar arindamchoudhury commented on June 10, 2024

Code snippet I use to run MQL query:

from google.cloud.monitoring_v3.services.query_service import QueryServiceClient
from google.cloud.monitoring_v3.types import metric_service

query = '''fetch pubsub_subscription
| metric 'pubsub.googleapis.com/subscription/oldest_unacked_message_age'
| filter
    resource.project_id == '443684903852'
    && (resource.subscription_id == 'octoprint-events-webapp-prod')
| group_by 1m,
    [value_oldest_unacked_message_age_mean:
       max(value.oldest_unacked_message_age)]
| every 1m'''
project_name = 'your_gcp_project_name'
metric_query = metric_service.QueryTimeSeriesRequest(name=project_name, query=query)
service_client = QueryServiceClient()
results = service_client.query_time_series(metric_query)

from python-monitoring.

meredithslota avatar meredithslota commented on June 10, 2024

The samples have migrated to this repo: https://github.com/GoogleCloudPlatform/python-docs-samples/tree/main/monitoring and are still all available at https://cloud.google.com/monitoring/docs/samples. For any new sample requests, please use the python-docs-samples repo. Thanks!

from python-monitoring.

Related Issues (20)

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.