Questions tagged [monitoring-query-language]

Monitoring Query Language (MQL) is used to retrieve, filter, and manipulate time-series data in various Google Cloud services.

Monitoring Query Language (MQL) is used to retrieve, filter, and manipulate time-series data in various Google Cloud services.

30 questions
7
votes
1 answer

What are advantages of using Prometheus over Google Cloud Monitoring for SLO based monitoring?

I am working on creating monitoring based on SLO. So far I have been using Google Cloud Monitoring solutions like Dashboards, Alerting and Uptime Checks. I have noticed GCP has now a Managed Service for Prometheus. My question is what would be the…
6
votes
1 answer

Arithmetic operations for Stackdriver monitoring charts

I'm trying to setup a Stackdriver dashboard for my custom metrics that my services provide. In particular I'm starting with general custom/grpc/time_ms metric that is a gauge and have status label on it. I'd love to be able to set up a chart and…
3
votes
2 answers

Combining two metrics with different resource types into one using MQL

How can I combine two metrics into one, when they come from two separate resources? I have a simple logs-based metrics, my-metric, defined like this: resource "google_logging_metric" "my_metric" { name = "my-metric" filter = <<-EOT …
3
votes
2 answers

GCP MQL: Calculate ratio from 3 metrics

I have 3 metrics created in my GCP 1) success request count 2) redirected request count and 3) failed request count. All the 3 metrics are created from log-based metric on Kubernetes log. Here's basically a Terraform resource definition of one…
3
votes
3 answers

Using MQL with Google Cloud Monitoring (Stackdriver) Alerting Policy

I have used MQL to create charts in Google Cloud Monitoring that are a ratio of two metrics. I would like to create an alerting policy based on the MQL, but the UI in Cloud Console does not have a query editor, like it does in Metrics Explorer. Is…
2
votes
1 answer

Alert on Absent Data for Combined Metric in GCP Monitoring

I have created an alert policy in GCP MOnitoring which will notify me when a certain kind of log message stops appearing (a dead man's switch). I have create a logs-based metric with a label, "client", which I use to group the metric and get a…
2
votes
1 answer

Trigger alert when expected associated event is not present

I have two events that should appear in the logs to represent the completion of a transaction. I need to set up an alert when a transaction starts but no completion log entry is found. What I've done so far is created two user-defined log…
JRomero
  • 4,878
  • 1
  • 27
  • 49
2
votes
4 answers

GCP MQL: Rename a line in monitoring chart

I have a simple Google Cloud Monitoring Query Language to show the count of all requests to all containers in kubernetes from log-based metrics. The query is below. k8s_container::logging.googleapis.com/user/service-api-gateway-prod-request-in-count…
2
votes
3 answers

Divide two metrics in Google Cloud Monitoring / MQL

How do I compute the difference and ratio between two Stackdriver metrics in MQL? There are two parts two this question, but I am grateful if you can help me with one: Compute the difference between the two time series Compute the ratio between the…
2
votes
1 answer

GCP MQL query: getting metrics/minute

This query gives me metrics/sec: fetch https_lb_rule::loadbalancing.googleapis.com/https/request_count | within 5m | align rate(1m) | every 1m | group_by […
1
vote
1 answer

How to exclude a certain hours in GCP Monitoring Query Language?

I have this MQL script that will alert PICs if the metric is absent for 30 mins. fetch pubsub_topic | metric 'pubsub.googleapis.com/topic/send_request_count' | filter resource.project_id == 'projectid' && (resource.topic_id == 'topic-id') |…
1
vote
0 answers

PromQL in Google Cloud Monitoring produces unexpected results

Disclaimer: I'm new to PromQL, and might have constructed a query that is completely wrong. I'm using PromQL as the built-in monitoring of Google Cloud does not produce expected results (see this post). When I use PromQL for a custom metric in…
1
vote
0 answers

MQL: GKE metrics filter by working hours and time period

How to achieve weekly/monthly statistics within working hours (excluding night time) using Google MQL? There is ability to select hours and days range separately using time picker widget, but I need statistics using both by setting working hours…
1
vote
1 answer

Conversion of MQL to PROMQL Queries

Is there any way to convert the MQL queries which are already present in the gcp dashboard to PROMQL so that i can use that in prometheus & grafana and i can run and configure the dashboard directly. Any answer would be helpful. converting MQL to…
1
vote
1 answer

Properly charting cumulative, monotonically increasing metrics in MQL

I'm emitting metrics in google cloud counting how often certain jobs are executed and succeed vs. fail. These are cumulative metrics, so the actual values emitted should be monotonically increasing. When I graph these metrics, for each job I would…
1
2