Comments (3)
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.
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.
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)
- tests.unit.gapic.monitoring_v3.test_uptime_check_service: test_list_uptime_check_ips_pager failed
- tests.unit.gapic.monitoring_v3.test_service_monitoring_service: test_list_service_level_objectives_pager failed HOT 1
- tests.unit.gapic.monitoring_v3.test_service_monitoring_service: test_list_service_level_objectives_async_pager failed HOT 4
- tests.unit.gapic.monitoring_v3.test_uptime_check_service: test_list_uptime_check_ips_pager failed HOT 5
- tests.unit.gapic.monitoring_v3.test_uptime_check_service: test_list_uptime_check_ips_async_pager failed HOT 1
- tests.unit.gapic.monitoring_v3.test_service_monitoring_service: test_list_service_level_objectives_async_pager failed HOT 3
- tests.unit.gapic.monitoring_v3.test_uptime_check_service: test_list_uptime_check_configs_pager failed HOT 5
- tests.unit.gapic.monitoring_v3.test_uptime_check_service: test_list_uptime_check_ips_async_pager failed HOT 4
- tests.unit.gapic.monitoring_v3.test_uptime_check_service: test_list_uptime_check_configs_pager failed HOT 5
- tests.unit.gapic.monitoring_v3.test_uptime_check_service: test_list_uptime_check_configs_async_pager failed HOT 5
- tests.unit.gapic.monitoring_v3.test_uptime_check_service: test_list_uptime_check_configs_async_pager failed HOT 5
- tests.unit.gapic.monitoring_v3.test_uptime_check_service: test_list_uptime_check_ips_pager failed HOT 5
- tests.unit.gapic.monitoring_v3.test_uptime_check_service: test_list_uptime_check_ips_pager failed HOT 5
- tests.unit.gapic.monitoring_v3.test_uptime_check_service: test_list_uptime_check_ips_async_pager failed HOT 5
- tests.unit.gapic.monitoring_v3.test_uptime_check_service: test_list_uptime_check_ips_async_pager failed HOT 5
- Warning: a recent release failed HOT 1
- Accidentally definition of interval in snippets.py in v3/cloud-client HOT 2
- MQL query returning empty with QueryTimeSeriesRequest HOT 6
- In python 3.11.0 monitoring_v3 import is failing HOT 7
- UptimeCheckServiceClient.list_uptime_check_ips() returns unrecognized UptimeCheckRegion enum value HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-monitoring.