Skip to content

CAMEL-24051: Add observability test-infra module#24689

Merged
Croway merged 4 commits into
apache:mainfrom
Croway:feature/CAMEL-24051-observability-test-infra
Jul 16, 2026
Merged

CAMEL-24051: Add observability test-infra module#24689
Croway merged 4 commits into
apache:mainfrom
Croway:feature/CAMEL-24051-observability-test-infra

Conversation

@Croway

@Croway Croway commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Claude Code on behalf of Croway

New camel-test-infra-observability module providing a local Apache-2.0-only observability stack via camel infra run observability.

Composes 4 containers on a shared Docker network:

  • Prometheus (:9090) — scrapes Camel metrics at :9876/observe/metrics
  • VictoriaTraces (:10428) — receives OTLP traces
  • VictoriaLogs (:9428) — receives OTLP logs
  • Perses (:3000) — dashboard UI, auto-provisioned with Camel project and overview dashboard

Changes

  • New module: test-infra/camel-test-infra-observability/ with 4 container classes, service interface, multi-container orchestrator
  • New export target: --open-telemetry-agent-export=observability enables traces + logs export to the stack
  • Deprecated: --open-telemetry-agent-export=jaeger in favor of otlp (backward compatible)
  • Generalized: OpenTelemetryTracer.exportTarget check accepts any non-empty value instead of hardcoded "jaeger"
  • Fixed: Fork version propagation in Run.java — forked JBang processes now inherit the CLI's catalog version
  • OOB dashboard: Perses auto-provisioned with Camel Overview dashboard (exchanges, throughput, failure rate, processing time, JVM memory/threads/GC, CPU, load average)

Usage

# Start the observability stack
camel infra run observability

# Run a Camel app with full observability (metrics + traces + logs)
camel run MyRoute.java --observe \
  --open-telemetry-agent --open-telemetry-agent-export=observability

Verified

  • Prometheus scrapes Camel metrics (zero-config with --observe)
  • VictoriaTraces receives OTel agent spans (Kafka, JDBC, HTTP auto-instrumented)
  • VictoriaLogs receives logs with trace_id/span_id correlation
  • Perses dashboard shows exchanges, throughput, processing time, JVM metrics
  • Multiple Camel instances supported via --management-port

Test plan

  • camel infra run observability starts all 4 containers
  • camel infra get observability returns JSON with all endpoint URLs
  • camel run --observe sends metrics to Prometheus
  • camel run --observe --open-telemetry-agent --open-telemetry-agent-export=observability sends traces and logs
  • Perses dashboard at :3000/projects/camel/dashboards/overview shows data
  • camel infra stop observability stops all containers
  • --open-telemetry-agent-export=jaeger still works (backward compatible)
  • --open-telemetry-agent-export=otlp works as new generic external export

@github-actions

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • catalog/camel-catalog
  • components/camel-opentelemetry2
  • docs
  • dsl/camel-jbang/camel-jbang-core
  • test-infra
  • test-infra/camel-test-infra-all
  • test-infra/camel-test-infra-observability

🔬 Scalpel shadow comparison — Scalpel: 15 tested, 26 compile-only — current: 12 all tested

Maveniverse Scalpel detected 41 affected modules (current approach: 12).

⚠️ Modules only in Scalpel (29)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-lucene
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-csimple-maven-plugin
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component

Skip-tests mode would test 15 modules (6 direct + 9 downstream), skip tests for 26 (generated code, meta-modules)

Modules Scalpel would test (15)
  • camel-catalog
  • camel-jbang-core
  • camel-jbang-mcp
  • camel-jbang-plugin-mcp
  • camel-jbang-plugin-route-parser
  • camel-jbang-plugin-tui
  • camel-jbang-plugin-validate
  • camel-launcher-container
  • camel-observability-services
  • camel-opentelemetry2
  • camel-test-infra-all
  • camel-test-infra-observability
  • camel-yaml-dsl-validator
  • camel-yaml-dsl-validator-maven-plugin
  • docs
Modules with tests skipped (26)
  • apache-camel
  • camel-allcomponents
  • camel-catalog-console
  • camel-catalog-lucene
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-csimple-maven-plugin
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • dummy-component

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

⚠️ Some tests are disabled on GitHub Actions (@DisabledIfSystemProperty(named = "ci.env.name")) and require manual verification:

  • dsl/camel-jbang/camel-jbang-core: 1 test(s) disabled on GitHub Actions

💡 Manual integration tests recommended:

You modified dsl/camel-jbang/camel-jbang-core. The related integration tests in dsl/camel-jbang/camel-jbang-it are excluded from CI. Consider running them manually:

mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
All tested modules (41 modules)
  • Camel :: All Components Sync point
  • Camel :: Assembly
  • Camel :: Catalog :: CSimple Maven Plugin (deprecated)
  • Camel :: Catalog :: Camel Catalog
  • Camel :: Catalog :: Camel Report Maven Plugin
  • Camel :: Catalog :: Camel Route Parser
  • Camel :: Catalog :: Console
  • Camel :: Catalog :: Dummy Component
  • Camel :: Catalog :: Lucene (deprecated)
  • Camel :: Catalog :: Maven
  • Camel :: Catalog :: Suggest
  • Camel :: Component DSL
  • Camel :: Coverage
  • Camel :: Docs
  • Camel :: Endpoint DSL
  • Camel :: Endpoint DSL :: Support
  • Camel :: Integration Tests
  • Camel :: JBang :: Core
  • Camel :: JBang :: Integration tests
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Main
  • Camel :: JBang :: Plugin :: Edit
  • Camel :: JBang :: Plugin :: Generate
  • Camel :: JBang :: Plugin :: Kubernetes
  • Camel :: JBang :: Plugin :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Testing
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: Kamelet Main
  • Camel :: Launcher
  • Camel :: Launcher :: Container
  • Camel :: Observability Services
  • Camel :: Opentelemetry 2
  • Camel :: Test Infra :: All test services
  • Camel :: Test Infra :: Observability
  • Camel :: YAML DSL
  • Camel :: YAML DSL :: Deserializers
  • Camel :: YAML DSL :: Maven Plugins
  • Camel :: YAML DSL :: Validator
  • Camel :: YAML DSL :: Validator Maven Plugin

⚙️ View full build and test results

@Croway
Croway force-pushed the feature/CAMEL-24051-observability-test-infra branch from 2167c55 to 09fede2 Compare July 15, 2026 10:48
Croway added 2 commits July 16, 2026 15:06
New test-infra module composing Prometheus, VictoriaTraces, VictoriaLogs,
and Perses for local observability via `camel infra run observability`.

- Prometheus scrapes Camel metrics at :9876/observe/metrics (zero-config with --observe)
- VictoriaTraces receives OTLP traces at :10428
- VictoriaLogs receives OTLP logs at :9428
- Perses auto-provisioned with Camel project and overview dashboard at :3000
- New --open-telemetry-agent-export=observability target for traces+logs
- Deprecated --open-telemetry-agent-export=jaeger in favor of otlp
- Generalized OpenTelemetryTracer.exportTarget check to accept any value
- Fixed fork version propagation in Run.java for camel run with OTel agent
- Fix: observability export now treated as external in Run.java (no dead embedded receiver)
- Fix: set camel.opentelemetry2.exportTarget=observability in fork path
- Revert: fork version propagation change (separate concern, separate JIRA)
- Use mirror.gcr.io instead of docker.io for container images
- Add upgrade guide entry for export target changes and new infra command
@Croway
Croway force-pushed the feature/CAMEL-24051-observability-test-infra branch from 09fede2 to 7f4fe80 Compare July 16, 2026 13:06
@Croway
Croway marked this pull request as ready for review July 16, 2026 13:23

@gnodet gnodet 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.

Claude Code on behalf of gnodet

Review — CAMEL-24051: Add observability test-infra module

Nice work, Federico! This adds a well-designed camel-test-infra-observability module composing four containers (Prometheus, VictoriaTraces, VictoriaLogs, Perses) into a local observability stack, along with the CLI wiring (camel run --observability) to use it.

What looks great

  1. Clean export-mode decomposition in Run.java — The three-way split between observability (traces + logs), otlp (traces only, external), and tui (embedded) is well-reasoned. Each mode configures exactly the right set of OTel SDK system properties — notably, otel.logs.exporter=otlp is only set for the observability path.

  2. Smart generalization of OpenTelemetryTracer.exportTarget — Replacing "jaeger".equals(exportTarget) with a null/empty check is forward-compatible. Any future export target works without touching this class again, and tui mode (which never sets exportTarget) is unaffected.

  3. Good adherence to project container-image conventions — Using quay.io and mirror.gcr.io per project rules. The withExtraHost("host.docker.internal", "host-gateway") on Prometheus correctly handles Linux Docker environments.

Items to address

1. FQCN usage in ObservabilityLocalContainerInfraService.java

The loadResource method uses java.nio.charset.StandardCharsets.UTF_8 as a fully qualified class name. Project rules require an import + simple name. The CI OpenRewrite check will flag this and fail the build with uncommitted changes.

// Current:
return new String(is.readAllBytes(), java.nio.charset.StandardCharsets.UTF_8);

// Fix — add import and use simple name:
import java.nio.charset.StandardCharsets;
return new String(is.readAllBytes(), StandardCharsets.UTF_8);

(Note: PrometheusContainer.java already imports and uses StandardCharsets correctly.)

2. Multi-arch container image availability — missing skipITs properties

Per project guidelines: "Verify that the container image is available for the tested architectures (currently amd64, ppc64le and s390x). If not available, use skipITs.ppc64le and skipITs.s390x Maven properties."

  • Perses (persesdev/perses:v0.53.1): only amd64 and arm64no ppc64le, no s390x
  • VictoriaTraces/VictoriaLogs: amd64, arm, arm64, ppc64le, 386no s390x
  • Prometheus: full coverage

The pom.xml should add:

<properties>
    <skipITs.ppc64le>true</skipITs.ppc64le>
    <skipITs.s390x>true</skipITs.s390x>
</properties>

Without this, CI on those architectures will fail when trying to pull images.

3. Network resource leak safety in shutdown()

If any container's stop() throws (e.g., the container crashed or Docker daemon is unreachable), subsequent container stops and network.close() will be skipped. Consider wrapping each stop in try-catch:

@Override
public void shutdown() {
    LOG.info("Stopping observability stack");
    for (var action : List.of(
            (Runnable) persesContainer::stop,
            victoriaLogsContainer::stop,
            victoriaTracesContainer::stop,
            prometheusContainer::stop,
            network::close)) {
        try {
            action.run();
        } catch (Exception e) {
            LOG.warn("Shutdown step failed: {}", e.getMessage());
        }
    }
}

Minor suggestions

  • serviceVersion: null in generated metadata.json — Other entries use actual version strings or "latest". Since this is a multi-container module, null may be expected, but it could confuse catalog API consumers. Consider whether the generator can emit "latest" or a composite version.

  • Hardcoded OTLP endpoint ports in Run.java — The observability export path hardcodes Victoria port numbers (10428, 9428). These match ObservabilityProperties defaults, but extracting them as named constants would make the coupling explicit.

  • Property naming inconsistencyobservability.victoria.traces.port (dot separator) vs observability.victoriatraces.container (no dot). Minor but could confuse users overriding container image names.

CI status

Check Status
build ✅ pass (3m45s)
build (17, false) ⏳ pending
build (25, false) ⏳ pending

Overall this is a solid addition to the test-infra family. The items above are all addressable without rethinking the design.

- Add uiSupported=true to @infraservice annotation
- Add uiUrl() default method returning Perses dashboard URL
- Fix: add observability to externalExport check in Run.java
- Fix: set camel.opentelemetry2.exportTarget=observability in fork path
@Croway
Croway force-pushed the feature/CAMEL-24051-observability-test-infra branch from b848400 to 64e62cc Compare July 16, 2026 13:49
@davsclaus

Copy link
Copy Markdown
Contributor

There are uncommitted changes
HEAD detached at pull/24689/merge
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git restore ..." to discard changes in working directory)
modified: test-infra/camel-test-infra-observability/src/main/java/org/apache/camel/test/infra/observability/services/ObservabilityLocalContainerInfraService.java

- Fix FQCN: import StandardCharsets instead of inline fully qualified name
- Add skipITs.ppc64le and skipITs.s390x (Perses/Victoria images lack these archs)
- Safe shutdown: wrap each container stop in try-catch to prevent resource leaks
@Croway
Croway force-pushed the feature/CAMEL-24051-observability-test-infra branch from 0926d71 to 991e494 Compare July 16, 2026 16:05
@Croway
Croway merged commit 1d06fa0 into apache:main Jul 16, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants