Skip to content

Phase 4: add cloud-native observability and resilience fault-injection demos - #14

Merged
Janaka2 merged 1 commit into
masterfrom
codex/add-opentelemetry-instrumentation-examples
Apr 10, 2026
Merged

Janaka2 merged 1 commit into
masterfrom
codex/add-opentelemetry-instrumentation-examples

Conversation

@Janaka2

@Janaka2 Janaka2 commented Apr 10, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Provide observability-first examples by instrumenting selected patterns with OpenTelemetry (command latency, circuit-breaker metrics, saga correlation).
  • Demonstrate resilience behaviour under fault-injection using Testcontainers + WireMock to show timeouts, partial failures and retry interactions.
  • Ship minimal deployment scaffolding so pattern demos can run in containerized environments (compose + k8s + OTEL collector).

Description

  • Add a new package org.example.cloudnative.observability with ObservedCommandExecutor, ObservedCircuitBreaker, CorrelatedSagaOrchestrator, and CorrelatedSagaStep to emit spans/metrics and propagate correlation IDs.
  • Add tests ObservabilityPatternsTest (in-memory OpenTelemetry spans/metrics assertions using InMemorySpanExporter/InMemoryMetricReader) and ResilienceFaultInjectionTest (WireMock scenarios driven by Testcontainers to exercise timeouts and retries).
  • Include deployment starter assets under deploy/: docker-compose.yml, otel-collector-config.yaml, and minimal deploy/k8s/ manifests for two demos.
  • Update project docs (docs/phase-4-cloud-native-observability.md) and README.md phase tracking, and add OpenTelemetry/Testcontainers dependencies to pom.xml.

Testing

  • Ran mvn test -DskipITs in this environment but the build failed early due to plugin/dependency resolution from Maven Central returning HTTP 403, so the full test suite could not be executed here.
  • ObservabilityPatternsTest is designed to validate spans and metrics using in-memory OTEL testing helpers and asserts presence of command.execute, saga.orchestration spans and pattern.command.latency.ms metric.
  • ResilienceFaultInjectionTest uses Testcontainers + WireMock and is guarded by assumeTrue(DockerClientFactory.instance().isDockerAvailable()), so it will auto-skip when Docker is not available in the runner.
  • Recommendation: run mvn test in a networked environment with Docker available to validate all tests end-to-end.

Codex Task

@Janaka2
Janaka2 merged commit 0dc86f7 into master Apr 10, 2026
0 of 2 checks passed
@Janaka2
Janaka2 deleted the codex/add-opentelemetry-instrumentation-examples branch April 10, 2026 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant