monitoring_dashboard: DashboardFilter adding new fields into proto.

Abierto
#17,951 1 comentario 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
62/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
python
Área
api

Línea de trabajo

Comienza con packages/google-cloud-monitoring-dashboards/google/cloud/monitoring_dashboard_v1/types/dashboard_filter.py y compara DashboardFilter con la documentación de la API REST enlazada. Verifica cómo están definidos los campos existentes y cómo se prueban los tipos generados; se considera terminado cuando valueType y stringArrayValue pueden construirse, serializarse y analizarse, y exponen los valores STRING_ARRAY esperados.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

api: monitoring priority: p3 type: feature request
Determine this is the right repository
  • I determined this is the correct repository in which to report this feature request.
Summary of the feature request

DashboardFilter only exposes label_key, template_variable, string_value, and filter_type:
https://github.com/googleapis/google-cloud-python/blob/google-cloud-monitoring-dashboards-v2.22.0/packages/google-cloud-monitoring-dashboards/google/cloud/monitoring_dashboard_v1/types/dashboard_filter.py

However:

The REST API supports valueType (STRING / STRING_ARRAY) and stringArrayValue for value-only dashboard variables that accept multiple values — documented here: https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v1/projects.dashboards#DashboardFilter

This mismatch means the generated proto/client is behind the actual API surface, and there's no way to construct or parse a STRING_ARRAY-type dashboard filter/variable using the typed Python client — only via raw REST calls.

Desired code experience

file: dashboard_filter.py

class ValueType(proto.Enum):
        r"""The type of the filter value
        Values:
        VALUE_TYPE_UNSPECIFIED (0):
            Value type is unspecified
        STRING (1):
            String type
        STRING_ARRAY (2):
            String array type
        """

        VALUE_TYPE_UNSPECIFIED = 0
        STRING = 1
        STRING_ARRAY = 2

    value_type: ValueType = proto.Field(
        proto.ENUM,
        number=6,
        enum=ValueType,
    )
    stringArrayValue: StringArray = proto.Field(
        proto.MESSAGE,
        number=7,
        message=StringArray,
    )
Expected results

_e.g. dashboardFilter.stringArrayValue should return { values: [] }

API client name and version

google-cloud-monitoring-dashboards v2.22.0

Use case

This feature will allow users to retrieve stored values saved in Dashboard Settings -> Filters/Variables.

Additional context

No response

Lenguaje dominante
Python
Estrellas
5.4k
Forks
1.8k
Merge medio
2 d 22 h
PR fusionados (30 d)
102

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de googleapis/google-cloud-python

Todos los issues de googleapis/google-cloud-python

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.