googleapis / googleapis/google-cloud-python

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

Ouverte
#12,746 1 commentaire 0 réactions 1 personne assignée Assignée à @gkevinzheng Voir sur GitHub
api: monitoring priority: p3 type: feature request
Langage dominant
Python
Étoiles
5.4k
Forks
1.8k
Merge moyen
3 j 4 h
PR mergées (30 j)
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"'
```

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.