Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ Dapr Agents inherits Dapr's enterprise-grade operational capabilities, providing
### Built-in Operational Features

- **[Observability]({{% ref observability-concept.md %}})** - Distributed tracing, metrics collection, and logging for agent interactions and workflow execution
- **[Logging for Dapr Agents]({{% ref "operations/observability/logging/dapr-agents.md" %}})** - Setup of logging and OpenTelemetry integration
- **[Security]({{% ref security-concept.md %}})** - mTLS encryption, access control, and secrets management for secure agent communication
- **[Resiliency]({{% ref resiliency-concept.md %}})** - Automatic retries, circuit breakers, and timeout policies for fault-tolerant agent operations
- **[Infrastructure Abstraction]({{% ref components-concept.md %}})** - Dapr components abstract LLM providers, memory stores, storage and messaging backends, enabling seamless transitions between different environments
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
type: docs
title: "How-To: Set up logging for Dapr Agents"
linkTitle: "Dapr Agents"
weight: 2000
description: "How to set up logging for Dapr Agents"
---

## Prerequisites

You'll need to make install the required packages:

```sh
openinference-instrumentation>=0.1.42
openinference-semantic-conventions>=0.1.25
opentelemetry-api>=1.39.0
opentelemetry-exporter-otlp>=1.39.0
opentelemetry-exporter-zipkin-json>=1.39.0
opentelemetry-instrumentation-requests>=0.60b0
opentelemetry-instrumentation-grpc>=0.60b0
opentelemetry-proto>=1.39.0
```

## Setup

Dapr Agents has bindings for using OpenTelemetry for instrumentation. This means you can use a common Python logger to set the required log level (`DEBUG`, `INFO`, `WARNING` and `ERROR`):

```python
import logging

logging.basicConfig(level=logging.WARNING)
```

This log level will propagate to all third party libraries.

### OpenTelemetry integration

Dapr Agents support OpenTelemetry by setting the appropriate provider and processor:

```python
from opentelemetry import _logs
from opentelemetry.sdk._logs import LoggerProvider
from opentelemetry.sdk._logs.export import BatchLogRecordProcessor, ConsoleLogRecordExporter
from dapr_agents.observability import DaprAgentsInstrumentor

logger_provider = LoggerProvider()
log_processor = BatchLogRecordProcessor(ConsoleLogRecordExporter())
logger_provider.add_log_record_processor(log_processor)
_logs.set_logger_provider(logger_provider)
instrumentor = DaprAgentsInstrumentor()
instrumentor.instrument(logger_provider=logger_provider, skip_dep_check=True)
```

Please refer to the current release level for the [Python SDK of OpenTelemetry](https://opentelemetry.io/docs/languages/python/) as the logs API is currently in `development` state.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
type: docs
title: "How-To: Set up Fluentd, Elastic search and Kibana in Kubernetes"
linkTitle: "FluentD"
weight: 2000
weight: 3000
description: "How to install Fluentd, Elastic Search, and Kibana to search logs in Kubernetes"
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
type: docs
title: "How-To: Set-up New Relic for Dapr logging"
linkTitle: "New Relic"
weight: 3000
weight: 4000
description: "Set-up New Relic for Dapr logging"
---

Expand Down
Loading