Skip to content

feat(observability): backend metrics + tracing primitives - #5376

Merged
zuozhiw merged 1 commit into
apache:mainfrom
Ma77Ball:obs/pr2/backend-emit
Oct 27, 2026
Merged

zuozhiw merged 1 commit into
apache:mainfrom
Ma77Ball:obs/pr2/backend-emit

Conversation

@Ma77Ball

@Ma77Ball Ma77Ball commented Jun 5, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Adds the libraries services use to emit metrics and distributed traces. These stay dormant until the SDK is enabled in PR1.

  • TexeraMetrics: metric instruments for workflow lifecycle and throughput. The active-executions metric is modeled as an observable gauge read from the live registry, correcting the phantom-active count a manual up/down counter produced.
  • TexeraTracer and SpanAttrs: helpers for creating spans and attaching standardized attributes.
  • TraceparentValidator: parses and validates W3C traceparent headers for context propagation.
  • Pure additions to the Config module; no behavior changes when telemetry is disabled.

Any related issues, documentation, or discussions?

Closes: #5368
Part of #4070. Stacked on #5375.

How was this PR tested?

  • Unit specs for the metrics, tracer, span-attribute, and traceparent-validator classes.
  • sbt scalafmtCheckAll passes; compile and tests run in this PR's CI.

Was this PR authored or co-authored using generative AI tooling?

Co-authored with Claude Opus 4.8 in compliance with ASF

@codecov-commenter

codecov-commenter commented Jun 5, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.91960% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.74%. Comparing base (2cf4398) to head (b903c94).

Files with missing lines Patch % Lines
...rg/apache/texera/web/service/WorkflowService.scala 71.66% 13 Missing and 4 partials ⚠️
.../apache/texera/observability/WorkflowMetrics.scala 84.93% 4 Missing and 7 partials ⚠️
...ra/web/observability/WorkflowMetricsRecorder.scala 83.33% 2 Missing and 1 partial ⚠️
.../texera/web/service/WorkflowExecutionService.scala 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5376      +/-   ##
============================================
- Coverage     91.75%   91.74%   -0.02%     
+ Complexity     5078     5077       -1     
============================================
  Files          1274     1279       +5     
  Lines         55486    55638     +152     
  Branches       7024     7051      +27     
============================================
+ Hits          50911    51044     +133     
- Misses         2846     2856      +10     
- Partials       1729     1738       +9     
Flag Coverage Δ *Carryforward flag
access-control-service 77.44% <ø> (ø)
agent-service 99.16% <ø> (ø) Carriedforward from 2cf4398
amber 85.77% <83.91%> (+0.01%) ⬆️
computing-unit-managing-service 61.84% <ø> (ø)
config-service 87.50% <ø> (ø)
file-service 82.29% <ø> (ø)
frontend 96.52% <ø> (ø) Carriedforward from 2cf4398
notebook-migration-service 83.77% <ø> (ø)
pyamber 98.54% <ø> (ø) Carriedforward from 2cf4398
workflow-compiling-service 74.25% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added the platform Non-amber Scala service paths label Jun 5, 2026
@github-actions

github-actions Bot commented Jun 12, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

🟢 0 better · 🔴 7 worse · ⚪ 8 noise (<±5%) · 0 without baseline

Compared against main 2cf4398 benchmarked on this same runner, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.

Dashboard · Run

config throughput MB/s latency max Δ latest / 7d
🔴 bs=10 sw=10 sl=64 466 0.284 21,019/30,349/30,349 us 🔴 +37.3% / 🔴 +148.3%
🔴 bs=100 sw=10 sl=64 1,218 0.743 81,109/109,112/109,112 us 🔴 +5.8% / 🔴 +25.2%
⚪ bs=1000 sw=10 sl=64 1,441 0.879 690,793/754,434/754,434 us ⚪ within ±5% / 🟢 -11.5%
Baseline details

Latest main 2cf4398 from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 466 tuples/sec 608 tuples/sec 1,019 tuples/sec -23.4% -54.3%
bs=10 sw=10 sl=64 MB/s 0.284 MB/s 0.371 MB/s 0.622 MB/s -23.5% -54.3%
bs=10 sw=10 sl=64 p50 21,019 us 15,303 us 10,144 us +37.3% +107.2%
bs=10 sw=10 sl=64 p95 30,349 us 24,691 us 12,225 us +22.9% +148.3%
bs=10 sw=10 sl=64 p99 30,349 us 24,691 us 15,527 us +22.9% +95.5%
bs=100 sw=10 sl=64 throughput 1,218 tuples/sec 1,262 tuples/sec 1,371 tuples/sec -3.5% -11.2%
bs=100 sw=10 sl=64 MB/s 0.743 MB/s 0.77 MB/s 0.837 MB/s -3.5% -11.2%
bs=100 sw=10 sl=64 p50 81,109 us 78,082 us 79,910 us +3.9% +1.5%
bs=100 sw=10 sl=64 p95 109,112 us 103,149 us 87,155 us +5.8% +25.2%
bs=100 sw=10 sl=64 p99 109,112 us 103,149 us 106,643 us +5.8% +2.3%
bs=1000 sw=10 sl=64 throughput 1,441 tuples/sec 1,456 tuples/sec 1,415 tuples/sec -1.0% +1.8%
bs=1000 sw=10 sl=64 MB/s 0.879 MB/s 0.889 MB/s 0.864 MB/s -1.1% +1.8%
bs=1000 sw=10 sl=64 p50 690,793 us 682,816 us 780,407 us +1.2% -11.5%
bs=1000 sw=10 sl=64 p95 754,434 us 762,659 us 817,814 us -1.1% -7.7%
bs=1000 sw=10 sl=64 p99 754,434 us 762,659 us 848,683 us -1.1% -11.1%
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,429.23,200,128000,466,0.284,21018.66,30348.53,30348.53
1,100,10,64,20,1642.00,2000,1280000,1218,0.743,81109.01,109112.20,109112.20
2,1000,10,64,20,13881.00,20000,12800000,1441,0.879,690792.54,754433.94,754433.94

@github-actions

github-actions Bot commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @Yicong-Huang, @mengw15, @aglinxinyuan
    You can notify them by mentioning @Yicong-Huang, @mengw15, @aglinxinyuan in a comment.

@zuozhiw

zuozhiw commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

I left some comments in this PR, specifically in one of these comments I put a link to otel official demo app written in Java and we should follow official guidelines m.

Ma77Ball added a commit to Ma77Ball/texera that referenced this pull request Jul 16, 2026
…WorkflowMetrics rename

Follow the OTel Java demo patterns instead of custom wrappers (zuozhiw
review):

- WorkflowService: start the run-level span with the standard OTel API,
name it WorkflowService.initExecutionService, and drop the
initExecutionServiceSpanned split so no span is passed as an argument.
The real execution failure is now recorded onto the span from
errorHandler, where it is actually caught.

- TexeraTracer: drop the withSpan wrapper, keeping only the tracer
accessor (single instrumentation scope) and currentContext.

- SpanAttrs: drop the awkward with*/set* setter helpers, keep the
standard label keys and sanitizeFreeText; callers set attributes via the
OTel API.

- Rename TexeraMetrics to WorkflowMetrics, document that this facade is
only for the workflow-execution cluster, and add an example of calling
the OTel meter API directly at a call site.

Update SpanAttrsSpec and WorkflowMetricsSpec to match.
@Ma77Ball
Ma77Ball requested a review from zuozhiw July 20, 2026 19:36

@zuozhiw zuozhiw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes look good overall, left a few more comments, after fixing them you can go ahead and merge

@Ma77Ball
Ma77Ball marked this pull request as ready for review August 4, 2026 19:18
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has
not had any activity for 30 days. It will be closed in 7 days if no
further activity occurs.

If this PR is still relevant, please:

  • Push new commits or rebase onto the latest main, or
  • Comment with a status update, or
  • Address any open review feedback.

To exempt this PR from auto-close, a maintainer can add the pinned label.
Thank you for your contribution to Apache Texera (incubating)!

@Ma77Ball

Copy link
Copy Markdown
Contributor Author

