Add optional OpenTelemetry tracing for subscription hydration
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 35/100
- Type d'issue
- Fonctionnalité
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- postgresql, rust
- Domaine
- backend, observability
Piste de recherche
Start by reading the observability documentation and the existing OTEL_* configuration and metrics/log export code; the issue does not name specific files. Map the subscription registration and initial hydration stages, including their asynchronous boundaries, before proposing a design. Done means opt-in traces cover hydration with context propagation, configurable sampling and nonblocking export, with tests and updated documentation and example configuration.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Context
Streamgres already provides detailed Prometheus metrics and optional
OpenTelemetry export for metrics and logs. The observability documentation
also explicitly mentions that traces are not currently produced and that
OTEL_TRACES_EXPORTER is accepted but ignored.
The existing stage-level histograms are useful for identifying aggregate
latency, but it would also be useful to correlate the individual stages of
a subscription's initial hydration as one operation.
For example, when a subscription takes longer than expected to become
available, an individual trace could make it easier to distinguish time
spent in query transformation, planning, storage reads and hydration.
Proposed enhancement
It would be useful to explore adding opt-in OpenTelemetry trace export,
starting with the subscription registration and initial hydration lifecycle.
A trace could connect the relevant stages:
- Receiving the subscription request.
- Transforming and planning the query.
- Issuing the required storage reads.
- Landing the reads in the engine.
- Completing subscription hydration.
- Delivering the initial result to the client group.
The first iteration does not necessarily need to trace every transaction,
row update or feed operation. A focused subscription-hydration path would
already provide a useful starting point.
Design considerations
A few constraints seem particularly important for this project:
- Tracing should remain disabled by default and should be explicitly
configurable through the existingOTEL_*configuration approach. - Trace context should be preserved across the asynchronous and
thread/channel boundaries involved in the subscription lifecycle. - Sampling should be configurable so high-volume workloads do not produce
an unnecessarily large number of spans. - Span export should happen outside the engine and client-serving hot paths.
A bounded queue and dedicated export worker would be worth considering. - A slow or unavailable collector must not block payment-independent
synchronization work or the threads serving clients. - Dropped spans and export failures should be observable.
- Span attributes should avoid SQL literals, row contents, user data,
credentials and other sensitive information.
Acceptance criteria
-
OTEL_TRACES_EXPORTERcan explicitly enable or disable trace export. - Trace endpoint configuration follows the existing OTLP configuration
approach, including support for a dedicated traces endpoint. - A subscription's initial hydration can be represented by a trace
spanning the relevant processing stages. - Trace context is preserved where the lifecycle crosses asynchronous
tasks or thread/channel boundaries. - Sampling and bounded buffering prevent tracing from introducing
blocking work into the engine or client-serving paths. - Collector failures and dropped spans are handled without affecting
synchronization behaviour. - Tests cover configuration, trace encoding, context propagation and
export failure or queue saturation. - Existing metrics and log export behaviour remains unchanged.
- The observability documentation and example configuration are updated.
Discussion
I would be interested in contributing an initial implementation of this
capability. Before starting, it would be useful to understand whether
maintainers would prefer a focused hydration trace first or a broader
subscription-lifecycle tracing design.
- Langage dominant
- Rust
- Étoiles
- 129
- Forks
- 7
- Merge moyen
- 1 j 16 h
- PR mergées (30 j)
- 7
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de juspay/streamgres
-
Make the top-L client diff cost depend on what changed, not on the limitPeut-être pris @SahilKhan101 l’a pris il y a 4 jours. Ouverteenhancement
juspay/streamgres#64 · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
Query optimisation: share initial snapshots across LIMIT variants of the same query (donor windows)Peut-être pris @sprihaanand-juspay l’a pris il y a 5 jours. Ouverte
juspay/streamgres#58 · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 Plus d'une semaine Accessibilité débutants 38/100
juspay/streamgres#56 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
juspay/streamgres#55 ·
Les mainteneurs répondent en général sous 1 jour
-
PgBouncer transaction pooling: `prepare` runs outside the read transaction and can land on another backendPeut-être pris @sprihaanand-juspay l’a pris il y a 8 jours. Ouverte
juspay/streamgres#53 · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de juspay/streamgres
Issues similaires
-
claim
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
Nixitov/Riptide-Native#946 ·
Les mainteneurs répondent en général sous 1 jour
-
area: ai-assistants documentation help wanted
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
BetaBots-LLC/latticegate#17 ·
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 94/100
storytold/craft-libs#5594 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
听歌识曲历史跳转后对应音源界面无法返回Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
LingyunStudio/RustMusic#16 ·