WIP: 0.5.0 — upgrade to Dartastic 1.1.0-beta.5 + release tooling - #18
Draft
michaelbushe wants to merge 1 commit into
Draft
WIP: 0.5.0 — upgrade to Dartastic 1.1.0-beta.5 + release tooling#18michaelbushe wants to merge 1 commit into
michaelbushe wants to merge 1 commit into
Conversation
Comprehensive upgrade pass that brings Flutterrific up to the current
Dartastic SDK (`1.1.0-beta.5-wip`) and API (`1.0.0-beta.6`) and lands
the release tooling Flutterrific was missing.
## Dartastic SDK / API upgrade
pubspec: `dartastic_opentelemetry: ^1.0.1-alpha → ^1.1.0-beta.4` and
`dartastic_opentelemetry_api: ^1.0.0-alpha → ^1.0.0-beta.6`.
Workspace dep override on the local SDK for the in-flight beta.5 work.
Picks up:
- Late-binding global proxies on `OTel.tracer()` / `OTel.tracerProvider()` /
`OTel.loggerProvider()` / `OTel.logger()`. Module-load capture
(e.g. `final _tracer = OTel.tracer();`) now survives a later
`OTel.initialize`. This is the foundation `FlutterOTel`'s
observers + tracker singletons already assume.
- Web compatibility for the SDK's main library — no `dart:io`
import-time crashes on Flutter web / dart2js / dart2wasm.
- Sub-millisecond span timing on web via the platform-aware
`WebTimeProvider` default.
- OTLP/HTTP-JSON wire format on every signal.
- Beta.6 semconv rename: `HttpResource` → `Http`, `UrlResource` →
`Url`, `UserSemantics` → `User`, etc. Six enums kept the
`Resource` suffix to avoid Dart/Flutter/library type conflicts:
`ErrorResource`, `ExceptionResource`, `FileResource`,
`ProcessResource`, `ServerResource`, `EventResource`.
`SessionViewSemantics` split — OTel-spec `Session.id` /
`Session.previousId` vs Datadog/Dynatrace-style `RumSessionView`.
## Code changes
- `lib/flutterrific_opentelemetry.dart`: re-export `show` clauses
updated for the beta.6 rename. Docstring documents the migration
table. Added `Url` (missing in original). Added
`export 'src/util/otel_config.dart'` so consumers don't need a
deep `lib/src` import for `OTelConfig`.
- `lib/src/flutterrific_otel.dart`: two `SessionViewSemantics.viewName`
use sites migrated to `RumSessionView.viewName`.
- `lib/src/logs/ui_logger.dart` + `ui_logger_create.dart`:
`class UILogger implements Logger` → `implements OTelLogger`
(SDK renamed `Logger` → `OTelLogger` to avoid clashing with
`package:logging`'s `Logger`). Delegate field + constructor param
retyped.
- `lib/src/trace/ui_tracer.dart`: deleted `recordSpan` and
`recordSpanAsync` overrides (removed from SDK in 0.8.3 as
redundant with `startActiveSpan` / `startActiveSpanAsync`). Added
`timeProvider` getter required by SDK 1.1.0-beta.2. Deleted
`startSpanWithContext` override (matches the SDK 1.1.0-beta.5
removal — see `MindfulSoftwareLLC/dartastic_opentelemetry#48`).
- `lib/src/trace/ui_tracer_provider.dart`: added `timeProvider`
getter+setter.
- Dropped 7 now-redundant `package:dartastic_opentelemetry_api/...`
imports (the SDK package re-exports everything those files used).
## Release tooling (new)
- `tool/release.dart` — port of the SDK's release script. Adapted
for Flutter (`flutter pub` / `flutter analyze` / `flutter test`).
Same `-wip` flow: strip `-wip` from pubspec.yaml, date the
CHANGELOG section, run analyze/tests, tag `vX.Y.Z`, bump to the
next `-wip`, `dart pub publish` from the tagged tree, push +
`gh release create`.
- `tool/update_coverage_badge.sh` — reads `coverage/lcov.info` and
rewrites the README badge line in place. Color-codes by
threshold.
## CHANGELOG / PUBLICATION_CHECKLIST / README / ROADMAP
- `CHANGELOG.md`: migrated to Keep-a-Changelog format with a fresh
`## [0.5.0-wip]` section. Documents every breaking change above.
- `PUBLICATION_CHECKLIST.md`: rewritten around the `dart run
tool/release.dart` flow. Coverage gate explicit (>=85% for
stable). Flutter-specific platform matrix kept.
- `README.md`: coverage badge added (honest about current ~19%
line coverage). Quick Start examples migrated to the typed-enum
shorthand (`OTel.attributesFromSemanticMap({Http.requestMethod: ...})`)
plus `withSpanAsync` for proper Zone-based context propagation
across `await`. New ~70-line "Client OpenTelemetry" section
comparing Flutterrific's current event/attribute shapes against
the in-development OTel client semantic conventions
(`device.app.lifecycle`, `app.screen.click`, `browser.web_vital`,
`user_agent.original`).
- `ROADMAP.md`: new "Path to 1.0" section with concrete 3-release
coverage plan (pure-Dart 80% in 0.5.x, observer widget tests in
0.6.x, integration tests against Grafana LGTM in 0.7.x), plus the
client-OTel spec-alignment migration windows.
## Example async fix
- `example/lib/main.dart`: `_simulateNetworkRequest` now wraps the
awaited work in `tracer.withSpanAsync(span, () async { ... })` so
the span is active for the duration of the `await` — nested
instrumentation that reads `Context.current.span` sees this span
as its parent. Prior shape recorded timing fine but left the span
inactive during the awaited work.
## Pubspec
- `version: 0.5.0-wip` (adopting the `-wip` flow).
- Added `pub_semver` + `pubspec_parse` dev deps for the release
script.
## Validation
- `flutter analyze` clean (only an info-level lint on `pubspec.lock`
age in some envs; no errors / warnings).
- `flutter test` — **30/30 pass**.
- `dart analyze tool/release.dart` clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
|
@michaelbushe the other PR #19 updates this project to the latest beta. If this is merged in first then the other PR should still work, but if the other is merged in first there will be some real conflicts. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Comprehensive 0.5.0 upgrade pass. Three buckets:
Breaking changes (consumers will need to migrate)
Six `Resource` enums kept the suffix to avoid Dart/Flutter/library type conflicts: `ErrorResource`, `ExceptionResource`, `FileResource`, `ProcessResource`, `ServerResource`, `EventResource`. Full migration table in CHANGELOG.
What landed (highlights)
Code
Release tooling (new)
Docs
Example fix
Pubspec
Test plan
Status: WIP / draft
Paired with `dartastic_opentelemetry#48` (the SDK-side `startSpanWithContext` removal). This PR can land independently as long as the dep override stays pointing at the SDK branch, but for an actual pub.dev publish, the SDK beta.5 has to be out first.
🤖 Generated with Claude Code