Repository navigation
feat(observability): deployment (OTel collector + Parca/eBPF) - #5377
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5377 +/- ##
=========================================
Coverage 91.97% 91.98%
Complexity 5083 5083
=========================================
Files 1281 1281
Lines 55807 55824 +17
Branches 7076 7077 +1
=========================================
+ Hits 51330 51347 +17
Misses 2734 2734
Partials 1743 1743
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
| config | throughput | MB/s | latency | max Δ latest / 7d | |
|---|---|---|---|---|---|
| 🔴 | bs=10 sw=10 sl=64 | 430 | 0.263 | 21,604/33,416/33,416 us | 🔴 +20.8% / 🔴 +142.6% |
| 🔴 | bs=100 sw=10 sl=64 | 937 | 0.572 | 105,078/139,643/139,643 us | 🔴 +12.6% / 🔴 +49.9% |
| 🔴 | bs=1000 sw=10 sl=64 | 1,124 | 0.686 | 882,567/1,059,116/1,059,116 us | 🔴 +14.0% / 🔴 +20.2% |
Baseline details
Latest main 569f721 from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---|---|---|---|---|
| bs=10 sw=10 sl=64 | throughput | 430 tuples/sec | 482 tuples/sec | 941.58 tuples/sec | -10.8% | -54.3% |
| bs=10 sw=10 sl=64 | MB/s | 0.263 MB/s | 0.294 MB/s | 0.575 MB/s | -10.5% | -54.2% |
| bs=10 sw=10 sl=64 | p50 | 21,604 us | 17,891 us | 10,991 us | +20.8% | +96.6% |
| bs=10 sw=10 sl=64 | p95 | 33,416 us | 32,627 us | 13,776 us | +2.4% | +142.6% |
| bs=10 sw=10 sl=64 | p99 | 33,416 us | 32,627 us | 16,872 us | +2.4% | +98.1% |
| bs=100 sw=10 sl=64 | throughput | 937 tuples/sec | 982 tuples/sec | 1,264 tuples/sec | -4.6% | -25.9% |
| bs=100 sw=10 sl=64 | MB/s | 0.572 MB/s | 0.599 MB/s | 0.772 MB/s | -4.5% | -25.9% |
| bs=100 sw=10 sl=64 | p50 | 105,078 us | 101,606 us | 86,073 us | +3.4% | +22.1% |
| bs=100 sw=10 sl=64 | p95 | 139,643 us | 123,964 us | 93,135 us | +12.6% | +49.9% |
| bs=100 sw=10 sl=64 | p99 | 139,643 us | 123,964 us | 111,124 us | +12.6% | +25.7% |
| bs=1000 sw=10 sl=64 | throughput | 1,124 tuples/sec | 1,139 tuples/sec | 1,304 tuples/sec | -1.3% | -13.8% |
| bs=1000 sw=10 sl=64 | MB/s | 0.686 MB/s | 0.695 MB/s | 0.796 MB/s | -1.3% | -13.8% |
| bs=1000 sw=10 sl=64 | p50 | 882,567 us | 880,120 us | 841,986 us | +0.3% | +4.8% |
| bs=1000 sw=10 sl=64 | p95 | 1,059,116 us | 929,299 us | 881,107 us | +14.0% | +20.2% |
| bs=1000 sw=10 sl=64 | p99 | 1,059,116 us | 929,299 us | 918,208 us | +14.0% | +15.3% |
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,464.71,200,128000,430,0.263,21604.20,33416.00,33416.00
1,100,10,64,20,2134.16,2000,1280000,937,0.572,105077.89,139642.74,139642.74
2,1000,10,64,20,17798.89,20000,12800000,1124,0.686,882566.74,1059115.83,1059115.83
Automated Reviewer SuggestionsBased on the
|
zuozhiw
left a comment
There was a problem hiding this comment.
left some comments, please fix them, I clicked "approve" so that you can feel free to merge this PR after fixing these commments, because this is a env setup PR, please make sure to carefully make AI actually test these configurations and make sure they work
apart from that I have some reservations about ebpf, it's more sensitive than application level log/traces/metrics. Furthermore, ebpf is normally used for very advanced diagnostics and profiling, and seems a bit heavy for our use case. But again feel free to try it and see if we see it being useful.
Also one more missing piece of the telemetry data is host level metrics, e.g. cpu, memory being the most important ones, please check how we can collect them, e.g. I think otel has some host metrics receiver, please check that, also check if docker / k8s expose metrics and how we can get them.
Another missing piece is database related metrics. E.g. database load, it would also be nice to consider them, but maybe in future PRs.
eea0a7a to
3523acd
Compare
7dc58ab to
45448ad
Compare
3e2e016 to
68d56d4
Compare
Add the local deployment wiring that receives, stores, and visualizes the telemetry emitted by PR 2: an OpenTelemetry Collector, per-signal backends, and a Grafana UI, for both the single-node docker-compose stack and the Kubernetes Helm chart. Infrastructure only; the application runs unchanged whether or not these services are started. This is PR 3 of the observability stack. Single-node compose (bin/single-node, bin/observability): - otel-collector as the single OTLP ingress, routing logs to Loki over OTLP HTTP, metrics to VictoriaMetrics via prometheusremotewrite, and traces to Jaeger over OTLP; the collector config caps OTLP message size and bounds memory via memory_limiter. - Grafana as the dashboard/UI, pre-provisioned (bin/observability/grafana/provisioning) with datasources for Loki, VictoriaMetrics (Prometheus-compatible query API), and Jaeger, so operators get log search, metric dashboards, and trace views without a Texera-built UI. - Loki as the log store (bin/observability/loki/config.yaml, OTLP ingest on /otlp), VictoriaMetrics as the metric store, Jaeger as the trace store, and Parca server plus eBPF agent for continuous profiling (bin/observability/parca). - A one-shot victoriametrics-init container chowns the metrics volume to VictoriaMetrics's non-root uid before it starts, so a freshly created (root-owned) named volume does not crash-loop the read-only VM container; it is idempotent on an existing volume. - Each signal is its own compose profile and is OFF by default: COMPOSE_PROFILES is empty, so observability is opt-in, and Grafana has its own observability-grafana profile. - Every observability host port, including the Grafana UI, binds to loopback (127.0.0.1); nothing is published on 0.0.0.0. Emission is gated by OTEL_SDK_DISABLED (default disabled), so nothing is emitted unless an operator opts in alongside the collector profile. Kubernetes Helm chart (bin/k8s): - Templates for the collector, Grafana, Loki, Jaeger, and VictoriaMetrics under templates/base/observability, plus values.yaml knobs and an install.sh helper. Grafana is a ClusterIP service with its datasources provisioned from a ConfigMap. - Service deployments gain the OTLP endpoint wiring. Licensing: the Collector, VictoriaMetrics, Jaeger, and Parca are Apache-2.0 and form the shipped reference stack. Grafana and Loki are AGPLv3 optional operator-run components, documented as such in bin/observability/README.md and not bundled in any Texera release artifact. Docs: bin/observability/README.md describes the stack, how to reach Grafana at http://localhost:3000 with the pre-provisioned datasources, and how to point an external Grafana or OpenSearch at the same endpoints instead. Tests: ObservabilityComposeSpec and ParcaConfigSpec are string-level smoke tests over the compose, collector, and Parca config. They pin the image versions, assert the opt-in default and loopback binding for every port, and check the collector routes logs to Loki, metrics to VictoriaMetrics, and traces to Jaeger. bin/observability/smoke_test.py is a runtime routing check meant to run against a live stack: it pushes a log, a metric, and a trace per service through the collector over OTLP and asserts each reaches its correct backend (Loki, VictoriaMetrics, Jaeger) attributed to the emitting service, plus an isolation check that one service's data is not mis-attributed to another; it exits non-zero on a routing regression. Stacked on PR 2 (obs/pr2/backend-emit).
68d56d4 to
5841c2e
Compare
The merge with main lost what apache#5377 added to the compose bundle step: without bin/observability/ and the ../observability rewrite, the bundle's observability profiles point outside it. BuildKit is pinned because image digests can change between its versions, which would keep voters from reproducing the published images. Co-Authored-By: Claude Opus 5.5 <[email protected]>
) ### What changes were proposed in this PR? Remove unused imports, bindings, helpers and fields, and settings that repeat a default or another entry, from the Amber Python runtime, the Python test resources of the workflow compiler and operators, the `bin/` licensing, local-dev and observability scripts, repository configuration, and three GitHub workflows (**+102/-172 lines**). There is no behavior change. - **Amber Python runtime:** `StatisticsManager` uses `defaultdict` instead of the deprecated `typing.DefaultDict`, and `BroadcastPartitioner` builds its batch with `[]`. `LargeBinaryOutputStream` raises and documents `OSError` (which `IOError` aliases), wraps its best-effort cleanup delete in `contextlib.suppress`, and drops the `pass` after `flush`'s docstring. - **Operator verification test resources:** `py_op_driver.py` drops ten `pytexera` imports and `RAW_TYPE_MAPPING` that it never reads. User code runs in its own namespace seeded by `from pytexera import *`, so the "used dynamically" note on those imports did not hold. `compare.py` drops the uncalled `_string_columns` helper and two dict copies of `double_kinds_a`/`double_kinds_e`, and `hf_parse_probe.py` drops unused `io` and `re` imports. Quoted annotations, `open(..., "r")`, `startswith` plus a slice, and a placeholder-free f-string take their plain forms here and in `standalone_worker.py`, `py_compile_worker.py` and `hf_binary_value_probe.py`. - **`bin/` scripts:** the licensing tools use a tuple `startswith`, read the one regex group they need instead of unpacking all four, print plain strings where f-strings had no placeholders, return a `bool` expression directly, drop annotation quotes under `from __future__ import annotations`, use `removesuffix`, and name unused loop values `_`. Two licensing tests drop `# noqa: E402` comments that suppress nothing under Ruff, and `test_local_dev_tui.py` drops the never-passed `version` parameter of `_seed_jvm_layout` together with the docstring sentence about a jar it never wrote. `bin/observability/smoke_test.py` stops returning an unread status from `_post`, builds the trace id from one `uuid4().hex` (the first 32 hex digits of two concatenated ones were always the first), and drops a `leaked = False` that both branches of the following `try` overwrite. - **Repository configuration:** `amber/pyproject.toml` drops `line-length = 88` and `max-complexity = 10`, which are Ruff's defaults (and `C901` is not selected). `.dockerignore` drops a root `user-resources/` entry that its first rule, `**/user-resources/`, already covers. `bin/fix-format.sh` drops the `""` case that `TARGET="${1:-all}"` makes unreachable, and `bin/frontend-proto-gen.sh` drops a `--proto_path` that repeats its `-I`. `bin/k8s/templates/aws/.gitkeep` goes, since the folder holds `s3-credentials-secret.yaml`. `bin/y-websocket-server/package.json` drops npm-init's `main` and placeholder `test` script (the image runs `npx y-websocket`), and a `bin/observability/docker-compose.yml` comment stops pointing at a `start_app.sh` that the repository does not have. - **GitHub workflows:** `comment-commands.yml` drops `github.event_name == 'issue_comment' && github.event.action == 'created'` from three job conditions, because the workflow only runs on `issue_comment: [created]`. `pr-assignment.yml` drops a `|| ''` that follows a `typeof ... === 'string'` guard. `benchmarks-pr-comment.yml` stops storing per-benchmark commit and date, a sample count and delta labels that nothing reads, takes each row's status from the deltas it already computed instead of a second `deltaInfo` pass, reuses each metric's 7-day delta, and builds the PR-only CSV table only when there is no comparison to show. | Event | PR / Commit | | --- | --- | | Introduced by | Amber Python runtime: apache#1891 (2023-05-01), apache#3262 (2025-02-18), apache#4100 (2025-12-15), apache#4707 (2026-05-03), apache#5249 (2026-06-06), apache#8260 (2026-11-18); test resources: apache#7207 (2026-08-14), apache#8617 (2026-10-15), apache#9306 (2026-11-10), apache#8357 (2026-11-17), apache#8358 (2026-11-18), apache#8359 (2026-11-19); `bin/` scripts: apache#4387 (2026-04-29), apache#4668 (2026-05-02), apache#4693 (2026-05-02), apache#4711 (2026-05-03), apache#5057 (2026-05-15), apache#5417 (2026-06-10), apache#5961 (2026-06-28), apache#5377 (2026-10-28); configuration: apache#3019 (2024-11-20), apache#3335 (2025-03-23), apache#3441 (2025-05-19), apache#3890 (2025-10-14), apache#4005 (2025-10-29), apache#4105 (2025-12-05), apache#5757 (2026-06-24); workflows: apache#4885 (2026-05-03), apache#4986 (2026-05-08), apache#5148 (2026-05-22), apache#5557 (2026-06-11), apache#5639 (2026-06-12) | | Usage removed by | `issue_comment` checks: apache#4899 (2026-05-04, `ci: drop the triage label, use is:open no:assignee filter`) moved `/take` out of `issue-triage.yml`, which also ran on `issues` events, into a workflow that only runs on created comments, and apache#4986 and apache#5148 copied the checks into two new jobs; `aws/.gitkeep`: apache#5932 (2026-07-01, `feat(k8s): make app-tier object storage configurable via storage.s3`) added the folder's first template; PR-only CSV table: apache#5639 (2026-06-12, `ci: compare benchmark PRs with main`) shows it only when there is no comparison; everything else: unused or redundant since introduction | As of 2026-11-23, the unread test-resource code is under a week old, the `.gitkeep` placeholder and the unread benchmark fields have been redundant for about 5 months, the `issue_comment` checks for over 6 months, and the duplicate `.dockerignore` entry and `--proto_path` for 20 and 24 months. ### Any related issues, documentation, discussions? Closes apache#9676. ### How was this PR tested? Ran on `525f8ce3fb` and on `main` at `89a492f97e` (Windows 11, Python 3.12 with CI's pinned `ruff` 0.14.7, `pytest` 9.0.3 and `textual` 8.2.8, JDK 17): ```bash cd amber ruff check src/main/python src/test/python ruff format --check src/main/python src/test/python pytest -m "not integration" cd .. ruff check $(git diff --name-only origin/main -- '*.py' ':!amber/') python -m pytest bin/ -v --tb=short sbt "WorkflowCompilingService/testOnly org.apache.texera.amber.translator.verify.ComparatorSpec org.apache.texera.amber.translator.verify.HarnessSpec org.apache.texera.amber.translator.verify.PyOpExecHarnessSpec org.apache.texera.amber.translator.verify.VisualizationJsonComparatorSpec" sbt "WorkflowOperator/testOnly org.apache.texera.amber.operator.huggingFace.codegen.HuggingFaceBinaryValueBehaviorSpec org.apache.texera.amber.operator.huggingFace.codegen.HuggingFaceParseBehaviorSpec org.apache.texera.amber.util.PythonCodeRawInvalidTextSpec" ``` - Ruff: passed on `amber/` (218 files already formatted) and on the 14 changed Python files outside `amber/`. - `pytest -m "not integration"` in `amber/` (JUnit XML): each of the 1,524 tests has the same outcome as on `main`: 1,496 passed, 10 skipped, and the same 18 platform-dependent tests (Iceberg catalog on PostgreSQL and `s3fs`, time zones, object reprs) fail on this Windows machine on both. - `python -m pytest bin/` (JUnit XML): each of the 196 tests has the same outcome as on `main`: 186 passed, and nine `bin/mounter` tests plus `test_stamp_dir_for_matches_shell_sha1`, which assume POSIX paths and shells, fail on Windows on both. - sbt (JUnit XML, `UDF_PYTHON_PATH` set to Python 3.12 because Windows has no `python3`): these seven suites load the edited test resources. `WorkflowCompilingService` passed 52 of 52 in 4 suites and `WorkflowOperator` 11 of 11 in 3 suites, with 0 canceled, the same as on `main`. - Licensing scripts: `concat_license_binary.py` writes byte-identical combined licenses for the Python and frontend images, and `check_binary_deps.py jar` prints byte-identical reports and exit codes for a synthetic lib folder with missing, extra and version-mismatched jars, with and without `--ignore-transitive-version`. - Workflows: the three edited workflows run only from the default branch (`issue_comment`, `pull_request_target` and `workflow_run`), so this PR's CI cannot run them. Each edited `github-script` body ran before and after under Node with recording stubs for `github`, `core`, `fs` and `fetch`, over 496 fixtures (missing or malformed CSV and baseline data, failed API calls, body edits with and without closing references). Every API call, comment body and log line is identical, and a one-line change to each script does show up in its traces. The `comment-commands.yml` conditions differ from `main` only by the two removed checks. - `bash -n` passes on `bin/fix-format.sh` and `bin/frontend-proto-gen.sh`, and the edited YAML, TOML and JSON files parse. - After review, `f84888ca6c` changes only three docstrings in `large_binary_output_stream.py` and inlines one local in `py_op_driver.py`. On it, Ruff passes as above, each of the 1,524 `amber` tests again has the same outcome as on `main`, the four `WorkflowCompilingService` suites pass 52 of 52, and `_jsonify` returns the same strings as on `525f8ce3fb` for seven `BINARY` inputs, with and without the pickle marker. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 5.5)
### What changes were proposed in this PR? Remove code that nothing uses from the workflow persistence service, the dashboard's workflow list, the canvas graph wrapper, a context-menu spec and the Parca deployment files (**+48/−274 lines**). There is no behavior change. - **Workflow search clients:** `WorkflowPersistService.searchWorkflows` and `retrieveWorkflowsBySessionUser` have no caller. apache#1988 removed the last call to the first, and apache#7463 removed the project feature that called the second. Their private response formatter, the unused `WORKFLOW_LIST_URL`, `WORKFLOW_SEARCH_URL` and `WORKFLOW_USER_ACCESS` constants, and the test stub's `searchWorkflows` forwarder go with them, along with their spec cases. - **Dashboard workflow list:** `UserWorkflowComponent` loses five dead pieces. - A private `nameWorkflow` copy that nothing has called since apache#2920 moved ZIP downloads into `DownloadService`, which keeps its own. - An unused `ExecutionMode` import. - An empty `next` handler around a commented-out call. - An unread error argument. - A class comment whose steps name functions the component no longer has, such as `searchWorkflows()`, `synchronousSearch()` and `asyncSearch()`. - **Graph wrapper:** `JointGraphWrapper` loses four unused pieces. - The event-tuple detail, unused since apache#2301 removed the drag stream typed with it. - Exports nothing imports, which become file-local. - A static `_async` helper that only returned `context.async`. - A coeditor argument that `removeCurrentEditing` and `removePropertyChanged` never read; `CoeditorPresenceService` stops passing it. - **Context-menu spec:** `ReactiveFormsModule`, `NzDropDownModule` and `NzModalModule` in its two test beds are not needed. `NzModalService` stays. - **Parca:** `parca-agent.env` sets `PARCA_AGENT_*` variables that the pinned agent never reads; the Compose command already passes every value as a flag. The env file and its `env_file` entry go. The Compose comments, README, `ParcaConfigSpec` and the release-tarball test now point at the command's values. | Event | PR / Commit | | --- | --- | | Introduced by | Workflow search clients: apache#1885 (2023-04-20); `nameWorkflow`: apache#1629 (2022-08-17); graph wrapper: the coeditor argument apache#1676 (2022-10-06), the context helper apache#1433 (2022-02-07); context-menu spec: apache#2901 (2024-10-06); Parca env file: apache#5377 (2026-10-28) | | Usage removed by | `searchWorkflows`: apache#1988 (2023-06-12). `retrieveWorkflowsBySessionUser`: apache#7463 (2026-08-29). `nameWorkflow`: apache#2920 (2024-10-11). Graph event detail: apache#2301 (2024-01-28). Everything else: unused since introduction. | As of 2026-11-25: - The coeditor argument has gone unread for over 4 years, and the search client has had no caller for over 2 years. - The event-tuple detail has been unread for almost 2 years, and `nameWorkflow` uncalled for over a year. - The session-user client has been unused for almost 3 months, and the Parca variables unread for the month since they were added. ### Any related issues, documentation, discussions? Closes apache#9713. ### How was this PR tested? Ran on this branch and on `main` at `f4adf7f588` (Windows 11; Node 24 with Yarn 4.14.1; JDK 17): ```bash cd frontend npx ng test --watch=false --include='**/workflow-persist.service.spec.ts' --include='**/user-workflow.component.spec.ts' --include='**/context-menu.component.spec.ts' --include='**/coeditor-presence.service.spec.ts' --include='**/joint-graph-wrapper.spec.ts' npx tsc --noEmit -p src/tsconfig.app.json npx tsc --noEmit -p src/tsconfig.spec.json npx ngc -p src/tsconfig.app.json --noEmit yarn prettier-eslint --list-different $(git diff --name-only --relative origin/main -- src) yarn eslint $(git diff --name-only --relative origin/main -- src | grep -E '\.(ts|html)$') cd .. sbt "Config/testOnly org.apache.texera.observability.ParcaConfigSpec" Config/scalafmtCheckAll "Config/scalafixAll --check" bash .github/scripts/test_create_release_tarballs.sh (cd bin/single-node && docker compose config -q) ``` - **Frontend:** the five specs run 301 tests on this branch and 304 on `main`, all passing. - The three extra on `main` are the deleted methods' own cases (`searchWorkflows`, `retrieveWorkflowsBySessionUser` and `nameWorkflow`). Every other test keeps its name and outcome. - Both typechecks, the AOT compile, prettier-eslint and ESLint pass. - **Parca:** `ParcaConfigSpec` runs 9 tests, all passing on both sides; four of them now read the Compose command instead of the env file. scalafmt and scalafix pass. The release-tarball regression test passes, and `docker compose config` accepts the single-node file. To re-check, this returns no hits on this branch: ```bash git grep -nwE "searchWorkflows|retrieveWorkflowsBySessionUser|makeRequestAndFormatWorkflowResponse|WORKFLOW_SEARCH_URL|_async|parca-agent\.env" -- frontend/src bin common/config ``` ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 5.5)
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.
docker-composestack and the Kubernetes Helm chart..envanddocker-composeas opt-in compose profiles;COMPOSE_PROFILESis empty by default, sodocker compose upruns only core Texera.Any related issues, documentation, or discussions?
Closes: #5369
Part of #4070. Stacked on #5376.
How was this PR tested?
ObservabilityComposeSpec,ParcaConfigSpec); 24 tests pass.sbt scalafmtCheckAllpasses; 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.