Skip to content

Slice 2/5: build(calm-hub): add observability and GitHub-backend dependencies - #3063

Merged
rocketstack-matt merged 5 commits into
mainfrom
slice/3001-s2-observability-deps
Sep 9, 2026
Merged

rocketstack-matt merged 5 commits into
mainfrom
slice/3001-s2-observability-deps

Conversation

@jpgough-ms

@jpgough-ms jpgough-ms commented Sep 8, 2026

Copy link
Copy Markdown
Member

Description

Review history

Went through 4 rounds of review-and-fix before being marked ready:

  1. Comment claimed the test profile disabled both OTEL and Micrometer, but only OTEL was %test.-prefixed — Micrometer's core registry stayed active under mvn test
  2. That same %test. prefix only applies when a test's profile name is literally test — this module has 4 other custom QuarkusTestProfile names, so Micrometer stayed active under mvn -P integration verify too
  3. quarkus.otel.enabled is build-time-fixed — verified via javap against the Quarkus 3.34.7 jars and empirically (packaged one jar, ran it twice with only the env var changed: no toggle effect either way). The originally-documented CALM_OTEL_ENABLED=true production toggle silently never worked in a build-once-deploy-many pipeline. Fixed by switching to quarkus.otel.sdk.disabled, which is genuinely RUN_TIME-scoped — re-verified empirically that the same built jar now responds live to the env var. Micrometer has no equivalent runtime switch (confirmed via javap), so its binder toggles are honestly documented as build-time-only.
  4. Clean — no findings

Type of Change

  • 🔧 Chore (maintenance, dependencies, CI, etc.)

Affected Components

  • CALM Hub (calm-hub/)
  • Dependencies

Testing

  • I have tested my changes locally
  • All existing tests pass — full unit suite (2868 tests) and full Docker-backed integration suite (mvn -P integration verify, 540 tests), both 0 failures
  • Empirically verified the runtime OTel toggle in both JVM mode (uber-jar) and GraalVM native compilation (Docker image against real MongoDB) — same jar/binary, only the env var changed between runs

Checklist

  • My commits follow the conventional commit format
  • I have added tests for my changes (if applicable) — n/a, no new application code
  • My changes follow the project's coding standards

Split from #3001.

@github-actions github-actions Bot added the calm-hub Affects `calm-hub` label Sep 8, 2026
@jpgough-ms jpgough-ms changed the title build(calm-hub): add observability and GitHub-backend dependencies Slice 2/5: build(calm-hub): add observability and GitHub-backend dependencies Sep 8, 2026
@jpgough-ms
jpgough-ms marked this pull request as draft September 8, 2026 10:26
Base automatically changed from slice/3001-s1-ui-polish to main September 8, 2026 16:48
Extracted from #3001. Adds caffeine, jgit, quarkus-scheduler and the
OpenTelemetry/Micrometer stack — all inert until consumed by later
slices. OTEL is env-gated (CALM_OTEL_ENABLED=false by default), so
this changes no runtime behaviour on its own.

Original-PR: #3001
@rocketstack-matt
rocketstack-matt force-pushed the slice/3001-s2-observability-deps branch from 58a5104 to e03719e Compare September 8, 2026 16:48
The comment said the test profile disables both OTEL and Micrometer,
but only quarkus.otel.enabled was %test.-prefixed — Micrometer's core
registry (and its auto-enabled binders) stayed active during mvn test
despite the stated intent.

Claude-Session: https://claude.ai/code/session_0199XmacMNTrxWL4x5CSXyp1
Comment thread calm-hub/src/main/resources/application.properties Outdated
…e, not just 'test'

quarkus.otel.enabled and quarkus.micrometer.enabled are both build/
run-time-fixed per active profile NAME (the same pitfall the jacoco
comment in this file already documents) — a %test. prefix only
applies when a test's QuarkusTestProfile.getConfigProfile() is
literally "test". This module has four other custom profile names
(integration-test, nitrite-integration-test, secure, proxy-auth), so
both properties stayed enabled under mvn -P integration verify despite
the previous fix. Verified: full integration suite (540 tests) still
passes with all profiles now suppressed.

Claude-Session: https://claude.ai/code/session_0199XmacMNTrxWL4x5CSXyp1
Comment thread calm-hub/src/main/resources/application.properties Outdated
Comment thread calm-hub/src/main/resources/application.properties Outdated
…y time

quarkus.otel.enabled is build-time-fixed (verified via javap against
the Quarkus 3.34.7 jars: OTelBuildConfig.enabled() is
BUILD_AND_RUN_TIME_FIXED). Empirically confirmed the bug: packaging
with CALM_OTEL_ENABLED unset (default false) and then running the
same jar with CALM_OTEL_ENABLED=true at runtime produced zero OTel
activity — the env var was silently ignored either direction, despite
the adjacent comment claiming a deploy-time toggle. In a build-once-
deploy-many pipeline this meant OTel could never actually be turned on
without rebuilding the artifact.

Fixed by always compiling the extension in (quarkus.otel.enabled=true)
and gating it via the genuinely RUN_TIME-scoped
quarkus.otel.sdk.disabled instead, defaulting to disabled. Renamed the
env var to CALM_OTEL_DISABLED (inverted polarity to match) since the
old CALM_OTEL_ENABLED name described a toggle that never worked;
nothing in the tree references it yet.

Verified empirically: packaged an uber-jar once, then ran it twice
with only the env var changed — CALM_OTEL_DISABLED unset produced no
OTel activity, CALM_OTEL_DISABLED=false produced live OTLP export
attempts (connection-refused, since nothing was listening — proving
the SDK was actually active). Full unit (2868) and integration (540)
suites still pass.

Micrometer has no equivalent runtime-mutable switch (confirmed via
javap: its binder .enabled properties are nested under the same
BUILD_AND_RUN_TIME_FIXED root as the master switch, and the runtime-
scoped HttpServerConfig/HttpClientConfig classes carry no enabled
field) — updated the comment to say so honestly rather than implying
a deploy-time toggle Quarkus doesn't provide for it.

Claude-Session: https://claude.ai/code/session_0199XmacMNTrxWL4x5CSXyp1
@jpgough-ms

Copy link
Copy Markdown
Member Author

Native-compiled smoke test, run per request — confirming the runtime toggle actually holds under GraalVM native compilation, not just JVM mode:

  • ../mvnw package -Dnative -Dquarkus.native.container-build=trueBUILD SUCCESS in 2:49, no reflection/JNI registration errors from the new deps (caffeine, jgit, quarkus-scheduler, opentelemetry, micrometer). 121.57MB binary.
  • Built Dockerfile.native, ran the same image against a real MongoDB container twice, changing only the env var:
    • Default: zero OTel export activity
    • CALM_OTEL_DISABLED=false: live OTLP export attempts (connection-refused, since nothing was listening — proof the SDK was genuinely active)
  • Confirmed the native binary actually serves traffic: GET /q/swagger-ui → 302, no-auth mode granting the request correctly, Installed features lists both opentelemetry and micrometer.

Same result as the JVM-mode verification in 33d6c9b — the fix holds under native compilation.

@jpgough-ms
jpgough-ms marked this pull request as ready for review September 8, 2026 18:23
… caffeine jar

Caffeine builds its cache implementation classes reflectively.
quarkus-caffeine supplies the native-image reflection config for
that; the bare com.github.ben-manes.caffeine:caffeine jar would only
surface this as a native build failure, and calm-hub's native image
builds don't run in PR CI. The extension pulls the same caffeine jar
in transitively, so nothing else changes.
@rocketstack-matt
rocketstack-matt merged commit 2dcc347 into main Sep 9, 2026
23 checks passed
@rocketstack-matt
rocketstack-matt deleted the slice/3001-s2-observability-deps branch September 9, 2026 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

calm-hub Affects `calm-hub`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants