Skip to content

Conversation

@kinyoklion
Copy link
Member

@kinyoklion kinyoklion commented Sep 26, 2025

Summary

Adds basic support for lifecycle instrumentation.

The code inside the instrumentation/lifecycle/platform folder is a port of the code in the LD flutter SDK. Potentially we could move that to a shared library. We split the LD SDK into layers, but there wasn't any need for a flutter specific platform layer sans SDK. (It is dart only, then client-side dart, and then flutter. But no flutter platform library.)

How did you test this change?

Manual testing.


Note

Introduce lifecycle instrumentation that emits spans on Flutter app state changes across IO and Web platforms, and wire it into the observability plugin.

  • Observability:
    • Lifecycle instrumentation:
      • Add Instrumentation interface and LifecycleInstrumentation that listens to AppLifecycleState and emits spans via Observe with attributes from LifecycleConventions.
      • Define LifecycleConventions with span name device.app.lifecycle and attribute flutter.app.state mapped from AppLifecycleState.
      • Implement platform listeners platform/io_lifecycle_listener.dart (uses AppLifecycleListener) and platform/js_lifecycle_listener.dart (uses document visibility); include a stub fallback.
    • Plugin integration:
      • Update ObservabilityPlugin to instantiate and hold LifecycleInstrumentation on construction.

Written by Cursor Bugbot for commit d150c19. This will update automatically on new commits. Configure here.

@kinyoklion kinyoklion force-pushed the rlamb/add-lifecycle-instrumentation branch from e533388 to 47a44fa Compare September 26, 2025 23:02
@kinyoklion kinyoklion force-pushed the rlamb/add-lifecycle-instrumentation branch from 47a44fa to 1322082 Compare September 26, 2025 23:03
@kinyoklion kinyoklion marked this pull request as ready for review September 26, 2025 23:04
@kinyoklion kinyoklion requested a review from a team as a code owner September 26, 2025 23:04
cursor[bot]

This comment was marked as outdated.

@kinyoklion kinyoklion merged commit 3ed0671 into main Oct 1, 2025
21 checks passed
@kinyoklion kinyoklion deleted the rlamb/add-lifecycle-instrumentation branch October 1, 2025 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants