[java-bigquerystorage] Accept an OpenTelemetry instance per stream writer instead of the cached GlobalOpenTelemetry
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- java
- Área
- observability
Línea de trabajo
Start with StreamWriter.Builder and the TelemetryMetrics and Singletons files linked in the issue; trace how each writer obtains its MeterProvider. Check the builders for JsonStreamWriter and SchemaAwareStreamWriter too, since the request asks for the same option there. Done means each builder can accept its own OpenTelemetry instance while an unset option retains the current global behavior.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Is your feature request related to a problem? Please describe.
The Storage Write client's OpenTelemetry metrics (StreamWriter.Builder.setEnableOpenTelemetry(true)) can only be sent to the process-wide GlobalOpenTelemetry.
TelemetryMetrics takes its MeterProvider from Singletons.getOpenTelemetry(), which caches GlobalOpenTelemetry.get() in a static field on first use and has no setter:
This makes the metrics hard to use from a framework that hosts many writers in one JVM.
We maintain an Apache Flink connector for BigQuery (flink-gcp/flink-connector-gcp) and want to forward each writer's metrics into Flink's own metric system, which then exports them to whatever reporter the deployment uses (Prometheus, Datadog, OTLP).
With only the global instance:
- several jobs or subtasks share one TaskManager JVM, so their writers cannot report to separate meter providers;
- a library cannot call
GlobalOpenTelemetry.set(...)without taking that global over from the application; - when the client is shaded into a connector jar,
io.opentelemetryis relocated, so the relocated global is not one the application or a Java agent can set at all.
Describe the solution you'd like
An optional per-writer OpenTelemetry (or MeterProvider) on the writer builders, for example StreamWriter.Builder.setOpenTelemetry(OpenTelemetry), with the same setter on JsonStreamWriter.Builder and SchemaAwareStreamWriter.Builder.
When it is unset, the current GlobalOpenTelemetry behaviour would stay as it is.
Other clients in this repository already offer this:
- Spanner:
SpannerOptions.Builder.setClientMetricsProvider(MetricsProvider)(#13741). - Bigtable:
BigtableDataSettings.Builder.setMetricsProvider(MetricsProvider), which accepts aCustomOpenTelemetryMetricsProvider.
Describe alternatives you've considered
GlobalOpenTelemetry.set(...)once per JVM: it cannot separate the writers of different jobs, and it does not reach a relocated copy of the client.- Reading the meters reflectively, or replacing
Singletons: neither is a supported surface.
Additional context
- Libraries-Bom: 26.90.0
- google-cloud-bigquerystorage 3.35.0
- The same code is on
mainat 165f02ec20bc3db5eb8ca0b6ba09af6f6590be71.
- Lenguaje dominante
- Java
- Estrellas
- 2.1k
- Forks
- 1.2k
- Merge medio
- 2 d 14 h
- PR fusionados (30 d)
- 192
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de googleapis/google-cloud-java
-
[java-core] Timestamp.of(java.sql.Timestamp) is one second late for a time less than a second before the epochPosiblemente ocupada @Vcode2407 la tomó hace 4 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
googleapis/google-cloud-java#14636 ·
Los mantenedores suelen responder en 1 día
-
[java-firestore] UserDataConverter encodes a pre-epoch Date with negative nanos, so the write is refusedPosiblemente ocupada @wu-hui la tomó hace 23 días. Abiertopriority: p2 type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
googleapis/google-cloud-java#14635 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[java-firestore] UserDataConverter throws IndexOutOfBoundsException on an empty __binary__ valuePosiblemente ocupada @wu-hui la tomó hace 23 días. Abiertopriority: p2 type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
googleapis/google-cloud-java#14634 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[java-firestore] CustomClassMapper.convertBigDecimal calls .abs() on Double, unintentionally flipping negative values to positiveQuizá libre de nuevo @wu-hui la tomó hace 45 días y no hay ningún pull request abierto. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
googleapis/google-cloud-java#14533 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Github CI failing when trying to install xmllintPosiblemente ocupada @blakeli0 la tomó hace 81 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
googleapis/google-cloud-java#14132 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de googleapis/google-cloud-java
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
-
Dificultad 2/5 Menos de una hora Aptitud para principiantes 84/100
cpp-best-practices/project_validator#251 ·
Los mantenedores suelen responder en 1 día
-
backend enhancement
Dificultad 2/5 Medio día Aptitud para principiantes 70/100
damodharg6/payledger#16 ·
-
[Bug]: An initiative list with no current entry logs an error on every changePosiblemente ocupada @dwizard0 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día