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
@@ -0,0 +1 @@
3.10
80 changes: 80 additions & 0 deletions packages/opentelemetry-instrumentation-azure-search/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# OpenTelemetry Azure AI Search Instrumentation

[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

This library allows tracing client-side calls to Azure AI Search using OpenTelemetry.

## Installation

```bash
pip install opentelemetry-instrumentation-azure-search
```

## Supported Operations

### SearchClient

| Method | Span Name | Attributes Captured |
|--------|-----------|-------------------|
| `search()` | `azure_search.search` | search_text, top, filter, index_name |
| `get_document()` | `azure_search.get_document` | index_name |
| `autocomplete()` | `azure_search.autocomplete` | autocomplete_text, index_name |
| `suggest()` | `azure_search.suggest` | suggest_text, index_name |
| `index_documents()` | `azure_search.index_documents` | documents_count, succeeded_count |
| `upload_documents()` | `azure_search.upload_documents` | documents_count, succeeded_count |
| `merge_documents()` | `azure_search.merge_documents` | documents_count, succeeded_count |
| `merge_or_upload_documents()` | `azure_search.merge_or_upload_documents` | documents_count, succeeded_count |
| `delete_documents()` | `azure_search.delete_documents` | documents_count, succeeded_count |
| `get_document_count()` | `azure_search.get_document_count` | documents_count |

### SearchIndexClient

| Method | Span Name | Attributes Captured |
|--------|-----------|-------------------|
| `create_index()` | `azure_search.create_index` | index_name |
| `create_or_update_index()` | `azure_search.create_or_update_index` | index_name |
| `delete_index()` | `azure_search.delete_index` | index_name |
| `get_index()` | `azure_search.get_index` | index_name |
| `list_indexes()` | `azure_search.list_indexes` | — |
| `get_index_statistics()` | `azure_search.get_index_statistics` | index_doc_count, index_size_bytes |
| `analyze_text()` | `azure_search.analyze_text` | index_name |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

README attribute tables don't match implementation.

Line 40 documents analyze_text() as capturing index_name, but the input-attribute extraction in __init__.py only sets AZURE_SEARCH_INDEX_NAME for ("get_index", "delete_index", "create_index", "create_or_update_index")analyze_text is not in that list, and SearchIndexClient instances don't carry the _index_name fallback used for SearchClient.

Lines 56-58 document create_skillset(), get_skillset(), and delete_skillset() as capturing no attributes ("—"), but the implementation does set AZURE_SEARCH_INDEXER_NAME from the skillset name for these methods (see the __init__.py review comment on this).

Update the table once the corresponding implementation is fixed, so the documented attributes match actual span data.

Also applies to: 56-58

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/opentelemetry-instrumentation-azure-search/README.md` at line 40,
The README attribute table is inconsistent with the Azure Search instrumentation
behavior. After updating the input-attribute extraction logic to capture the
index name for SearchIndexClient.analyze_text and the indexer name for
create_skillset, get_skillset, and delete_skillset, update the corresponding
analyze_text and skillset rows in the README table to document the attributes
actually emitted.

| `get_service_statistics()` | `azure_search.get_service_statistics` | service_usage, service_limit |

### SearchIndexerClient

| Method | Span Name | Attributes Captured |
|--------|-----------|-------------------|
| `create_indexer()` | `azure_search.create_indexer` | indexer_name |
| `create_or_update_indexer()` | `azure_search.create_or_update_indexer` | indexer_name |
| `delete_indexer()` | `azure_search.delete_indexer` | indexer_name |
| `get_indexer()` | `azure_search.get_indexer` | indexer_name |
| `get_indexers()` | `azure_search.get_indexers` | — |
| `get_indexer_status()` | `azure_search.get_indexer_status` | indexer_status |
| `run_indexer()` | `azure_search.run_indexer` | indexer_name |
| `reset_indexer()` | `azure_search.reset_indexer` | indexer_name |
| `create_data_source_connection()` | `azure_search.create_data_source_connection` | — |
| `create_skillset()` | `azure_search.create_skillset` | — |
| `get_skillset()` | `azure_search.get_skillset` | — |
| `delete_skillset()` | `azure_search.delete_skillset` | — |

## Usage

### Auto-instrumentation via Traceloop SDK

```python
from traceloop.sdk import Traceloop

Traceloop.init(app_name="my-rag-app")
```

### Manual instrumentation

```python
from opentelemetry.instrumentation.azure_search import AzureSearchInstrumentor

AzureSearchInstrumentor().instrument()
```

## License

This project is licensed under the Apache License 2.0 — see the [LICENSE](LICENSE) file for details.
Loading