-
Notifications
You must be signed in to change notification settings - Fork 47
feat(observability): Compute-driven logging, tracing, and dashboard #507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
fc94585
feat(observability): Make logging, tracing, and dashboard compute-driven
Simone319 3e0c9a1
refactor(bb-lambda-compute): Consolidate observability into observabi…
Simone319 ee21802
refactor(bb-dashboard): Don't expose computes selector until compute …
Simone319 19c6388
refactor(core): Remove logLevel default and LOG_LEVEL env var
Simone319 6b9dd27
docs(bb-dashboard): Correct stale observability comments to match com…
Simone319 fe1ca33
chore(changeset): cover bb-async-job/bb-cron-job test-stub adaptation
Simone319 3121743
fix(observability): address PR review for compute-driven observability
Simone319 ce34b99
docs(bb-tracer): Align Tracer docstring with stack-scoped tracing
Simone319 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| --- | ||
| "@aws-blocks/core": minor | ||
| "@aws-blocks/blocks": minor | ||
| "@aws-blocks/bb-lambda-compute": minor | ||
| "@aws-blocks/bb-dashboard": minor | ||
| "@aws-blocks/bb-logger": minor | ||
| "@aws-blocks/bb-tracer": minor | ||
| --- | ||
|
|
||
| Make observability **compute-driven** so it composes correctly once an app has more than one compute. Logging, tracing, and the dashboard now key off compute state rather than off the Logger / Tracer / Dashboard blocks poking a single implicit compute. | ||
|
|
||
| **Logging is always on; retention is a compute-level setting.** Every compute captures stdout to its own log group unconditionally — there is no "enable logging" step. The retention of that group is set per compute via a new `logRetention` prop on `LambdaCompute` (`@aws-blocks/bb-lambda-compute`), falling back to `defaults.logRetention`. Log **level** is purely per-instance runtime behavior: set it via a `Logger`'s `level` option (default `'info'`). There is no app-wide log-level default and no `LOG_LEVEL` env var. | ||
|
|
||
| **Tracing is presence-gated.** Creating any `Tracer` in the app now enables X-Ray on **every** compute (X-Ray provisions real, costed infrastructure, so it stays off until the app opts in by constructing a Tracer). This replaces the previous model where a Tracer turned on tracing for one implicit compute. `@aws-blocks/core/cdk` adds `registerTracer()` (records Tracer presence) and `finalizeTracing()` (enables tracing on all computes at finalize); `create()` runs it before finalizing dashboards. `Compute.enableTracing()` is now idempotent. | ||
|
|
||
| **The dashboard is organized by compute, with display toggles.** `DashboardOptions` gains `logs?: boolean` (default `true`) and `traces?: boolean` (default `true`) — app-wide display toggles applied uniformly to every compute section. `logs:false` hides the (always-captured) logs section; `traces:false` hides traces even when tracing is enabled. | ||
|
|
||
| The dashboard covers **every** compute in the app (resolved at finalize, so construction order never matters). Each compute renders a health section always, a logs section (unless `logs:false`), and a traces section only when tracing is enabled on it (unless `traces:false`). Metrics remain app-scoped and are passed explicitly. No `computes` selector is exposed yet — it would leak the internal `Compute` type before customers can construct a compute; it arrives with the multi-compute surface. | ||
|
|
||
| **⚠️ Behavior / API changes:** | ||
|
|
||
| - **`Logger` no longer reconfigures log retention.** The CDK `Logger` is now a no-op placeholder (logging is always on and retention moved to the compute). The `retention` option was removed from `LoggingOptions`; set `logRetention` on the compute instead. | ||
| - **A `Tracer` now enables X-Ray on all computes, not one.** Any Tracer in the app turns on tracing fleet-wide. | ||
| - **`Logger` no longer reads the `LOG_LEVEL` environment variable.** Log level is set solely via the per-`Logger` `level` option (default `'info'`); the previously supported `LOG_LEVEL` env-var override has been removed, and Blocks stamps no app-wide log-level config. `BlocksDefaults` has no `logLevel` field. | ||
| - **Removed the deprecated `LoggerBBRef` / `TracerBBRef` dashboard types.** They were no longer consumed — the dashboard reads compute state directly. Loggers and Tracers were never passed to the Dashboard in this model. | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| --- | ||
|
Simone319 marked this conversation as resolved.
|
||
| "@aws-blocks/bb-async-job": patch | ||
| "@aws-blocks/bb-cron-job": patch | ||
| --- | ||
|
|
||
| test: adapt CDK test doubles to the compute-driven observability contract | ||
|
|
||
| Test-only change: both packages' CDK tests use a stub `Compute` that must satisfy | ||
| the `Compute` base class. The compute-driven observability work adds abstract | ||
| observability hooks to `Compute` (`healthWidgets` / `loggingWidgets` / | ||
| `tracingWidgets`, and `applyTracing`), so the stubs now implement them (as no-ops | ||
| that fail the test if the block ever pokes the compute). No runtime or public API | ||
| change. | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.