# Ops Module
<div className="badge-container">
<a href="https://github.com/Mirascope/mirascope/actions/workflows/ci.yml" target="_blank"><img src="https://github.com/Mirascope/mirascope/actions/workflows/ci.yml/badge.svg?branch=main" alt="Tests"/></a>
<a href="https://app.codecov.io/github/Mirascope/mirascope" target="_blank"><img src="https://codecov.io/github/Mirascope/mirascope/graph/badge.svg?token=HAEAWT3KC9" alt="Coverage"/></a>
<a href="https://pypi.org/project/mirascope/" target="_blank"><img src="https://img.shields.io/pypi/v/mirascope.svg" alt="PyPI Version"/></a>
<a href="https://pypi.org/project/mirascope/" target="_blank"><img src="https://img.shields.io/pypi/pyversions/mirascope.svg" alt="Python Versions"/></a>
<a href="https://github.com/Mirascope/mirascope/blob/main/python/LICENSE" target="_blank"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License"/></a>
</div>
The `mirascope.ops` module provides observability and management capabilities for LLM applications. It enables distributed tracing, function versioning, and session management, all built on [OpenTelemetry](https://opentelemetry.io/) so you can use any OTEL-compatible backend.
## Core Concepts
| Concept | Description |
| --- | --- |
| [Configuration](/docs/ops/configuration) | Connect to any OpenTelemetry-compatible backend |
| [Tracing](/docs/ops/tracing) | Track function execution with `@ops.trace` |
| [Sessions](/docs/ops/sessions) | Group related traces with `ops.session()` |
| [Spans](/docs/ops/spans) | Create explicit spans with `ops.span()` |
## Advanced Topics
| Topic | Description |
| --- | --- |
| [Versioning](/docs/ops/versioning) | Track function versions with `@ops.version` |
| [LLM Instrumentation](/docs/ops/instrumentation) | Automatic tracing for LLM calls |
| [Context Propagation](/docs/ops/context-propagation) | Distributed tracing across services |
## Quick Start
1. Install dependencies:
```bash
pip install "mirascope[otel]"
```
2. Configure tracing with your preferred backend and trace your functions:
```python
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import ConsoleSpanExporter, SimpleSpanProcessor
from mirascope import llm, ops
# Configure tracing (console exporter for development)
provider = TracerProvider()
provider.add_span_processor(SimpleSpanProcessor(ConsoleSpanExporter()))
ops.configure(tracer_provider=provider)
@ops.trace
@llm.call("openai/gpt-4o-mini")
def recommend_book(genre: str) -> str:
return f"Recommend a {genre} book"
response = recommend_book("fantasy")
print(response.text())
```
## OpenTelemetry Compatible
The ops module is built on [OpenTelemetry](https://opentelemetry.io/), so you can export traces to any OTEL-compatible backend including [Langfuse](https://langfuse.com), Jaeger, Zipkin, Grafana Tempo, Datadog, and more. See [Configuration](/docs/ops/configuration) for details.
## Next Steps
- [Configuration](/docs/ops/configuration) — Set up your preferred observability backend
- [Tracing](/docs/ops/tracing) — Learn about the `@ops.trace` decorator