@parshimers @sshiv012 @zuozhiw re-pinging for review. Scope is unchanged here (backend metrics and tracing emission primitives); this is PR 2 of the kept three-PR instrument-and-export stack (#5375 to #5377). Could you re-review when you get a chance? Thanks.

@zuozhiw zuozhiw left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the setup-error recording below: a compilation failure can reach the UI without being recorded as an error in the setup span. Add focused tests for a synchronous compilation failure and a callback arriving after setup has ended.

For follow-up tracing work, I need connected coverage across REST, WebSocket commands, the execution engine, Java/Scala workers, and Python workers. For example, when a Python operator fails after a user starts a workflow over WebSocket, we should be able to follow that command through the engine to the failing worker in one trace. A setup-only span cannot explain that failure or where the execution spent its time.

This can span multiple PRs. Please track a follow-up covering:

  • Spans for incoming/outgoing HTTP requests and meaningful WebSocket commands.
  • A workflow execution span lasting until completion, failure, or cancellation, with child spans for setup and worker operations.
  • Standard W3C trace context (trace and parent-span IDs) carried through engine RPC/messages and the JVM/Python transport, and restored around asynchronous work.

AsyncRPCClient/AsyncRPCServer and the Python proxy are useful central places to implement propagation. Add workflow/execution/operator/worker IDs to the relevant spans and logs. An eventual acceptance test should follow one execution across these layers, including a Python failure, and check that concurrent executions do not share context. We do not need a span per tuple.

@Ma77Ball
Ma77Ball force-pushed the obs/pr2/backend-emit branch 4 times, most recently from be6cf32 to 53455f5 Compare October 24, 2026 03:59
@Ma77Ball
Ma77Ball requested a review from zuozhiw October 24, 2026 04:00

@zuozhiw zuozhiw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good to merge, please fix the CI

@Ma77Ball
Ma77Ball force-pushed the obs/pr2/backend-emit branch 2 times, most recently from 6b73e5a to bb3bfc4 Compare October 26, 2026 05:55
@github-actions github-actions Bot removed dependencies Pull requests that update a dependency file ci changes related to CI infra platform Non-amber Scala service paths labels Oct 26, 2026
@Ma77Ball
Ma77Ball force-pushed the obs/pr2/backend-emit branch 3 times, most recently from 5379812 to 378ce86 Compare October 27, 2026 00:02
Build on the logging foundation (PR 1) with the backend emit path: workflow lifecycle metrics and a run-level setup trace span, plus the tracing/metrics primitives they use. This is PR 2 of the observability stack.

Primitives (common/observability):
- TexeraTracer: lazy accessor for the process tracer off GlobalOpenTelemetry.
- SpanAttrs: typed AttributeKey constants so span attributes use standard keys rather than ad hoc strings.
- WorkflowMetrics: the OTel instruments (start/completion/failure/cancellation counters and run-duration histogram) keyed by workflow kind.
- TraceparentValidator: validates W3C traceparent headers before use.

Emit path (amber):
- WorkflowMetricsRecorder: single owner of the metric instruments. init() wires them once; onStart stamps a run's start; onStateChange records terminal counters and duration exactly once on the first transition into a terminal state (idempotent, safe to call on every transition).
- WorkflowService.initExecutionService runs inside a run-level setup span so setup-path logs carry its trace id. The span covers only the synchronous setup; synchronous setup failures are recorded on it in the catch block, and the span is ended in finally. The async errorHandler deliberately does not touch the span: it is invoked after setup returns and the span has ended, so the failure is surfaced through the metadata store instead.
- ExecutionStateStore.updateWorkflowState is the single chokepoint that feeds every state transition to WorkflowMetricsRecorder.onStateChange.
- ComputingUnitMaster initializes the recorder at startup.

All observability sources live under common/observability (the module from PR 1); the tracing/metrics classes are not duplicated into common/config.

Tests: WorkflowMetricsSpec, SpanAttrsSpec, and TraceparentValidatorSpec, plus TexeraTracerSpec (the tracer accessor and current-context passthrough) and WorkflowMetricsRecorderSpec (the state-to-metric mapping against an in-memory meter: starts increment the start counter, COMPLETED and FAILED record a completion and a duration sample, KILLED records a cancellation with no duration, and non-terminal or already-terminal transitions record nothing).

Review follow-ups addressed: span attributes use SpanAttrs keys instead of plain strings; the error handler no longer records onto a span that may have already ended (documented and handled via the metadata store).

Stacked on PR 1 (obs/pr1/foundations).
@Ma77Ball
Ma77Ball force-pushed the obs/pr2/backend-emit branch from 378ce86 to b903c94 Compare October 27, 2026 00:37
@github-actions github-actions Bot added the dependencies Pull requests that update a dependency file label Oct 27, 2026
@zuozhiw
zuozhiw added this pull request to the merge queue Oct 27, 2026
Merged via the queue into apache:main with commit d70fc72 Oct 27, 2026
32 checks passed
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Oct 28, 2026
…#5377)

### What changes were proposed in this PR?
Provides the local deployment wiring that receives and stores telemetry.
Off by default and isolated from the application services.
- Adds an OpenTelemetry Collector configuration and wires it into the
single-node `docker-compose` stack and the Kubernetes Helm chart.
- Adds the Parca server configuration and the Parca eBPF agent for
continuous profiling.
- Adds the observability backends to the single-node `.env` and
`docker-compose` as opt-in compose profiles; `COMPOSE_PROFILES` is empty
by default, so `docker compose up` runs only core Texera.
- Infrastructure only; the application runs unchanged whether or not
these services are started.
### Any related issues, documentation, or discussions?
Closes: apache#5369
Part of apache#4070. Stacked on apache#5376.
### How was this PR tested?
- Configuration-validation specs for the collector and Parca config
(`ObservabilityComposeSpec`, `ParcaConfigSpec`); 24 tests pass.
- `sbt scalafmtCheckAll` passes; the build runs in this PR's CI.
### Was this PR authored or co-authored using generative AI tooling?
Co-authored with Claude Opus 4.8 in compliance with ASF policy.

Co-authored-by: Zuozhi Wang <[email protected]>
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Nov 25, 2026
### What changes were proposed in this PR?

Remove unused code from the Scala sources and tests of the Amber engine
and web server, `workflow-core`, `workflow-operator`, `observability`
and the notebook-migration service, and narrow the database reads of the
account, notification, dashboard-search, Hub and Jupyter-registration
lookups to the columns and rows they use (**+285/-316 lines**).
Production behavior does not change. Two CSV tests that are named for
multi-line data now read the multi-line file.

**Unused code**

- **Unused bindings:** pattern, `catch` and callback bindings that
nothing reads become `_` in `ClusterListener`, `DeadLetterMonitorActor`,
`Utils`, `SequentialRecordStorage`, the argument parsers of
`ComputingUnitMaster` and `ComputingUnitWorker`, `WebsocketInput`,
`WorkflowWebsocketResource`, `AiAssistantManager`, `ExecFactory`,
`VirtualIdentityUtils`, `URLFetchUtil` and `HtmlVizOpDesc`. The two
argument parsers end in `case _`, since `case Nil` already takes the
empty list.
- **`S3StorageClient.uploadObject`:**
- `readChunk` uses a plain `while` loop instead of assigning inside the
loop condition.
- The parts upload in a `while` loop that adds each `CompletedPart` to
the Java list the SDK takes. Before, an `Iterator` of `(partNumber,
size)` tuples became a Scala `List` and then went back through
`.asJava`.
- Each part is copied out of the reused buffer once and streamed from
that copy. `buffer.take` and `RequestBody.fromBytes`, which calls
`Arrays.copyOf` itself, copied it twice. The content provider gives each
SDK attempt a fresh stream over the same bytes.
- Part numbers, upload order, part sizes, the `application/octet-stream`
content type and the read of the next chunk after each upload are
unchanged.
- **`SQLSourceOpExec.fetchBatchByBoundary`:** returns the result of the
type `match` as a `val` instead of overwriting a `var` that starts as
`null`.
- **Worker statistics:** `StatisticsManager.getStatistics` drops the
executor parameter it has not read since its sink-operator check went
away. `DataProcessor` and both statistics specs stop passing an executor
to it.
- **Telemetry:** `WorkflowMetricsRecorder` drops a `LazyLogging` it
never logs with, and `WorkflowMetrics` drops the `Cancelled` outcome and
the `Unknown` workflow kind that nothing records.
- **Scan sources:** `SkippedRowReporter` drops its uncalled `count`, and
`ArrowSourceOpExec` drops a batch counter it only increments.
- **Arrow Flight benchmark:** sorts each run's latencies once, instead
of once per percentile.
- **Test helpers:**
- `DPThreadSpec.awaitCond` drops its unused default budget, and the
spec's callbacks name their unused argument `_`.
- `ExternalAuthProvisionerSpec`'s `seedUser` and `seedUserWithEmail`
drop the `avatar` parameter that no test passes.
- `DictionaryMatcherOpExecSpec.withExecutor`, `HashJoinOpSpec.tuple` and
the tuple builders of `IntervalOpExecSpec` drop defaults that every
caller overrides.
- `PythonWorkerPool` starts its stdout and stderr reader threads without
keeping the references it never reads.
- **Test fixtures:**
- `TestOperators` drops `asterixDBSourceOpDesc`, a descriptor for the
AsterixDB server at `ipubmed4.ics.uci.edu` that only its own
`TestOperatorsSpec` case still built. It also drops the `multiLine`
parameter that `getCsvScanOpDesc` never read.
- `headerlessSmallMultiLineDataCsvScanOpDesc` reads
`country_sales_headerless_small_multi_line.csv` again, so
`DataProcessingSpec`'s headerless multi-line case runs on multi-line
data.
- The matching `CSVScanSourceOpDescSpec` case now reads that file too,
and checks the scanned rows: 100 rows of 14 fields, a quoted value with
commas, and two values with line breaks.

**Database reads**

- **Account, login and notification queries:**
- `AuthResource`'s login query selects the user columns and the password
hash, instead of every column of the joined `auth_provider` and `user`
rows. `ExternalAuthProvisioner`'s lookup selects only the user columns.
- The admin-bootstrap and add-email checks in `AuthResource`, the
duplicate-email check in `AdminUserResource` and
`UserResource.isJoiningReasonRequired` read one column, or use
`selectOne`, instead of a full user row.
- `GmailResource` reads only the requester's name and the admins' email
addresses, compiles its email regex once, and passes the subject and the
domain-suffixed content to `createMimeMessage` instead of copying the
`EmailMessage`.
- **Dashboard search:**
- `searchAllResources` builds its results in one pass over the first
`count` rows. Before, it built a list of entries, filtered out the
omitted ones, and scanned the list again for `hasMismatch`.
- `getOrderFields` drops the `case None` branch and the private
`getColumnField` with its `case _ => null`, which its regex makes
unreachable, and compiles the regex once.
- `WorkflowSearchQueryBuilder` builds its access condition as a `val`
instead of overwriting a `DSL.trueCondition()` initializer.
`VersionedResourceSearchQueryBuilder` drops a `getGroupByFields`
override that returns the base default.
- `VersionedResourceTables.hydrate` stops pairing each entry with a
resource ID that every caller discarded, drops `idOf`, and reads the
owner email from the record without building a `User` POJO.
- **Hub (`HubResource`):**
- The versioned-resource lookup selects the resource columns, the owner
email and the privilege that `hydrate` reads, instead of every joined
column. `VersionedResourceTables.hydrationFields` defines that list next
to `hydrate`, because a query that left a column out would get a `null`
email or privilege without an error.
- `isLikedHelper` collects the liked IDs with `fetchSet`. Like/unlike
and clone check for an existing row with `fetchExists` instead of
fetching it, and like/unlike no longer goes through the batch helper.
- `getCounts` reuses each entity type's request group, and drops the
zero entries it added for missing view counts, since the lookup already
defaults to 0.
- **Notebook migration:** `NotebookMigrationResource` stops selecting
the notebook ID it never reads, and drops `JSONB` casts that its typed
fields make redundant. `JupyterEndpointResolver` selects the two
registration URLs instead of a full `user_jupyter` row, and
`JupyterProvisioner` derives a healthy registration's token once instead
of twice.

**Tests for rewritten paths no test reached**

- `DatasetSearchQueryBuilderSpec` runs a dataset search over a dataset
that lakeFS rejects, and expects it left out with `hasMismatch` set.
- `HubResourceSpec` fetches such a dataset by ID and expects it dropped.
- `AdminUserResourceSpec` moves a user to an address no other account
uses.

| Event | PR / Commit |
| --- | --- |
| Introduced by | Amber engine and web server: apache#945 (2021-01-05), apache#1101
(2021-05-03), apache#1387 (2022-02-10), apache#1381 (2022-05-13), apache#1671
(2022-11-07), apache#1677 (2022-11-07), apache#2060 (2023-07-14), apache#2529
(2024-03-29), apache#2570 (2024-04-07), apache#2808 (2024-09-02); account and
notification queries: apache#3080 (2024-11-19), apache#3393 (2025-04-29), apache#3440
(2025-06-08), apache#4185 (2026-02-16), apache#7055 (2026-08-10), apache#7758
(2026-08-21), apache#7639 (2026-08-30), apache#7978 (2026-08-31); dashboard search
and Hub: apache#2358 (2024-02-23), apache#2838 (2024-09-25), apache#3252 (2025-02-09),
apache#3446 (2025-05-26), apache#3442 (2025-06-28), apache#3519 (2025-07-09), apache#7928
(2026-08-26), apache#7930 (2026-09-01), apache#8890 (2026-10-27); `workflow-core`:
apache#2271 (2024-01-18), apache#3183 (2024-12-31), apache#4067 (2025-11-25);
`workflow-operator`: apache#1013 (2021-02-11), apache#1866 (2023-03-23), apache#3139
(2024-12-06), apache#3186 (2024-12-31), apache#6947 (2026-10-02); `observability`:
apache#5376 (2026-10-27); notebook migration: apache#5258 (2026-06-24), apache#8032
(2026-09-03); tests and benchmark: apache#1044 (2021-02-25), apache#1083
(2021-04-25), apache#1227 (2021-07-25), apache#2254 (2023-12-13), apache#2302
(2024-02-05), apache#3425 (2025-05-26), apache#4836 (2026-05-03), apache#5439
(2026-06-06), apache#5557 (2026-06-11), apache#6077 (2026-07-03), apache#7116
(2026-07-31), apache#7207 (2026-08-14), apache#7870 (2026-08-23), apache#7875
(2026-08-31), apache#9534 (2026-11-19), apache#9518 (2026-11-21) |
| Usage removed by | AsterixDB fixture: apache#1118 (2021-05-11, `Disable
dependent tests with AsterixDB`) commented out its only test use, which
apache#3294 (2025-03-04) deleted; multi-line fixture: apache#3111 (2024-11-26,
`Update amber to depend on sub projects`) pointed
`headerlessSmallMultiLineDataCsvScanOpDesc` at the single-line file;
`awaitCond`'s default budget: apache#9534 (2026-11-19, `test(amber): share
engine and service test fixtures`) routed its last callers through a
helper that always passes one; `getStatistics`' executor parameter:
apache#3312 (2025-03-12, `Remove Sink Operator in the Backend`) dropped its
only read, the sink-operator check; everything else: unused or redundant
since introduction |

As of 2026-11-24, the AsterixDB fixture has had no test use for over 5
years, and the headerless multi-line CSV fixture has read single-line
data for about 12 months.

### Any related issues, documentation, discussions?

Closes apache#9680.

### How was this PR tested?

The first commit (`cb95cd29b7`) ran on its base, `main` at `de3f021dec`.
The second commit ran on this branch before it (`2e980903c8`, after
merging `main`) and after it, the third likewise on `dee7711a88`, the
fourth on `3870a2da97`, and the fifth on `4c244837bf`. Both used Windows
11, JDK 17, `UDF_PYTHON_PATH` set to Python 3.12, and Docker for the
RustFS container that `S3StorageClientSpec` starts. The e2e case uses
the Hadoop Iceberg catalog because no REST catalog runs on this machine:

```bash
WUNUSED='set ThisBuild / scalacOptions += "-Wunused:patvars,params,privates"'
sbt "$WUNUSED" "WorkflowCore/testOnly org.apache.texera.amber.core.executor.CoreExecutorReflectionSpec org.apache.texera.amber.util.VirtualIdentityUtilsSpec org.apache.texera.service.util.S3StorageClientSpec"
sbt "$WUNUSED" "WorkflowOperator/testOnly org.apache.texera.amber.operator.TestOperatorsSpec org.apache.texera.amber.operator.dictionary.DictionaryMatcherOpExecSpec org.apache.texera.amber.operator.hashJoin.HashJoinOpSpec org.apache.texera.amber.operator.intervalJoin.IntervalOpExecSpec org.apache.texera.amber.operator.source.fetcher.URLFetchUtilSpec org.apache.texera.amber.operator.source.fetcher.URLFetcherOpExecSpec org.apache.texera.amber.operator.source.scan.csv.CSVScanSourceOpDescSpec org.apache.texera.amber.operator.source.scan.csv.CSVScanSourceOpExecSpec org.apache.texera.amber.operator.source.sql.* org.apache.texera.amber.operator.visualization.htmlviz.HtmlVizOpDescSpec org.apache.texera.amber.util.python.PythonWorkerPoolSpec"
sbt "$WUNUSED" "WorkflowExecutionService/testOnly org.apache.texera.amber.clustering.ClusterListenerSpec org.apache.texera.amber.engine.architecture.messaginglayer.DeadLetterMonitorActorSpec org.apache.texera.amber.engine.architecture.worker.DPThreadSpec org.apache.texera.amber.engine.common.UtilsSpec org.apache.texera.amber.engine.common.storage.SequentialRecordStorageSpec org.apache.texera.web.ComputingUnitMasterSpec org.apache.texera.web.ComputingUnitWorkerSpec org.apache.texera.web.WebsocketInputSpec org.apache.texera.web.resource.WorkflowWebsocketResourceSpec org.apache.texera.web.resource.aiassistant.AiAssistantManagerSpec org.apache.texera.web.resource.auth.ExternalAuthProvisionerSpec"
sbt "$WUNUSED" "WorkflowExecutionService/testOnly org.apache.texera.web.TexeraWebApplicationSpec org.apache.texera.web.resource.GmailResourceSpec org.apache.texera.web.resource.auth.AuthResourceSpec org.apache.texera.web.resource.auth.ExternalAuthProvisionerSpec org.apache.texera.web.resource.auth.OrcidAuthResourceSpec org.apache.texera.web.resource.dashboard.DashboardResourceSpec org.apache.texera.web.resource.dashboard.DatasetSearchQueryBuilderSpec org.apache.texera.web.resource.dashboard.ModelSearchQueryBuilderSpec org.apache.texera.web.resource.dashboard.UnifiedResourceSchemaSpec org.apache.texera.web.resource.dashboard.VersionedResourceTablesSpec org.apache.texera.web.resource.dashboard.WorkflowSearchQueryBuilderSpec org.apache.texera.web.resource.dashboard.admin.user.AdminUserResourceSpec org.apache.texera.web.resource.dashboard.file.DatasetResourceSpec org.apache.texera.web.resource.dashboard.file.WorkflowResourceSpec org.apache.texera.web.resource.dashboard.hub.EntityTablesSpec org.apache.texera.web.resource.dashboard.hub.HubEntityModelSpec org.apache.texera.web.resource.dashboard.hub.HubResourceSpec org.apache.texera.web.resource.dashboard.user.UserResourceSpec org.apache.texera.web.resource.dashboard.user.workflow.WorkflowPublishSpec org.apache.texera.web.service.WorkflowEmailNotifierSpec"
STORAGE_ICEBERG_CATALOG_TYPE=hadoop sbt "$WUNUSED" "WorkflowExecutionService/testOnly org.apache.texera.amber.engine.e2e.DataProcessingSpec -- -z headerlessMultiLineDataCsv"
sbt "$WUNUSED" Observability/test NotebookMigrationService/test "WorkflowOperator/testOnly org.apache.texera.amber.operator.source.scan.*"
sbt "$WUNUSED" "WorkflowExecutionService/testOnly org.apache.texera.amber.engine.architecture.coordinator.promisehandlers.ConsoleMessageHandlerSpec org.apache.texera.amber.engine.architecture.messaginglayer.WorkerTimerServiceSpec org.apache.texera.amber.engine.architecture.worker.DPThreadSpec org.apache.texera.amber.engine.architecture.worker.DataProcessorRPCHandlerInitializerSpec org.apache.texera.amber.engine.architecture.worker.DataProcessorSpec org.apache.texera.amber.engine.architecture.worker.WorkerSpec org.apache.texera.amber.engine.architecture.worker.WorkflowWorkerSpec org.apache.texera.amber.engine.architecture.worker.managers.StatisticsManagerSpec org.apache.texera.amber.engine.architecture.worker.managers.WorkerManagersSpec org.apache.texera.amber.engine.architecture.worker.promisehandlers.EndChannelHandlerSpec org.apache.texera.amber.engine.architecture.worker.promisehandlers.EndHandlerSpec org.apache.texera.amber.engine.architecture.worker.promisehandlers.FinalizeCheckpointHandlerSpec org.apache.texera.amber.engine.architecture.worker.promisehandlers.StartChannelHandlerSpec org.apache.texera.amber.engine.architecture.worker.promisehandlers.StartHandlerSpec org.apache.texera.amber.engine.common.UtilsSpec org.apache.texera.amber.engine.faulttolerance.CheckpointSpec org.apache.texera.web.observability.WorkflowMetricsRecorderSpec"
sbt "$WUNUSED" "WorkflowExecutionService/testOnly org.apache.texera.web.resource.dashboard.DatasetSearchQueryBuilderSpec org.apache.texera.web.resource.dashboard.DashboardResourceSpec org.apache.texera.web.resource.dashboard.admin.user.AdminUserResourceSpec org.apache.texera.web.resource.dashboard.hub.HubResourceSpec org.apache.texera.web.ComputingUnitMasterSpec org.apache.texera.web.ComputingUnitWorkerSpec"
sbt "$WUNUSED" "WorkflowExecutionService/testOnly org.apache.texera.web.resource.dashboard.DatasetSearchQueryBuilderSpec org.apache.texera.web.resource.dashboard.ModelSearchQueryBuilderSpec org.apache.texera.web.resource.dashboard.VersionedResourceTablesSpec org.apache.texera.web.resource.dashboard.DashboardResourceSpec org.apache.texera.web.resource.dashboard.hub.EntityTablesSpec org.apache.texera.web.resource.dashboard.hub.HubEntityModelSpec org.apache.texera.web.resource.dashboard.hub.HubResourceSpec"
sbt WorkflowCore/scalafmtCheckAll WorkflowOperator/scalafmtCheckAll WorkflowExecutionService/scalafmtCheckAll Observability/scalafmtCheckAll NotebookMigrationService/scalafmtCheckAll "WorkflowCore/scalafixAll --check" "WorkflowOperator/scalafixAll --check" "WorkflowExecutionService/scalafixAll --check" "Observability/scalafixAll --check" "NotebookMigrationService/scalafixAll --check"
```

- JUnit XML, compared per test:
- First commit: the first three test commands and the e2e case run 36
suites that load every file the commit changes, and
`SQLSourceOpExecSpec` calls `fetchBatchByBoundary` for each numeric type
through a mocked JDBC result. All 554 tests pass on `main` and all 553
with the commit. Each test has the same outcome as on `main`; the
missing one is the removed `asterixDBSourceOpDesc` case.
- Second commit: the fourth command runs the 20 suites that load the
account, notification, dashboard-search and Hub code, against an
embedded PostgreSQL. All 525 tests pass before and after the commit,
each with the same outcome.
- Third commit: the sixth and seventh test commands run every
`Observability`, `NotebookMigrationService` and scan-source suite, plus
the worker, statistics, checkpoint and telemetry suites that load the
changed classes. Before and after it, 581 of the 595 tests in these 48
suites pass, each with the same outcome. The other 14 fail on both sides
on this machine: 13 `ParquetScanSourceOpDescSpec` cases need Hadoop's
Windows binaries, and one `FileScanSourceOpDescSpec` case hits a Windows
temp-file lock.
- Fourth commit: the eighth test command runs the six suites it touches.
All 179 tests pass, the three new ones included.
- Fifth commit: the ninth test command runs the seven suites that load
`VersionedResourceTables` or the Hub query. All 182 tests pass.
- On the second commit's head, all 55 suites of the first two rounds
pass, the e2e case included: 1,059 tests.
- `S3StorageClientSpec` runs its 34 cases against RustFS 1.0.0 in
Testcontainers on both sides. They include a 6 MiB upload (a 5 MiB part
and a 1 MiB tail) that downloads back byte for byte, an empty upload,
and the abort when the input stream fails after the first part.
- With the fixture pointed back at `country_sales_headerless_small.csv`,
the strengthened `CSVScanSourceOpDescSpec` case fails: row 8 reads
`Republic of the Congo` instead of `Republic,of,the,Congo`. The
`DataProcessingSpec` case runs the multi-line file through the engine
and gets the same 100 rows that the single-line file gives on `main`.
- scalafmt and scalafix pass on all five touched modules.
- With `-Wunused:patvars,params,privates`, the compiler reports 26
unused names in the files of the first commit on `main`. That commit
removes 24 of them. The other two are `config` and `cr`, which the
`@OnOpen` and `@OnClose` methods of `WorkflowWebsocketResource` need for
the WebSocket API's signatures; they are reported on both.

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 5.5)
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Nov 26, 2026
### What changes were proposed in this PR?

Remove code that nothing uses, or that repeats work already done, across
16 files in the frontend, Amber, the shared config and observability
modules, and the sbt license helper (**+22/−152 lines**). There is no
behavior change.

- **`PresetService`:** `getOperatorPreset`,
`filterOperatorPresetProperties` and the private `ajvStrip` validator
they share have no caller outside their own spec. Their two spec blocks
go with them.
- **`UserConfigService`:** `set` and `delete` return their request
observables, and no caller reads them; `PresetService`, the only caller,
discards both. They now return `void`, so the `shareReplay` carriers and
the `of` import go. Each call still sends its request once and updates
the local dictionary when the request succeeds.
- **Resource registry:** `ResourceDescriptor.setCover` and its dataset
and model implementations have no caller outside the registry's own
spec. The dataset and model pages set a cover through
`DatasetService.updateDatasetCoverImage` and
`ModelService.updateModelCoverImage` directly. The spec drops its
`setCover` call, the matching assertion and the `updateModelCoverImage`
stub, and the workflow descriptor's comment stops naming the hook.
- **`StorageConfig`:** 12 JDBC, Iceberg and S3 name constants that
nothing reads. Every reader, such as `ComputingUnitManagingResource`,
uses the same names from `EnvironmentalVariable`. The four cleanup and
warehouse constants stay, because `StorageConfigSpec` reads them.
- **Telemetry:** `WorkflowMetricsRecorder.init` calls
`WorkflowMetrics.ensureBound()` right after
`setActiveExecutionsSupplier`, which already calls it.
`OtelInit.initialized` only ever holds an `OpenTelemetrySdk`, so it is
now typed that way, and `resetForTest` loses a fallback arm that could
not run.
- **`CollaborationResource`:** the `heartbeat`, `tryLock`, `acquireLock`
and `restoreVersion` patterns bind names that their bodies never read,
so each becomes `_`.
- **Result table:** nothing reads the `#statsRow` template reference.
- **`search-results.component.spec.ts`:** the card-template host imports
`NgTemplateOutlet`, which its template never uses.
- **`TexeraWebApplication`:** drops a commented-out call to
`discardUncommittedChangesOfAllDatasets` and its TODO. That method no
longer exists.
- **`AddMetaInfLicenseFiles`:** drops `import
com.typesafe.sbt.packager.universal.UniversalPlugin.autoImport._`, which
nothing in the helper uses.

| Event | PR / Commit |
| --- | --- |
| Introduced by | `PresetService`: apache#1164 (2022-01-14);
`UserConfigService`: apache#1162 (2021-06-27); resource registry: apache#8299
(2026-08-31); `StorageConfig`: apache#3337 (2025-04-06); telemetry: apache#5375
(2026-10-25) and apache#5376 (2026-10-27); `CollaborationResource`: apache#1427
(2022-02-15); result table: apache#2931 (2024-10-14); search results spec:
apache#6565 (2026-07-20); `TexeraWebApplication`: apache#2391 (2024-02-20),
commented out by apache#2733 (2024-07-15); `AddMetaInfLicenseFiles`: apache#4367
(2026-04-17) |
| Usage removed by | `TexeraWebApplication`: apache#3314 (2025-03-12) deleted
`discardUncommittedChangesOfAllDatasets`. `AddMetaInfLicenseFiles`:
apache#4449 (2026-04-29) removed the last `Universal` reference. Everything
else: unused since introduction. |

As of 2026-11-25:
- No caller has read the `UserConfigService` return values in the more
than 5 years since they were added.
- The two `PresetService` helpers have had no caller outside their spec
for almost 5 years, and the `CollaborationResource` bindings have been
unused for as long.
- The `#statsRow` reference has been unread for over 2 years.
- The commented call has pointed at a deleted method, and the
`StorageConfig` constants have been unread, for over a year and a half
each.
- The Universal import has been unused for almost 7 months.
- The `setCover` hook has had no caller in the almost 3 months it has
existed, and the telemetry duplicates have done nothing in the month
since they were added.

### Any related issues, documentation, discussions?

Closes apache#9695.

### How was this PR tested?

Ran on this branch and on `main` at `d1a0c5e673` (Windows 11; Node 24
with Yarn 4.14.1; JDK 17):

```bash
cd frontend
npx ng test --watch=false --include='**/preset.service.spec.ts' --include='**/user-config.service.spec.ts' --include='**/preset-wrapper.component.spec.ts' --include='**/result-table-frame.component.spec.ts' --include='**/search-results.component.spec.ts' --include='**/resource-registry.service.spec.ts'
npx tsc --noEmit -p src/tsconfig.app.json
npx tsc --noEmit -p src/tsconfig.spec.json
yarn prettier-eslint --list-different $(git diff --name-only --relative origin/main -- src)
yarn eslint $(git diff --name-only --relative origin/main -- src)
cd ..
sbt Config/test Observability/test "WorkflowExecutionService/testOnly org.apache.texera.web.resource.CollaborationResourceSpec org.apache.texera.web.observability.WorkflowMetricsRecorderSpec"
sbt Config/scalafmtCheckAll Observability/scalafmtCheckAll WorkflowExecutionService/scalafmtCheckAll "Config/scalafixAll --check" "Observability/scalafixAll --check" "WorkflowExecutionService/scalafixAll --check"
```

- **Frontend:** the six specs run 199 tests on this branch and 206 on
`main`, all passing. The 7 extra on `main` are the deleted helpers' own
spec cases; every other test keeps its name and outcome. Both
typechecks, prettier-eslint and ESLint pass.
- **Scala:** the `Config` and `Observability` suites and the two Amber
specs run 212 tests, all passing on both sides with the same names and
outcomes. scalafmt and scalafix pass for all three projects.
- Every sbt run compiles the build definition, so
`AddMetaInfLicenseFiles.scala` compiled with and without the import.

To re-check, both commands return no hits on this branch:

```bash
git grep -nwE "getOperatorPreset|filterOperatorPresetProperties|ajvStrip|setCover" -- frontend/src
git grep -nE "ENV_(JDBC|ICEBERG|S3)_" -- common/config/src/main/scala/org/apache/texera/common/config/StorageConfig.scala
```

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 5.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common dependencies Pull requests that update a dependency file engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Observability] Backend metrics and tracing emission primitives

3 participants