From cb41f2674c91561a90603bd860bdf056c6f37ed9 Mon Sep 17 00:00:00 2001 From: Hardik Shah Date: Thu, 23 Jan 2025 12:11:14 -0800 Subject: [PATCH] fixes --- .../agent_execution_loop.md | 2 +- .../source/building_applications/telemetry.md | 21 +++++++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/docs/source/building_applications/agent_execution_loop.md b/docs/source/building_applications/agent_execution_loop.md index 62fb314bc..eec8fee95 100644 --- a/docs/source/building_applications/agent_execution_loop.md +++ b/docs/source/building_applications/agent_execution_loop.md @@ -1,4 +1,4 @@ -# Agent Execution Loop +## Agent Execution Loop Agents are the heart of complex AI applications. They combine inference, memory, safety, and tool usage into coherent workflows. At its core, an agent follows a sophisticated execution loop that enables multi-step reasoning, tool usage, and safety checks. diff --git a/docs/source/building_applications/telemetry.md b/docs/source/building_applications/telemetry.md index 45bc7a1c2..25b637821 100644 --- a/docs/source/building_applications/telemetry.md +++ b/docs/source/building_applications/telemetry.md @@ -1,11 +1,10 @@ -# Telemetry - +## Telemetry The Llama Stack telemetry system provides comprehensive tracing, metrics, and logging capabilities. It supports multiple sink types including OpenTelemetry, SQLite, and Console output. -## Key Concepts +#### Key Concepts -### Events +#### Events The telemetry system supports three main types of events: - **Unstructured Log Events**: Free-form log messages with severity levels @@ -31,24 +30,24 @@ structured_log_event = SpanStartPayload( ) ``` -### Spans and Traces +#### Spans and Traces - **Spans**: Represent operations with timing and hierarchical relationships - **Traces**: Collection of related spans forming a complete request flow -### Sinks +#### Sinks - **OpenTelemetry**: Send events to an OpenTelemetry Collector. This is useful for visualizing traces in a tool like Jaeger. - **SQLite**: Store events in a local SQLite database. This is needed if you want to query the events later through the Llama Stack API. - **Console**: Print events to the console. -## Providers +#### Providers -### Meta-Reference Provider +#### Meta-Reference Provider Currently, only the meta-reference provider is implemented. It can be configured to send events to three sink types: 1) OpenTelemetry Collector 2) SQLite 3) Console -## Configuration +#### Configuration Here's an example that sends telemetry signals to all three sink types. Your configuration might use only one. ```yaml @@ -61,7 +60,7 @@ Here's an example that sends telemetry signals to all three sink types. Your con sqlite_db_path: "/path/to/telemetry.db" ``` -## Jaeger to visualize traces +#### Jaeger to visualize traces The `otel` sink works with any service compatible with the OpenTelemetry collector. Let's use Jaeger to visualize this data. @@ -75,6 +74,6 @@ $ docker run --rm --name jaeger \ Once the Jaeger instance is running, you can visualize traces by navigating to http://localhost:16686/. -## Querying Traces Stored in SQLIte +#### Querying Traces Stored in SQLIte The `sqlite` sink allows you to query traces without an external system. Here are some example queries. Refer to the notebook at [Llama Stack Building AI Applications](https://github.com/meta-llama/llama-stack/blob/main/docs/getting_started.ipynb) for more examples on how to query traces and spaces.