# julianocosta89/opentelemetry-microservices-demo architecture

> Architecture diagram of the GitHub repository julianocosta89/opentelemetry-microservices-demo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/julianocosta89/opentelemetry-microservices-demo
- Repository: https://github.com/julianocosta89/opentelemetry-microservices-demo

## Overview

#### Purpose and entry points
Online Boutique is a polyglot, Kubernetes-oriented e-commerce demo modified to emit OpenTelemetry traces. The user-facing entry point is the Go HTTP frontend in `src/frontend/main.go`, with request orchestration in `src/frontend/handlers.go` and gRPC clients in `src/frontend/rpc.go`. Synthetic traffic enters through Locust at `src/loadgenerator/locustfile.py`.

#### Service contract and communication
Services communicate primarily over gRPC, with shared API definitions in `pb/demo.proto` and health definitions in `pb/grpc/health/v1/health.proto`. Each service carries generated or local protobuf bindings, creating a contract boundary between independently deployed containers. Dockerfiles under each `src/<service>/Dockerfile` package the services.

#### Storefront and browse path
Frontend renders templates/static assets and fans out to catalog, currency, recommendation, ad, and cart services. Product data is file-backed by `src/productcatalogservice/products.json`, served from `src/productcatalogservice/server.go`. Currency conversion is a Node service rooted at `src/currencyservice/server.js`, using conversion data in `src/currencyservice/data/currency_conversion.json`. Recommendations and ads are Python/Java gRPC services at `src/recommendationservice/recommendation_server.py` and `src/adservice/src/main/java/hipstershop/AdService.java`.

#### Cart persistence boundary
Cart operations are implemented by the C# gRPC service in `src/cartservice/src/services/CartService.cs`. Storage is abstracted behind `src/cartservice/src/cartstore/ICartStore.cs`, with Redis-backed implementation in `src/cartservice/src/cartstore/RedisCartStore.cs`. Redis is deployed as a separate infrastructure workload through `kubernetes-manifests/redis.yaml`; it is the primary durable/stateful dependency.

#### Checkout orchestration
Checkout is the central transactional control flow in `src/checkoutservice/main.go`: it retrieves cart contents, prepares an order, then invokes payment, shipping, and email services. Payment is a mock charge boundary in `src/paymentservice/server.js`/`src/paymentservice/charge.js`; shipping cost and fulfillment are in `src/shippingservice/main.go` and `src/shippingservice/quote.go`; confirmation notification is handled by `src/emailservice/email_server.py`.

#### Observability pipeline
All services are instrumented for OpenTelemetry traces. Instrumented applications export via gRPC to the collector configured in `src/otelcollector/conf.yml`; the collector deployment is `kubernetes-manifests/otelcollector.yaml`. It exports traces to logs and Jaeger, deployed via `kubernetes-manifests/jaeger.yaml`; Jaeger provides the trace UI. Node services explicitly load tracing support through `src/currencyservice/tracing.js` and `src/paymentservice/tracing.js`; Java includes `src/adservice/agent/opentelemetry-javaagent.jar`.

#### Deployment and runtime topology
The system runs as Docker containers locally via `hack/build-and-run.sh`, or as Kubernetes workloads defined per service in `kubernetes-manifests/frontend.yaml`, `kubernetes-manifests/checkoutservice.yaml`, and sibling manifests. `skaffold.yaml` is the Kubernetes build/deploy entry point. Optional Istio topology and ingress are represented by `istio-manifests/frontend-gateway.yaml` and `istio-manifests/frontend.yaml`. CI/build integration includes `cloudbuild.yaml` and GitHub workflows under `.github/workflows/`.

Main entry points: [`src/checkoutservice/main.go`](https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/checkoutservice/main.go) (Checkout), [`src/frontend/handlers.go`](https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/frontend/handlers.go) (Request handlers), [`src/frontend/main.go`](https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/frontend/main.go) (Frontend), [`pb/demo.proto`](https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/pb/demo.proto) (Shared protobuf contracts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry &amp; Storefront"]
  node_loadgen(("Locust traffic<br/>synthetic client<br/>[locustfile.py]"))
  node_frontend["Frontend<br/>[main.go]"]
  node_frontend_handlers["Request handlers<br/>Go handlers<br/>[handlers.go]"]
end

subgraph group_commerce["Commerce Services"]
  node_catalog["Product catalog<br/>Go gRPC service<br/>[server.go]"]
  node_products["Product data<br/>JSON catalog<br/>[products.json]"]
  node_currency["Currency<br/>Node gRPC service<br/>[server.js]"]
  node_recommendation["Recommendations<br/>Python gRPC service"]
  node_ads["Ads<br/>Java gRPC service<br/>[AdService.java]"]
  node_cart["Cart<br/>C&#35; gRPC service<br/>[CartService.cs]"]
  node_checkout["Checkout<br/>Go gRPC orchestrator<br/>[main.go]"]
  node_payment["Payment<br/>Node gRPC service<br/>[server.js]"]
  node_shipping["Shipping<br/>Go gRPC service<br/>[main.go]"]
  node_email["Email<br/>Python gRPC service<br/>[email_server.py]"]
end

subgraph group_state["State &amp; Contracts"]
  node_cart_store["Cart store abstraction<br/>C&#35; storage interface<br/>[ICartStore.cs]"]
  node_redis_store["Redis cart store<br/>C&#35; Redis adapter<br/>[RedisCartStore.cs]"]
  node_redis[("Redis<br/>stateful workload<br/>[redis.yaml]")]
  node_proto["Shared protobuf contracts<br/>gRPC API definitions<br/>[demo.proto]"]
end

subgraph group_observability["Observability"]
  node_otel_collector["OpenTelemetry Collector<br/>trace collector<br/>[conf.yml]"]
  node_jaeger[("Jaeger<br/>trace backend and UI<br/>[jaeger.yaml]")]
end

subgraph group_runtime["Deployment"]
  node_skaffold{{"Skaffold deployment<br/>Kubernetes build/deploy entry<br/>[skaffold.yaml]"}}
  node_frontend_manifest["Frontend workload<br/>Kubernetes manifest<br/>[frontend.yaml]"]
  node_checkout_manifest["Checkout workload<br/>Kubernetes manifest"]
end

node_loadgen -->|"HTTP traffic"| node_frontend
node_frontend -->|"routes requests"| node_frontend_handlers
node_frontend_handlers -->|"gRPC browse"| node_catalog
node_frontend_handlers -->|"gRPC conversion"| node_currency
node_frontend_handlers -->|"gRPC recommendations"| node_recommendation
node_frontend_handlers -->|"gRPC ads"| node_ads
node_frontend_handlers -->|"gRPC cart"| node_cart
node_frontend_handlers -->|"gRPC checkout"| node_checkout
node_catalog -->|"reads"| node_products
node_cart -->|"uses"| node_cart_store
node_cart_store -.->|"implemented by"| node_redis_store
node_redis_store -->|"stores carts"| node_redis
node_checkout -->|"retrieves cart"| node_cart
node_checkout -->|"charges"| node_payment
node_checkout -->|"ships order"| node_shipping
node_checkout -->|"sends confirmation"| node_email
node_proto -.->|"gRPC contract"| node_frontend
node_proto -.->|"gRPC contract"| node_checkout
node_proto -.->|"gRPC contract"| node_cart
node_proto -.->|"gRPC contract"| node_catalog
node_frontend -->|"exports traces"| node_otel_collector
node_checkout -->|"exports traces"| node_otel_collector
node_otel_collector -->|"exports traces"| node_jaeger
node_skaffold -->|"deploys"| node_frontend_manifest
node_skaffold -->|"deploys"| node_checkout_manifest
node_frontend_manifest -.->|"runs"| node_frontend
node_checkout_manifest -.->|"runs"| node_checkout

click node_loadgen "https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/loadgenerator/locustfile.py"
click node_frontend "https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/frontend/main.go"
click node_frontend_handlers "https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/frontend/handlers.go"
click node_catalog "https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/productcatalogservice/server.go"
click node_products "https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/productcatalogservice/products.json"
click node_currency "https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/currencyservice/server.js"
click node_recommendation "https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/recommendationservice/recommendation_server.py"
click node_ads "https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/adservice/src/main/java/hipstershop/AdService.java"
click node_cart "https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/cartservice/src/services/CartService.cs"
click node_cart_store "https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/cartservice/src/cartstore/ICartStore.cs"
click node_redis_store "https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/cartservice/src/cartstore/RedisCartStore.cs"
click node_redis "https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/kubernetes-manifests/redis.yaml"
click node_checkout "https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/checkoutservice/main.go"
click node_payment "https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/paymentservice/server.js"
click node_shipping "https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/shippingservice/main.go"
click node_email "https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/emailservice/email_server.py"
click node_proto "https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/pb/demo.proto"
click node_otel_collector "https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/otelcollector/conf.yml"
click node_jaeger "https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/kubernetes-manifests/jaeger.yaml"
click node_skaffold "https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/skaffold.yaml"
click node_frontend_manifest "https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/kubernetes-manifests/frontend.yaml"
click node_checkout_manifest "https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/kubernetes-manifests/checkoutservice.yaml"

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_loadgen,node_frontend,node_frontend_handlers toneBlue
class node_catalog,node_products,node_currency,node_recommendation,node_ads,node_cart,node_checkout,node_payment,node_shipping,node_email toneAmber
class node_cart_store,node_redis_store,node_redis,node_proto toneMint
class node_otel_collector,node_jaeger toneRose
class node_skaffold,node_frontend_manifest,node_checkout_manifest toneIndigo
```

## Components

### Entry & Storefront

- [Locust traffic](https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/loadgenerator/locustfile.py): synthetic client · `src/loadgenerator/locustfile.py`
- [Frontend](https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/frontend/main.go): Go HTTP + gRPC client · Renders storefront and orchestrates browse and cart requests. · `src/frontend/main.go`
- [Request handlers](https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/frontend/handlers.go): Go handlers · `src/frontend/handlers.go`

### Commerce Services

- [Product catalog](https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/productcatalogservice/server.go): Go gRPC service · Serves file-backed product data. · `src/productcatalogservice/server.go`
- [Product data](https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/productcatalogservice/products.json): JSON catalog · `src/productcatalogservice/products.json`
- [Currency](https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/currencyservice/server.js): Node gRPC service · `src/currencyservice/server.js`
- [Recommendations](https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/recommendationservice/recommendation_server.py): Python gRPC service · `src/recommendationservice/recommendation_server.py`
- [Ads](https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/adservice/src/main/java/hipstershop/AdService.java): Java gRPC service · `src/adservice/src/main/java/hipstershop/AdService.java`
- [Cart](https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/cartservice/src/services/CartService.cs): C# gRPC service · `src/cartservice/src/services/CartService.cs`
- [Checkout](https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/checkoutservice/main.go): Go gRPC orchestrator · Prepares orders and coordinates payment, shipping, and email. · `src/checkoutservice/main.go`
- [Payment](https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/paymentservice/server.js): Node gRPC service · Mock charge boundary. · `src/paymentservice/server.js`
- [Shipping](https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/shippingservice/main.go): Go gRPC service · Quotes and fulfills shipments. · `src/shippingservice/main.go`
- [Email](https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/emailservice/email_server.py): Python gRPC service · `src/emailservice/email_server.py`

### State & Contracts

- [Cart store abstraction](https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/cartservice/src/cartstore/ICartStore.cs): C# storage interface · `src/cartservice/src/cartstore/ICartStore.cs`
- [Redis cart store](https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/cartservice/src/cartstore/RedisCartStore.cs): C# Redis adapter · `src/cartservice/src/cartstore/RedisCartStore.cs`
- [Redis](https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/kubernetes-manifests/redis.yaml): stateful workload · Primary durable cart dependency. · `kubernetes-manifests/redis.yaml`
- [Shared protobuf contracts](https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/pb/demo.proto): gRPC API definitions · `pb/demo.proto`

### Observability

- [OpenTelemetry Collector](https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/src/otelcollector/conf.yml): trace collector · Receives application traces over gRPC. · `src/otelcollector/conf.yml`
- [Jaeger](https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/kubernetes-manifests/jaeger.yaml): trace backend and UI · `kubernetes-manifests/jaeger.yaml`

### Deployment

- [Skaffold deployment](https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/skaffold.yaml): Kubernetes build/deploy entry · `skaffold.yaml`
- [Frontend workload](https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/kubernetes-manifests/frontend.yaml): Kubernetes manifest · `kubernetes-manifests/frontend.yaml`
- [Checkout workload](https://github.com/julianocosta89/opentelemetry-microservices-demo/blob/main/kubernetes-manifests/checkoutservice.yaml): Kubernetes manifest · `kubernetes-manifests/checkoutservice.yaml`

## Connections

- Locust traffic → Frontend: HTTP traffic
- Frontend → Request handlers: routes requests
- Request handlers → Product catalog: gRPC browse
- Request handlers → Currency: gRPC conversion
- Request handlers → Recommendations: gRPC recommendations
- Request handlers → Ads: gRPC ads
- Request handlers → Cart: gRPC cart
- Request handlers → Checkout: gRPC checkout
- Product catalog → Product data: reads
- Cart → Cart store abstraction: uses
- Cart store abstraction → Redis cart store: implemented by
- Redis cart store → Redis: stores carts
- Checkout → Cart: retrieves cart
- Checkout → Payment: charges
- Checkout → Shipping: ships order
- Checkout → Email: sends confirmation
- Shared protobuf contracts → Frontend: gRPC contract
- Shared protobuf contracts → Checkout: gRPC contract
- Shared protobuf contracts → Cart: gRPC contract
- Shared protobuf contracts → Product catalog: gRPC contract
- Frontend → OpenTelemetry Collector: exports traces
- Checkout → OpenTelemetry Collector: exports traces
- OpenTelemetry Collector → Jaeger: exports traces
- Skaffold deployment → Frontend workload: deploys
- Skaffold deployment → Checkout workload: deploys
- Frontend workload → Frontend: runs
- Checkout workload → Checkout: runs
