Skip to content

fix: correct telemetry span nesting and lifecycle - #2561

Merged
norberttech merged 2 commits into
1.xfrom
limit-exception-noise
Jul 28, 2026
Merged

fix: correct telemetry span nesting and lifecycle#2561
norberttech merged 2 commits into
1.xfrom
limit-exception-noise

Conversation

@norberttech

Copy link
Copy Markdown
Member

Change Log


Added

  • flow-php/telemetry - Tracer::activate() returning a detachable Scope
  • flow-php/telemetry - Scope::DETACHED, Scope::INACTIVE and Scope::MISMATCH detach results
  • flow-php/etl - FloeStreamReader::close()

Fixed

  • flow-php/filesystem - concurrently open stream spans no longer nest into each other
  • flow-php/etl - bucket source streams are closed, so their spans complete
  • flow-php/telemetry - the sampler receives the parent Context instead of the ambient one
  • flow-php/telemetry - Tracer::complete() no longer re-exports a span when called twice
  • flow-php/etl - LimitReachedException no longer escapes to_transformation()
  • flow-php/etl - limit reached is logged without the exception stacktrace

Changed

  • flow-php/telemetry - Tracer::span() no longer makes the span current
  • flow-php/telemetry - Tracer::span() and trace() take a Context parent instead of a SpanContext
  • flow-php/telemetry - Tracer::complete() no longer detaches the scope
  • flow-php/etl - to_transformation() expands a Transformation once per loader, not per batch
  • flow-php/etl - nested loading and transformation spans are tracked on a stack
  • flow-php/phpunit-telemetry-bridge - SpanStack::push() takes the span scope

Removed

  • flow-php/telemetry - Span::contextScope() and Span::setContextScope()
  • flow-php/telemetry - MemoryContextStorage::store()

Deprecated

Security

@norberttech norberttech added this to the 0.43.0 milestone Jul 28, 2026
- log limit reached without the exception stacktrace
- track nested loading/transformation spans on a stack
- stop LimitReachedException from escaping TransformerLoader
- expand to_transformation() once per loader, not per batch
…ation

- span() no longer activates the span; activate() returns a detachable
Scope
- parent argument is a full Context and is forwarded to the sampler
- complete() ends once instead of re-exporting, and no longer detaches
- detach() reports out-of-order and already-detached scopes
- stop activating stream, cursor and bucket spans so concurrent ones
stay siblings
- close bucket source streams so their spans complete
@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.18367% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.44%. Comparing base (c558865) to head (7aae7be).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##                1.x    #2561      +/-   ##
============================================
+ Coverage     86.41%   86.44%   +0.02%     
- Complexity    23299    23516     +217     
============================================
  Files          1800     1803       +3     
  Lines         71260    71434     +174     
============================================
+ Hits          61581    61748     +167     
- Misses         9679     9686       +7     
Components Coverage Δ
etl 90.44% <100.00%> (+0.05%) ⬆️
cli 89.40% <ø> (ø)
lib-array-dot 81.44% <ø> (ø)
lib-azure-sdk 64.44% <ø> (ø)
lib-doctrine-dbal-bulk 93.61% <ø> (ø)
lib-filesystem 86.64% <ø> (ø)
lib-types 91.58% <ø> (ø)
lib-parquet 70.23% <ø> (ø)
lib-parquet-viewer 82.26% <ø> (ø)
lib-snappy 89.82% <ø> (ø)
lib-dremel 0.00% <ø> (ø)
lib-postgresql 88.63% <100.00%> (+<0.01%) ⬆️
lib-telemetry 86.58% <96.87%> (+<0.01%) ⬆️
bridge-filesystem-async-aws 92.74% <ø> (ø)
bridge-filesystem-azure 90.45% <ø> (ø)
bridge-monolog-http 96.82% <ø> (ø)
bridge-monolog-telemetry 94.79% <ø> (ø)
bridge-openapi-specification 92.07% <ø> (ø)
symfony-http-foundation 78.57% <ø> (ø)
bridge-psr18-telemetry 100.00% <100.00%> (ø)
bridge-psr3-telemetry 98.95% <ø> (ø)
bridge-psr7-telemetry 100.00% <ø> (ø)
bridge-telemetry-otlp 90.11% <ø> (-0.30%) ⬇️
bridge-symfony-http-foundation-telemetry 92.85% <ø> (ø)
bridge-symfony-filesystem-bundle 91.85% <ø> (ø)
bridge-symfony-filesystem-cache 98.18% <ø> (ø)
bridge-symfony-postgresql-bundle 93.70% <ø> (ø)
bridge-symfony-postgresql-cache 94.41% <ø> (ø)
bridge-symfony-postgresql-messenger 98.80% <ø> (ø)
bridge-symfony-postgresql-session 93.65% <ø> (ø)
bridge-symfony-telemetry-bundle 90.24% <98.82%> (+0.14%) ⬆️
adapter-chartjs 84.05% <ø> (ø)
adapter-csv 89.46% <ø> (ø)
adapter-doctrine 90.75% <ø> (ø)
adapter-google-sheet 91.56% <ø> (ø)
adapter-http 75.79% <ø> (ø)
adapter-json 87.66% <ø> (ø)
adapter-logger 50.00% <ø> (ø)
adapter-parquet 88.69% <ø> (ø)
adapter-text 92.59% <ø> (ø)
adapter-xml 84.27% <ø> (ø)
adapter-avro 0.00% <ø> (ø)
adapter-excel 87.20% <ø> (ø)
adapter-postgresql 90.84% <ø> (ø)
adapter-seal 83.26% <ø> (ø)
bridge-phpunit-postgresql 75.30% <ø> (ø)
bridge-phpunit-telemetry 87.36% <100.00%> (+0.03%) ⬆️
bridge-phpstan-types 0.00% <ø> (ø)
bridge-postgresql-valinor 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@norberttech
norberttech merged commit 462ef48 into 1.x Jul 28, 2026
48 checks passed
@norberttech
norberttech deleted the limit-exception-noise branch July 28, 2026 17:09
@github-project-automation github-project-automation Bot moved this from Todo to Done in Roadmap Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant