atiaomar1978-hub commented on code in PR #1734:
URL: https://github.com/apache/camel-website/pull/1734#discussion_r3889818971


##########
content/blog/2026/08/camel-genai-observability-jbang/index.md:
##########
@@ -0,0 +1,222 @@
+---
+title: "Observe Your Camel AI Routes with GenAI OpenTelemetry"
+date: 2026-08-29
+draft: false
+authors: [atiaomar1978-hub]
+categories: ["AI", "Howtos"]
+keywords: ["apache camel", "genai", "observability", "opentelemetry", 
"ollama", "langchain4j", "camel jbang", "camel tui", "camel 4.23", "llm"]
+preview: "Apache Camel 4.23 adds GenAI observability — OpenTelemetry spans and 
Micrometer metrics for LLM routes. Prototype it in minutes with JBang, Ollama, 
and the Camel TUI."
+---
+
+Once LLMs live inside Camel routes, the next question is always the same: *how 
much are we spending, and
+where is latency coming from?* Apache Camel **4.23** introduces **GenAI 
observability** — OpenTelemetry spans
+and Micrometer metrics for LLM producers, aligned with the
+[OpenTelemetry GenAI semantic 
conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/).
+
+This is **Blog 1** in a two-part series. We start with the fastest path to 
visible AI telemetry: Camel JBang,

Review Comment:
   Done — Part 1 now uses **Camel CLI** throughout (intro, prerequisites, run 
commands). Keywords updated to `camel cli`.
   
   _AI-generated reply on behalf of atiaomar1978-hub (Cursor Cloud Agent)_



##########
content/blog/2026/08/camel-genai-observability-jbang/index.md:
##########
@@ -0,0 +1,222 @@
+---
+title: "Observe Your Camel AI Routes with GenAI OpenTelemetry"
+date: 2026-08-29

Review Comment:
   Done — both posts set to `date: 2026-08-30` and `draft: false` in commit 
`e9051a9`.
   
   _AI-generated reply on behalf of atiaomar1978-hub (Cursor Cloud Agent)_



##########
content/blog/2026/08/camel-genai-observability-jbang/index.md:
##########
@@ -0,0 +1,222 @@
+---
+title: "Observe Your Camel AI Routes with GenAI OpenTelemetry"
+date: 2026-08-29
+draft: false
+authors: [atiaomar1978-hub]
+categories: ["AI", "Howtos"]
+keywords: ["apache camel", "genai", "observability", "opentelemetry", 
"ollama", "langchain4j", "camel jbang", "camel tui", "camel 4.23", "llm"]
+preview: "Apache Camel 4.23 adds GenAI observability — OpenTelemetry spans and 
Micrometer metrics for LLM routes. Prototype it in minutes with JBang, Ollama, 
and the Camel TUI."
+---
+
+Once LLMs live inside Camel routes, the next question is always the same: *how 
much are we spending, and
+where is latency coming from?* Apache Camel **4.23** introduces **GenAI 
observability** — OpenTelemetry spans
+and Micrometer metrics for LLM producers, aligned with the
+[OpenTelemetry GenAI semantic 
conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/).
+
+This is **Blog 1** in a two-part series. We start with the fastest path to 
visible AI telemetry: Camel JBang,
+a LangChain4j chat route, [Ollama](https://ollama.com/), and the Camel CLI/TUI 
— no Spring Boot required.
+
+Special thanks to **Claus Ibsen** for guidance on shaping this material.

Review Comment:
   Removed — thanks paragraph is no longer in Part 1.
   
   _AI-generated reply on behalf of atiaomar1978-hub (Cursor Cloud Agent)_



##########
content/blog/2026/08/camel-genai-observability-jbang/index.md:
##########
@@ -0,0 +1,222 @@
+---
+title: "Observe Your Camel AI Routes with GenAI OpenTelemetry"
+date: 2026-08-29
+draft: false
+authors: [atiaomar1978-hub]
+categories: ["AI", "Howtos"]
+keywords: ["apache camel", "genai", "observability", "opentelemetry", 
"ollama", "langchain4j", "camel jbang", "camel tui", "camel 4.23", "llm"]
+preview: "Apache Camel 4.23 adds GenAI observability — OpenTelemetry spans and 
Micrometer metrics for LLM routes. Prototype it in minutes with JBang, Ollama, 
and the Camel TUI."
+---
+
+Once LLMs live inside Camel routes, the next question is always the same: *how 
much are we spending, and
+where is latency coming from?* Apache Camel **4.23** introduces **GenAI 
observability** — OpenTelemetry spans
+and Micrometer metrics for LLM producers, aligned with the
+[OpenTelemetry GenAI semantic 
conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/).
+
+This is **Blog 1** in a two-part series. We start with the fastest path to 
visible AI telemetry: Camel JBang,
+a LangChain4j chat route, [Ollama](https://ollama.com/), and the Camel CLI/TUI 
— no Spring Boot required.
+
+Special thanks to **Claus Ibsen** for guidance on shaping this material.
+
+## The three phases of Camel Gen AI
+
+| Phase | Name | What you do |
+|-------|------|-------------|
+| 1 | **Connect** | Wire LLMs into routes (`langchain4j-chat`, `openai`, 
Spring AI) |
+| 2 | **Act** | Give AI tools via `ai-tool:`, agents, MCP server, A2A |
+| 3 | **Operate** | Run in production with guardrails, RAG, and **GenAI 
observability** |
+
+This post covers Phase 1 plus the first observability prototype.
+[Part 2](/blog/2026/08/camel-genai-observability-spring-boot/) moves to Spring 
Boot and a full observability
+stack (Prometheus, VictoriaTraces, Perses).
+
+## What you'll build
+
+A timer-driven route that calls Ollama every 15 seconds. For each LLM 
invocation you get:
+
+- Micrometer timer: `gen_ai.client.operation`
+- Micrometer counter: `gen_ai.client.token.usage` (tags `input` / `output`)
+- OpenTelemetry child spans with `gen_ai.request.model`, token counts, finish 
reason
+- Exchange headers: `CamelLangChain4jChatRequestModel`, 
`CamelLangChain4jChatResponseModel`
+- TUI **Spans** tab visualization + AI Usage view (**Ctrl+U**)
+
+```
+timer:genai (every 15s)
+  └─ langchain4j-chat (Ollama ChatModel)
+       ├─ camel-ai-observability-api  → start GenAI span + record metrics
+       ├─ camel-opentelemetry2          → export span attributes
+       └─ camel-micrometer            → gen_ai.client.* metrics
+
+camel run --observe
+  └─ camel-observability-services
+       ├─ /observe/health
+       ├─ /observe/metrics  (Prometheus format)
+       └─ TUI Spans collector (embedded OTLP for dev)
+
+camel tui
+  ├─ Spans tab (shortcut: o)
+  └─ AI panel + Ctrl+U (CLI ask + route GenAI usage combined)
+```
+
+## Prerequisites
+
+- Camel JBang **4.23+** (`camel version`)
+- Ollama installed and running
+
+```shell
+ollama pull llama3.2
+ollama serve
+```
+
+## Run the example
+
+The bundled example ships with Camel 4.23 at

Review Comment:
   Done — example now points to 
[camel-jbang-examples/ai/genai-observability](https://github.com/apache/camel-jbang-examples/pull/73)
 and mentions the TUI example browser.
   
   _AI-generated reply on behalf of atiaomar1978-hub (Cursor Cloud Agent)_



##########
content/blog/2026/08/camel-genai-observability-jbang/index.md:
##########
@@ -0,0 +1,222 @@
+---
+title: "Observe Your Camel AI Routes with GenAI OpenTelemetry"
+date: 2026-08-29
+draft: false
+authors: [atiaomar1978-hub]
+categories: ["AI", "Howtos"]
+keywords: ["apache camel", "genai", "observability", "opentelemetry", 
"ollama", "langchain4j", "camel jbang", "camel tui", "camel 4.23", "llm"]
+preview: "Apache Camel 4.23 adds GenAI observability — OpenTelemetry spans and 
Micrometer metrics for LLM routes. Prototype it in minutes with JBang, Ollama, 
and the Camel TUI."
+---
+
+Once LLMs live inside Camel routes, the next question is always the same: *how 
much are we spending, and
+where is latency coming from?* Apache Camel **4.23** introduces **GenAI 
observability** — OpenTelemetry spans
+and Micrometer metrics for LLM producers, aligned with the
+[OpenTelemetry GenAI semantic 
conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/).
+
+This is **Blog 1** in a two-part series. We start with the fastest path to 
visible AI telemetry: Camel JBang,
+a LangChain4j chat route, [Ollama](https://ollama.com/), and the Camel CLI/TUI 
— no Spring Boot required.
+
+Special thanks to **Claus Ibsen** for guidance on shaping this material.
+
+## The three phases of Camel Gen AI
+
+| Phase | Name | What you do |
+|-------|------|-------------|
+| 1 | **Connect** | Wire LLMs into routes (`langchain4j-chat`, `openai`, 
Spring AI) |
+| 2 | **Act** | Give AI tools via `ai-tool:`, agents, MCP server, A2A |
+| 3 | **Operate** | Run in production with guardrails, RAG, and **GenAI 
observability** |
+
+This post covers Phase 1 plus the first observability prototype.
+[Part 2](/blog/2026/08/camel-genai-observability-spring-boot/) moves to Spring 
Boot and a full observability
+stack (Prometheus, VictoriaTraces, Perses).
+
+## What you'll build
+
+A timer-driven route that calls Ollama every 15 seconds. For each LLM 
invocation you get:
+
+- Micrometer timer: `gen_ai.client.operation`
+- Micrometer counter: `gen_ai.client.token.usage` (tags `input` / `output`)
+- OpenTelemetry child spans with `gen_ai.request.model`, token counts, finish 
reason
+- Exchange headers: `CamelLangChain4jChatRequestModel`, 
`CamelLangChain4jChatResponseModel`
+- TUI **Spans** tab visualization + AI Usage view (**Ctrl+U**)
+
+```
+timer:genai (every 15s)
+  └─ langchain4j-chat (Ollama ChatModel)
+       ├─ camel-ai-observability-api  → start GenAI span + record metrics
+       ├─ camel-opentelemetry2          → export span attributes
+       └─ camel-micrometer            → gen_ai.client.* metrics
+
+camel run --observe
+  └─ camel-observability-services
+       ├─ /observe/health
+       ├─ /observe/metrics  (Prometheus format)
+       └─ TUI Spans collector (embedded OTLP for dev)
+
+camel tui
+  ├─ Spans tab (shortcut: o)
+  └─ AI panel + Ctrl+U (CLI ask + route GenAI usage combined)
+```
+
+## Prerequisites
+
+- Camel JBang **4.23+** (`camel version`)
+- Ollama installed and running
+
+```shell
+ollama pull llama3.2
+ollama serve
+```
+
+## Run the example
+
+The bundled example ships with Camel 4.23 at
+`dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/ai/genai-observability/`
+([source on GitHub](https://github.com/apache/camel/pull/25891/files)).
+
+```shell
+cd ai/genai-observability
+
+camel run GenAiObservabilityRoute.java application.properties \

Review Comment:
   Acknowledged — blog note added that a JIRA ticket will track CLI dependency 
auto-discovery. Draft prepared; will link the JIRA key once filed on 
issues.apache.org.
   
   _AI-generated reply on behalf of atiaomar1978-hub (Cursor Cloud Agent)_



##########
content/blog/2026/08/camel-genai-observability-jbang/index.md:
##########
@@ -0,0 +1,222 @@
+---
+title: "Observe Your Camel AI Routes with GenAI OpenTelemetry"
+date: 2026-08-29
+draft: false
+authors: [atiaomar1978-hub]
+categories: ["AI", "Howtos"]
+keywords: ["apache camel", "genai", "observability", "opentelemetry", 
"ollama", "langchain4j", "camel jbang", "camel tui", "camel 4.23", "llm"]
+preview: "Apache Camel 4.23 adds GenAI observability — OpenTelemetry spans and 
Micrometer metrics for LLM routes. Prototype it in minutes with JBang, Ollama, 
and the Camel TUI."
+---
+
+Once LLMs live inside Camel routes, the next question is always the same: *how 
much are we spending, and
+where is latency coming from?* Apache Camel **4.23** introduces **GenAI 
observability** — OpenTelemetry spans
+and Micrometer metrics for LLM producers, aligned with the
+[OpenTelemetry GenAI semantic 
conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/).
+
+This is **Blog 1** in a two-part series. We start with the fastest path to 
visible AI telemetry: Camel JBang,
+a LangChain4j chat route, [Ollama](https://ollama.com/), and the Camel CLI/TUI 
— no Spring Boot required.
+
+Special thanks to **Claus Ibsen** for guidance on shaping this material.
+
+## The three phases of Camel Gen AI
+
+| Phase | Name | What you do |
+|-------|------|-------------|
+| 1 | **Connect** | Wire LLMs into routes (`langchain4j-chat`, `openai`, 
Spring AI) |
+| 2 | **Act** | Give AI tools via `ai-tool:`, agents, MCP server, A2A |
+| 3 | **Operate** | Run in production with guardrails, RAG, and **GenAI 
observability** |
+
+This post covers Phase 1 plus the first observability prototype.
+[Part 2](/blog/2026/08/camel-genai-observability-spring-boot/) moves to Spring 
Boot and a full observability
+stack (Prometheus, VictoriaTraces, Perses).
+
+## What you'll build
+
+A timer-driven route that calls Ollama every 15 seconds. For each LLM 
invocation you get:
+
+- Micrometer timer: `gen_ai.client.operation`
+- Micrometer counter: `gen_ai.client.token.usage` (tags `input` / `output`)
+- OpenTelemetry child spans with `gen_ai.request.model`, token counts, finish 
reason
+- Exchange headers: `CamelLangChain4jChatRequestModel`, 
`CamelLangChain4jChatResponseModel`
+- TUI **Spans** tab visualization + AI Usage view (**Ctrl+U**)
+
+```
+timer:genai (every 15s)
+  └─ langchain4j-chat (Ollama ChatModel)
+       ├─ camel-ai-observability-api  → start GenAI span + record metrics
+       ├─ camel-opentelemetry2          → export span attributes
+       └─ camel-micrometer            → gen_ai.client.* metrics
+
+camel run --observe
+  └─ camel-observability-services
+       ├─ /observe/health
+       ├─ /observe/metrics  (Prometheus format)
+       └─ TUI Spans collector (embedded OTLP for dev)
+
+camel tui
+  ├─ Spans tab (shortcut: o)
+  └─ AI panel + Ctrl+U (CLI ask + route GenAI usage combined)
+```
+
+## Prerequisites
+
+- Camel JBang **4.23+** (`camel version`)
+- Ollama installed and running
+
+```shell
+ollama pull llama3.2
+ollama serve
+```
+
+## Run the example
+
+The bundled example ships with Camel 4.23 at
+`dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/ai/genai-observability/`
+([source on GitHub](https://github.com/apache/camel/pull/25891/files)).
+
+```shell
+cd ai/genai-observability
+
+camel run GenAiObservabilityRoute.java application.properties \
+  --observe \
+  --dependency=camel-langchain4j-chat \
+  --dependency=camel-ai-observability \
+  --dependency=langchain4j-ollama
+```
+
+The `--observe` flag adds `camel-observability-services`, enables health 
checks, Micrometer metrics,
+OpenTelemetry tracing, and powers the TUI **Spans** tab on the management port 
(default `9876`).
+
+Wait for log lines like:
+
+```text
+LLM reply: Apache Camel is an open source integration framework...
+Request model: llama3.2
+Response model: llama3.2
+```
+
+## Inspect Prometheus metrics
+
+```shell
+curl -s http://127.0.0.1:9876/observe/metrics | grep gen_ai
+```
+
+Example output (abbreviated):
+
+```text
+# HELP gen_ai_client_operation GenAI client operation duration
+gen_ai_client_operation_count{gen_ai_operation_name="chat",gen_ai_system="langchain4j",...}
 3.0
+
+# HELP gen_ai_client_token_usage GenAI token usage
+gen_ai_client_token_usage_total{gen_ai_token_type="input",...} 42.0
+gen_ai_client_token_usage_total{gen_ai_token_type="output",...} 18.0
+```
+
+## Explore spans in the TUI
+
+Open a second terminal:
+
+```shell
+camel tui
+```
+
+1. Select the running integration (`genai-observability` or similar)
+2. Press **o** or navigate to **More → Spans**
+3. Wait for the next timer tick (~15s) and watch a new span appear
+
+Key span attributes:
+
+| Attribute | Meaning |
+|-----------|---------|
+| `gen_ai.operation.name` | e.g. `chat`, `embeddings` |
+| `gen_ai.system` | Provider abstraction (e.g. `langchain4j`) |
+| `gen_ai.request.model` | Model requested |
+| `gen_ai.response.model` | Model that served the response |
+| `gen_ai.usage.input_tokens` | Prompt tokens |
+| `gen_ai.usage.output_tokens` | Completion tokens |
+| `camel.component` | e.g. `langchain4j-chat` |
+
+Press **Ctrl+U** in the AI panel to toggle the **AI Usage** view — token 
consumption from both
+TUI `camel ask` prompts and route LLM calls on one screen.

Review Comment:
   Done — TUI Spans screenshot added in commit `e9051a9`: 
`camel-genai-observability-spans.png` (shows `gen_ai.*` attributes for an 
Ollama chat span).
   
   _AI-generated reply on behalf of atiaomar1978-hub (Cursor Cloud Agent)_



##########
content/blog/2026/08/camel-genai-observability-jbang/index.md:
##########
@@ -0,0 +1,222 @@
+---
+title: "Observe Your Camel AI Routes with GenAI OpenTelemetry"
+date: 2026-08-29
+draft: false
+authors: [atiaomar1978-hub]
+categories: ["AI", "Howtos"]
+keywords: ["apache camel", "genai", "observability", "opentelemetry", 
"ollama", "langchain4j", "camel jbang", "camel tui", "camel 4.23", "llm"]
+preview: "Apache Camel 4.23 adds GenAI observability — OpenTelemetry spans and 
Micrometer metrics for LLM routes. Prototype it in minutes with JBang, Ollama, 
and the Camel TUI."
+---
+
+Once LLMs live inside Camel routes, the next question is always the same: *how 
much are we spending, and
+where is latency coming from?* Apache Camel **4.23** introduces **GenAI 
observability** — OpenTelemetry spans
+and Micrometer metrics for LLM producers, aligned with the
+[OpenTelemetry GenAI semantic 
conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/).
+
+This is **Blog 1** in a two-part series. We start with the fastest path to 
visible AI telemetry: Camel JBang,
+a LangChain4j chat route, [Ollama](https://ollama.com/), and the Camel CLI/TUI 
— no Spring Boot required.
+
+Special thanks to **Claus Ibsen** for guidance on shaping this material.
+
+## The three phases of Camel Gen AI
+
+| Phase | Name | What you do |
+|-------|------|-------------|
+| 1 | **Connect** | Wire LLMs into routes (`langchain4j-chat`, `openai`, 
Spring AI) |
+| 2 | **Act** | Give AI tools via `ai-tool:`, agents, MCP server, A2A |
+| 3 | **Operate** | Run in production with guardrails, RAG, and **GenAI 
observability** |
+
+This post covers Phase 1 plus the first observability prototype.
+[Part 2](/blog/2026/08/camel-genai-observability-spring-boot/) moves to Spring 
Boot and a full observability
+stack (Prometheus, VictoriaTraces, Perses).
+
+## What you'll build
+
+A timer-driven route that calls Ollama every 15 seconds. For each LLM 
invocation you get:
+
+- Micrometer timer: `gen_ai.client.operation`
+- Micrometer counter: `gen_ai.client.token.usage` (tags `input` / `output`)
+- OpenTelemetry child spans with `gen_ai.request.model`, token counts, finish 
reason
+- Exchange headers: `CamelLangChain4jChatRequestModel`, 
`CamelLangChain4jChatResponseModel`
+- TUI **Spans** tab visualization + AI Usage view (**Ctrl+U**)
+
+```
+timer:genai (every 15s)
+  └─ langchain4j-chat (Ollama ChatModel)
+       ├─ camel-ai-observability-api  → start GenAI span + record metrics
+       ├─ camel-opentelemetry2          → export span attributes
+       └─ camel-micrometer            → gen_ai.client.* metrics
+
+camel run --observe
+  └─ camel-observability-services
+       ├─ /observe/health
+       ├─ /observe/metrics  (Prometheus format)
+       └─ TUI Spans collector (embedded OTLP for dev)
+
+camel tui
+  ├─ Spans tab (shortcut: o)
+  └─ AI panel + Ctrl+U (CLI ask + route GenAI usage combined)
+```
+
+## Prerequisites
+
+- Camel JBang **4.23+** (`camel version`)
+- Ollama installed and running
+
+```shell
+ollama pull llama3.2
+ollama serve
+```
+
+## Run the example
+
+The bundled example ships with Camel 4.23 at
+`dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/ai/genai-observability/`
+([source on GitHub](https://github.com/apache/camel/pull/25891/files)).
+
+```shell
+cd ai/genai-observability
+
+camel run GenAiObservabilityRoute.java application.properties \
+  --observe \
+  --dependency=camel-langchain4j-chat \
+  --dependency=camel-ai-observability \
+  --dependency=langchain4j-ollama
+```
+
+The `--observe` flag adds `camel-observability-services`, enables health 
checks, Micrometer metrics,
+OpenTelemetry tracing, and powers the TUI **Spans** tab on the management port 
(default `9876`).
+
+Wait for log lines like:
+
+```text
+LLM reply: Apache Camel is an open source integration framework...
+Request model: llama3.2
+Response model: llama3.2
+```
+
+## Inspect Prometheus metrics
+
+```shell
+curl -s http://127.0.0.1:9876/observe/metrics | grep gen_ai
+```
+
+Example output (abbreviated):
+
+```text
+# HELP gen_ai_client_operation GenAI client operation duration
+gen_ai_client_operation_count{gen_ai_operation_name="chat",gen_ai_system="langchain4j",...}
 3.0
+
+# HELP gen_ai_client_token_usage GenAI token usage
+gen_ai_client_token_usage_total{gen_ai_token_type="input",...} 42.0
+gen_ai_client_token_usage_total{gen_ai_token_type="output",...} 18.0
+```
+
+## Explore spans in the TUI
+
+Open a second terminal:
+
+```shell
+camel tui
+```
+
+1. Select the running integration (`genai-observability` or similar)
+2. Press **o** or navigate to **More → Spans**
+3. Wait for the next timer tick (~15s) and watch a new span appear
+
+Key span attributes:
+
+| Attribute | Meaning |
+|-----------|---------|
+| `gen_ai.operation.name` | e.g. `chat`, `embeddings` |
+| `gen_ai.system` | Provider abstraction (e.g. `langchain4j`) |
+| `gen_ai.request.model` | Model requested |
+| `gen_ai.response.model` | Model that served the response |
+| `gen_ai.usage.input_tokens` | Prompt tokens |
+| `gen_ai.usage.output_tokens` | Completion tokens |
+| `camel.component` | e.g. `langchain4j-chat` |
+
+Press **Ctrl+U** in the AI panel to toggle the **AI Usage** view — token 
consumption from both
+TUI `camel ask` prompts and route LLM calls on one screen.
+
+## Example route
+
+```java
+import dev.langchain4j.model.chat.ChatModel;
+import dev.langchain4j.model.ollama.OllamaChatModel;
+import org.apache.camel.builder.RouteBuilder;
+
+import static java.time.Duration.ofSeconds;
+
+public class GenAiObservabilityRoute extends RouteBuilder {
+
+    @Override
+    public void configure() {
+        ChatModel chatModel = OllamaChatModel.builder()

Review Comment:
   Added a note in the Example route section: Java today, with YAML 
DSL/Kamelets as a future direction for non-Java developers.
   
   _AI-generated reply on behalf of atiaomar1978-hub (Cursor Cloud Agent)_



##########
content/blog/2026/08/camel-genai-observability-jbang/index.md:
##########
@@ -0,0 +1,222 @@
+---
+title: "Observe Your Camel AI Routes with GenAI OpenTelemetry"
+date: 2026-08-29
+draft: false
+authors: [atiaomar1978-hub]
+categories: ["AI", "Howtos"]
+keywords: ["apache camel", "genai", "observability", "opentelemetry", 
"ollama", "langchain4j", "camel jbang", "camel tui", "camel 4.23", "llm"]
+preview: "Apache Camel 4.23 adds GenAI observability — OpenTelemetry spans and 
Micrometer metrics for LLM routes. Prototype it in minutes with JBang, Ollama, 
and the Camel TUI."
+---
+
+Once LLMs live inside Camel routes, the next question is always the same: *how 
much are we spending, and
+where is latency coming from?* Apache Camel **4.23** introduces **GenAI 
observability** — OpenTelemetry spans
+and Micrometer metrics for LLM producers, aligned with the
+[OpenTelemetry GenAI semantic 
conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/).
+
+This is **Blog 1** in a two-part series. We start with the fastest path to 
visible AI telemetry: Camel JBang,
+a LangChain4j chat route, [Ollama](https://ollama.com/), and the Camel CLI/TUI 
— no Spring Boot required.
+
+Special thanks to **Claus Ibsen** for guidance on shaping this material.
+
+## The three phases of Camel Gen AI
+
+| Phase | Name | What you do |
+|-------|------|-------------|
+| 1 | **Connect** | Wire LLMs into routes (`langchain4j-chat`, `openai`, 
Spring AI) |
+| 2 | **Act** | Give AI tools via `ai-tool:`, agents, MCP server, A2A |
+| 3 | **Operate** | Run in production with guardrails, RAG, and **GenAI 
observability** |
+
+This post covers Phase 1 plus the first observability prototype.
+[Part 2](/blog/2026/08/camel-genai-observability-spring-boot/) moves to Spring 
Boot and a full observability
+stack (Prometheus, VictoriaTraces, Perses).
+
+## What you'll build
+
+A timer-driven route that calls Ollama every 15 seconds. For each LLM 
invocation you get:
+
+- Micrometer timer: `gen_ai.client.operation`
+- Micrometer counter: `gen_ai.client.token.usage` (tags `input` / `output`)
+- OpenTelemetry child spans with `gen_ai.request.model`, token counts, finish 
reason
+- Exchange headers: `CamelLangChain4jChatRequestModel`, 
`CamelLangChain4jChatResponseModel`
+- TUI **Spans** tab visualization + AI Usage view (**Ctrl+U**)
+
+```
+timer:genai (every 15s)
+  └─ langchain4j-chat (Ollama ChatModel)
+       ├─ camel-ai-observability-api  → start GenAI span + record metrics
+       ├─ camel-opentelemetry2          → export span attributes
+       └─ camel-micrometer            → gen_ai.client.* metrics
+
+camel run --observe
+  └─ camel-observability-services
+       ├─ /observe/health
+       ├─ /observe/metrics  (Prometheus format)
+       └─ TUI Spans collector (embedded OTLP for dev)
+
+camel tui
+  ├─ Spans tab (shortcut: o)
+  └─ AI panel + Ctrl+U (CLI ask + route GenAI usage combined)
+```
+
+## Prerequisites
+
+- Camel JBang **4.23+** (`camel version`)
+- Ollama installed and running
+
+```shell
+ollama pull llama3.2
+ollama serve
+```
+
+## Run the example
+
+The bundled example ships with Camel 4.23 at
+`dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/ai/genai-observability/`
+([source on GitHub](https://github.com/apache/camel/pull/25891/files)).
+
+```shell
+cd ai/genai-observability
+
+camel run GenAiObservabilityRoute.java application.properties \
+  --observe \
+  --dependency=camel-langchain4j-chat \
+  --dependency=camel-ai-observability \
+  --dependency=langchain4j-ollama
+```
+
+The `--observe` flag adds `camel-observability-services`, enables health 
checks, Micrometer metrics,
+OpenTelemetry tracing, and powers the TUI **Spans** tab on the management port 
(default `9876`).
+
+Wait for log lines like:
+
+```text
+LLM reply: Apache Camel is an open source integration framework...
+Request model: llama3.2
+Response model: llama3.2
+```
+
+## Inspect Prometheus metrics
+
+```shell
+curl -s http://127.0.0.1:9876/observe/metrics | grep gen_ai
+```
+
+Example output (abbreviated):
+
+```text
+# HELP gen_ai_client_operation GenAI client operation duration
+gen_ai_client_operation_count{gen_ai_operation_name="chat",gen_ai_system="langchain4j",...}
 3.0
+
+# HELP gen_ai_client_token_usage GenAI token usage
+gen_ai_client_token_usage_total{gen_ai_token_type="input",...} 42.0
+gen_ai_client_token_usage_total{gen_ai_token_type="output",...} 18.0
+```
+
+## Explore spans in the TUI
+
+Open a second terminal:
+
+```shell
+camel tui
+```
+
+1. Select the running integration (`genai-observability` or similar)
+2. Press **o** or navigate to **More → Spans**
+3. Wait for the next timer tick (~15s) and watch a new span appear
+
+Key span attributes:
+
+| Attribute | Meaning |
+|-----------|---------|
+| `gen_ai.operation.name` | e.g. `chat`, `embeddings` |
+| `gen_ai.system` | Provider abstraction (e.g. `langchain4j`) |
+| `gen_ai.request.model` | Model requested |
+| `gen_ai.response.model` | Model that served the response |
+| `gen_ai.usage.input_tokens` | Prompt tokens |
+| `gen_ai.usage.output_tokens` | Completion tokens |
+| `camel.component` | e.g. `langchain4j-chat` |
+
+Press **Ctrl+U** in the AI panel to toggle the **AI Usage** view — token 
consumption from both
+TUI `camel ask` prompts and route LLM calls on one screen.
+
+## Example route
+
+```java
+import dev.langchain4j.model.chat.ChatModel;
+import dev.langchain4j.model.ollama.OllamaChatModel;
+import org.apache.camel.builder.RouteBuilder;
+
+import static java.time.Duration.ofSeconds;
+
+public class GenAiObservabilityRoute extends RouteBuilder {
+
+    @Override
+    public void configure() {
+        ChatModel chatModel = OllamaChatModel.builder()
+                .baseUrl("{{ollama.baseUrl:http://localhost:11434}}";)
+                .modelName("{{ollama.model:llama3.2}}")
+                .temperature(0.2)
+                .timeout(ofSeconds(120))
+                .build();
+        getContext().getRegistry().bind("chatModel", chatModel);
+
+        from("timer:genai?period={{genai.period:15000}}")
+                .routeId("genai-chat")
+                .setBody(constant("In one sentence, what is Apache Camel 
integration?"))
+                .to("langchain4j-chat:demo?chatModel=#chatModel")
+                .log("LLM reply: ${body}")
+                .log("Request model: 
${header.CamelLangChain4jChatRequestModel}")
+                .log("Response model: 
${header.CamelLangChain4jChatResponseModel}");
+    }
+}
+```
+
+### application.properties
+
+```properties
+ollama.baseUrl=http://localhost:11434
+ollama.model=llama3.2
+genai.period=15000
+
+# GenAI observability — enabled by default when backends present
+camel.ai.observability.enabled=true
+```
+
+GenAI observability also covers `openai:` — run with 
`--dependency=camel-openai` and the same
+`--observe` flag; spans use the same `gen_ai.*` attributes.
+
+## What's instrumented today
+
+| Component | Operations observed |
+|-----------|---------------------|
+| `langchain4j-chat` | Chat completions |
+| `langchain4j-tools` | Tool-augmented LLM calls |
+| `langchain4j-agent` | AI Service agent loops |
+| `langchain4j-embeddings` | Embedding generation |
+| `openai` | Chat, embeddings, Responses API, etc. |
+
+## Troubleshooting
+
+| Symptom | Fix |
+|---------|-----|
+| No `gen_ai` metrics | Confirm `--observe` or manual observability config; 
check `camel-ai-observability` on classpath |
+| Empty Spans tab | Wait for at least one LLM call; verify 
`camel.opentelemetry2.enabled=true` |
+| Ollama connection refused | Run `ollama serve`; check `ollama.baseUrl` |
+| Metrics port unreachable | Default management port is `9876`; look for 
`Management service available` in logs |
+
+## Next up — Spring Boot and the observability stack
+
+[Part 2](/blog/2026/08/camel-genai-observability-spring-boot/) wires the same 
`gen_ai.*` signals into

Review Comment:
   Done — Part 1 Next up section includes `camel export 
GenAiObservabilityRoute.java --runtime spring-boot` with a pointer to Part 2.
   
   _AI-generated reply on behalf of atiaomar1978-hub (Cursor Cloud Agent)_



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to