# nithish-1622/aegis-telemetry architecture

> Architecture diagram of the GitHub repository nithish-1622/aegis-telemetry, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nithish-1622/aegis-telemetry
- Repository: https://github.com/nithish-1622/aegis-telemetry

## Overview

#### Purpose and Scope
Aegis Telemetry is a Java telemetry-generation platform for the Aegis suite. Its explicit system boundary is publishing Kafka telemetry events; it must not couple to the separate “Person 2” runtime-intelligence backend. This is currently a Phase 0 scaffold: module/package boundaries exist, but implementation classes and executable application entry points are not present.

#### Build and Entry Boundary
The repository is a Maven multi-module project rooted at `pom.xml`. Module-level Maven boundaries are defined by:
- `event-publisher/pom.xml`
- `demo-services/pom.xml`
- `shared-contracts/pom.xml`

The practical current entry point is Maven build/module selection rather than a Java `main` class. Java source roots are placeholders under each module’s `src/main/java`.

#### Contract and Shared Model Boundary
`shared-contracts` is the intended compatibility boundary for telemetry payloads and common types shared by producers and platform modules:
- `shared-contracts/src/main/java/com/aegis/telemetry/contracts`
- `shared-contracts/src/main/java/com/aegis/telemetry/common`
- `shared-contracts/pom.xml`

Kafka event schemas and serialization expectations should be owned here, so demo services, instrumentation, tracing, and publishing can evolve without direct dependency on runtime intelligence.

#### Telemetry Capture and Construction Pipeline
The intended generation pipeline is divided into three components:
1. Runtime-facing SDK APIs in `runtime-sdk/src/main/java/com/aegis/telemetry/sdk`.
2. Instrumentation logic in `instrumentation-engine/src/main/java/com/aegis/telemetry/instrumentation`.
3. Trace/correlation construction in `trace-engine/src/main/java/com/aegis/telemetry/trace`.

Control flow should run from application/service activity through SDK or instrumentation capture, into trace enrichment and shared event contracts, before publication. These modules separate application integration from how telemetry is generated internally.

#### Configuration and Service Identity
Runtime behavior and producer/service identity are isolated into:
- `runtime-config/src/main/java/com/aegis/telemetry/config`
- `service-registry/src/main/java/com/aegis/telemetry/registry`

These are architectural boundaries for loading runtime settings and resolving/registering service metadata. They should feed the capture/publish pipeline rather than being embedded in demo services or event schemas.

#### Publishing and External Infrastructure
`event-publisher/src/main/java/com/aegis/telemetry/publisher` is the Kafka-facing adapter and the key outbound integration boundary. Kafka is the only explicitly named external service/infrastructure dependency. Publisher code should accept shared contracts and emit them to Kafka while shielding the rest of the system from broker/client details.

The material runtime is Java, built and composed with Maven. No container deployment implementation is present; `docker/README.md` is the repository’s Docker-related boundary.

#### Demo and Failure Workloads
Three demo service modules represent telemetry-producing workloads:
- `demo-services/inventory-service/src/main/java/com/aegis/telemetry/demo/inventory`
- `demo-services/order-service/src/main/java/com/aegis/telemetry/demo/order`
- `demo-services/payment-service/src/main/java/com/aegis/telemetry/demo/payment`

`failure-simulator/src/main/java/com/aegis/telemetry/simulator` is a separate intended source of failure scenarios. These modules should exercise SDK/instrumentation and publisher paths, not become dependencies of the core telemetry platform.

#### Architecture Status
The authoritative Phase 0 architecture record is `docs/phase-0-architecture.md`. All Java package directories currently contain `.gitkeep` placeholders, so dependencies, event flow implementation, Kafka client configuration, and runnable service entry points remain to be built.

Main entry points: [`demo-services/pom.xml`](https://github.com/nithish-1622/aegis-telemetry/blob/main/demo-services/pom.xml) (Demo services module), [`shared-contracts/src/main/java/com/aegis/telemetry/contracts`](https://github.com/nithish-1622/aegis-telemetry/tree/main/shared-contracts/src/main/java/com/aegis/telemetry/contracts) (Event contracts), [`runtime-sdk/src/main/java/com/aegis/telemetry/sdk`](https://github.com/nithish-1622/aegis-telemetry/tree/main/runtime-sdk/src/main/java/com/aegis/telemetry/sdk) (Runtime SDK), [`instrumentation-engine/src/main/java/com/aegis/telemetry/instrumentation`](https://github.com/nithish-1622/aegis-telemetry/tree/main/instrumentation-engine/src/main/java/com/aegis/telemetry/instrumentation) (Instrumentation engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_build["Build &amp; records"]
  node_maven{{"Maven reactor<br/>build<br/>[pom.xml]"}}
  node_contracts_pom["Shared contracts module<br/>maven module<br/>[pom.xml]"]
  node_publisher_pom["Publisher module<br/>maven module<br/>[pom.xml]"]
  node_demos_pom["Demo services module<br/>maven module<br/>[pom.xml]"]
  node_architecture["Phase 0 architecture<br/>architecture record"]
  node_docker["Docker boundary<br/>documentation<br/>[README.md]"]
end

subgraph group_platform["Telemetry platform"]
  node_contracts["Event contracts<br/>shared model"]
  node_common["Common types<br/>shared model"]
  node_config["Runtime configuration<br/>configuration boundary"]
  node_registry["Service registry<br/>identity boundary"]
  node_sdk["Runtime SDK<br/>capture API"]
  node_instrumentation["Instrumentation engine<br/>capture engine"]
  node_trace["Trace engine<br/>trace construction"]
  node_publisher["Kafka publisher<br/>outbound adapter"]
end

subgraph group_workloads["Demo workloads"]
  node_inventory["Inventory demo<br/>demo service"]
  node_order["Order demo<br/>demo service"]
  node_payment["Payment demo<br/>demo service"]
  node_failure["Failure simulator<br/>scenario source"]
end

node_kafka["Kafka<br/>external broker"]

node_maven -->|"selects module"| node_contracts_pom
node_maven -->|"selects module"| node_publisher_pom
node_maven -->|"selects module"| node_demos_pom
node_contracts_pom -->|"builds"| node_contracts
node_contracts_pom -->|"builds"| node_common
node_publisher_pom -->|"builds"| node_publisher
node_demos_pom -->|"contains"| node_inventory
node_demos_pom -->|"contains"| node_order
node_demos_pom -->|"contains"| node_payment
node_inventory -->|"captures activity"| node_sdk
node_order -->|"captures activity"| node_sdk
node_payment -->|"captures activity"| node_sdk
node_failure -->|"exercises scenarios"| node_instrumentation
node_sdk -->|"delegates capture"| node_instrumentation
node_instrumentation -->|"enriches"| node_trace
node_config -.->|"supplies settings"| node_instrumentation
node_registry -.->|"supplies service identity"| node_trace
node_trace -->|"constructs events"| node_contracts
node_common -->|"supports"| node_contracts
node_contracts -->|"publishes event payloads"| node_publisher
node_config -.->|"supplies producer settings"| node_publisher
node_publisher -->|"emits telemetry events"| node_kafka

click node_maven "https://github.com/nithish-1622/aegis-telemetry/blob/main/pom.xml"
click node_contracts_pom "https://github.com/nithish-1622/aegis-telemetry/blob/main/shared-contracts/pom.xml"
click node_publisher_pom "https://github.com/nithish-1622/aegis-telemetry/blob/main/event-publisher/pom.xml"
click node_demos_pom "https://github.com/nithish-1622/aegis-telemetry/blob/main/demo-services/pom.xml"
click node_architecture "https://github.com/nithish-1622/aegis-telemetry/blob/main/docs/phase-0-architecture.md"
click node_docker "https://github.com/nithish-1622/aegis-telemetry/blob/main/docker/README.md"
click node_contracts "https://github.com/nithish-1622/aegis-telemetry/tree/main/shared-contracts/src/main/java/com/aegis/telemetry/contracts"
click node_common "https://github.com/nithish-1622/aegis-telemetry/tree/main/shared-contracts/src/main/java/com/aegis/telemetry/common"
click node_config "https://github.com/nithish-1622/aegis-telemetry/tree/main/runtime-config/src/main/java/com/aegis/telemetry/config"
click node_registry "https://github.com/nithish-1622/aegis-telemetry/tree/main/service-registry/src/main/java/com/aegis/telemetry/registry"
click node_sdk "https://github.com/nithish-1622/aegis-telemetry/tree/main/runtime-sdk/src/main/java/com/aegis/telemetry/sdk"
click node_instrumentation "https://github.com/nithish-1622/aegis-telemetry/tree/main/instrumentation-engine/src/main/java/com/aegis/telemetry/instrumentation"
click node_trace "https://github.com/nithish-1622/aegis-telemetry/tree/main/trace-engine/src/main/java/com/aegis/telemetry/trace"
click node_publisher "https://github.com/nithish-1622/aegis-telemetry/tree/main/event-publisher/src/main/java/com/aegis/telemetry/publisher"
click node_inventory "https://github.com/nithish-1622/aegis-telemetry/tree/main/demo-services/inventory-service/src/main/java/com/aegis/telemetry/demo/inventory"
click node_order "https://github.com/nithish-1622/aegis-telemetry/tree/main/demo-services/order-service/src/main/java/com/aegis/telemetry/demo/order"
click node_payment "https://github.com/nithish-1622/aegis-telemetry/tree/main/demo-services/payment-service/src/main/java/com/aegis/telemetry/demo/payment"
click node_failure "https://github.com/nithish-1622/aegis-telemetry/tree/main/failure-simulator/src/main/java/com/aegis/telemetry/simulator"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_maven,node_contracts_pom,node_publisher_pom,node_demos_pom,node_architecture,node_docker toneBlue
class node_contracts,node_common,node_config,node_registry,node_sdk,node_instrumentation,node_trace,node_publisher toneAmber
class node_inventory,node_order,node_payment,node_failure toneMint
class node_kafka toneNeutral
```

## Components

### Build & records

- [Maven reactor](https://github.com/nithish-1622/aegis-telemetry/blob/main/pom.xml): build · Current practical entry boundary. · `pom.xml`
- [Shared contracts module](https://github.com/nithish-1622/aegis-telemetry/blob/main/shared-contracts/pom.xml): maven module · `shared-contracts/pom.xml`
- [Publisher module](https://github.com/nithish-1622/aegis-telemetry/blob/main/event-publisher/pom.xml): maven module · `event-publisher/pom.xml`
- [Demo services module](https://github.com/nithish-1622/aegis-telemetry/blob/main/demo-services/pom.xml): maven module · `demo-services/pom.xml`
- [Phase 0 architecture](https://github.com/nithish-1622/aegis-telemetry/blob/main/docs/phase-0-architecture.md): architecture record · Authoritative scaffold status and boundaries. · `docs/phase-0-architecture.md`
- [Docker boundary](https://github.com/nithish-1622/aegis-telemetry/blob/main/docker/README.md): documentation · No container deployment implementation is present. · `docker/README.md`

### Telemetry platform

- [Event contracts](https://github.com/nithish-1622/aegis-telemetry/tree/main/shared-contracts/src/main/java/com/aegis/telemetry/contracts): shared model · Owns telemetry schemas, serialization expectations, and common types. · `shared-contracts/src/main/java/com/aegis/telemetry/contracts`
- [Common types](https://github.com/nithish-1622/aegis-telemetry/tree/main/shared-contracts/src/main/java/com/aegis/telemetry/common): shared model · `shared-contracts/src/main/java/com/aegis/telemetry/common`
- [Runtime configuration](https://github.com/nithish-1622/aegis-telemetry/tree/main/runtime-config/src/main/java/com/aegis/telemetry/config): configuration boundary · `runtime-config/src/main/java/com/aegis/telemetry/config`
- [Service registry](https://github.com/nithish-1622/aegis-telemetry/tree/main/service-registry/src/main/java/com/aegis/telemetry/registry): identity boundary · Resolves or registers producer service metadata. · `service-registry/src/main/java/com/aegis/telemetry/registry`
- [Runtime SDK](https://github.com/nithish-1622/aegis-telemetry/tree/main/runtime-sdk/src/main/java/com/aegis/telemetry/sdk): capture API · Application-facing telemetry capture APIs. · `runtime-sdk/src/main/java/com/aegis/telemetry/sdk`
- [Instrumentation engine](https://github.com/nithish-1622/aegis-telemetry/tree/main/instrumentation-engine/src/main/java/com/aegis/telemetry/instrumentation): capture engine · `instrumentation-engine/src/main/java/com/aegis/telemetry/instrumentation`
- [Trace engine](https://github.com/nithish-1622/aegis-telemetry/tree/main/trace-engine/src/main/java/com/aegis/telemetry/trace): trace construction · Builds trace and correlation context. · `trace-engine/src/main/java/com/aegis/telemetry/trace`
- [Kafka publisher](https://github.com/nithish-1622/aegis-telemetry/tree/main/event-publisher/src/main/java/com/aegis/telemetry/publisher): outbound adapter · Shields telemetry generation from Kafka client details. · `event-publisher/src/main/java/com/aegis/telemetry/publisher`

### Demo workloads

- [Inventory demo](https://github.com/nithish-1622/aegis-telemetry/tree/main/demo-services/inventory-service/src/main/java/com/aegis/telemetry/demo/inventory): demo service · `demo-services/inventory-service/src/main/java/com/aegis/telemetry/demo/inventory`
- [Order demo](https://github.com/nithish-1622/aegis-telemetry/tree/main/demo-services/order-service/src/main/java/com/aegis/telemetry/demo/order): demo service · `demo-services/order-service/src/main/java/com/aegis/telemetry/demo/order`
- [Payment demo](https://github.com/nithish-1622/aegis-telemetry/tree/main/demo-services/payment-service/src/main/java/com/aegis/telemetry/demo/payment): demo service · `demo-services/payment-service/src/main/java/com/aegis/telemetry/demo/payment`
- [Failure simulator](https://github.com/nithish-1622/aegis-telemetry/tree/main/failure-simulator/src/main/java/com/aegis/telemetry/simulator): scenario source · `failure-simulator/src/main/java/com/aegis/telemetry/simulator`

### Other components

- **Kafka**: external broker · Only explicit external infrastructure dependency.

## Connections

- Maven reactor → Shared contracts module: selects module
- Maven reactor → Publisher module: selects module
- Maven reactor → Demo services module: selects module
- Shared contracts module → Event contracts: builds
- Shared contracts module → Common types: builds
- Publisher module → Kafka publisher: builds
- Demo services module → Inventory demo: contains
- Demo services module → Order demo: contains
- Demo services module → Payment demo: contains
- Inventory demo → Runtime SDK: captures activity
- Order demo → Runtime SDK: captures activity
- Payment demo → Runtime SDK: captures activity
- Failure simulator → Instrumentation engine: exercises scenarios
- Runtime SDK → Instrumentation engine: delegates capture
- Instrumentation engine → Trace engine: enriches
- Runtime configuration → Instrumentation engine: supplies settings
- Service registry → Trace engine: supplies service identity
- Trace engine → Event contracts: constructs events
- Common types → Event contracts: supports
- Event contracts → Kafka publisher: publishes event payloads
- Runtime configuration → Kafka publisher: supplies producer settings
- Kafka publisher → Kafka: emits telemetry events
