googleapis / googleapis/google-cloud-python

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

Aperta
#12,746 1 commento 0 reazioni 1 assegnatario Assegnata a @gkevinzheng Vedi su GitHub
api: monitoring priority: p3 type: feature request
Lingua principale
Python
Stelle
5.4k
Fork
1.8k
Merge medio
3g 4h
PR unite (30g)
122

Descrizione

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"'
```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.