googleapis / googleapis/google-cloud-python

Add support for `monitoring.regex.full_match` in the `google-cloud-monitoring`

Open
#12,746 1 comment 0 reactions 1 assignee Assigned to @gkevinzheng View on GitHub
api: monitoring priority: p3 type: feature request
Dominant language
Python
Stars
5.4k
Forks
1.8k
Avg merge
3d 4h
Merged PRs (30d)
122

Description

The `google-cloud-monitoring` does not support `monitoring.regex.full_match`.
See https://github.com/googleapis/google-cloud-python/blob/main/packages/google-cloud-monitoring/google/cloud/monitoring_v3/query.py#L622-L637
I need to have a way to pass `key=value` without escaping to fully use the functionality, e.g. the `monitoring.regex.full_match`. Now, when I call e.g.
```python
client = monitoring_v3.MetricServiceClient()
project_id = '...'
end_time = datetime.fromisoformat("...")

query = (Query(client, project_id,
metric_type='cloudfunctions.googleapis.com/function/execution_count', end_time=end_time,
days=30,
).select_resources(
function_name="""monitoring.regex.full_match(".*-something-.*")""",
region="europe-west1")
query.to_dataframe()
```
I get an error, because the filter built from the params is like this:
```
'metric.type = "cloudfunctions.googleapis.com/function/execution_count" AND resource.label.function_name = "monitoring.regex.full_match(".*-something-.*")" AND resource.label.region = "europe-west1"'
```
but I need
```
'metric.type = "cloudfunctions.googleapis.com/function/execution_count" AND resource.label.function_name = monitoring.regex.full_match(".*-something-.*") AND resource.label.region = "europe-west1"'
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.