Skip to main content

NTT AI Observability Exporter for Azure Monitor OpenTelemetry in AI Foundry projects

Project description

NTT AI Observability Exporter

A specialized telemetry exporter for NTT AI Foundry projects using Azure Monitor OpenTelemetry. This package simplifies telemetry setup for AI applications built with Azure services.

Features

  • Automatic instrumentation of Azure SDK libraries
  • Simplified configuration for Azure Monitor OpenTelemetry
  • Specialized support for Semantic Kernel telemetry
  • Compatible with Azure AI Foundry projects

Installation

# Using pip
pip install ntt-ai-observability-exporter

# Using uv
uv pip install ntt-ai-observability-exporter

Updating Your Package Documentation

Make sure to add a note in your package documentation (such as README.md) about the dependencies:

## Dependencies

This package depends on:
- azure-monitor-opentelemetry (>=1.0.0)
- opentelemetry-sdk (>=1.15.0)

These dependencies will be automatically installed when you install the package via pip.

```bash
# Using pip
pip install ntt-ai-observability-exporter

# Using uv
uv pip install ntt-ai-observability-exporter

Usage

Simple Usage - One Line Setup

from ntt_ai_observability_exporter import configure_telemetry

# That's it! This single line configures all telemetry
configure_telemetry()

# Now you can use your AI components normally - telemetry is automatic

Configuration Options

# Explicit configuration
configure_telemetry(
    connection_string="InstrumentationKey=your-key;IngestionEndpoint=your-endpoint",
    customer_name="your-customer",
    agent_name="your-agent"
)

What Gets Instrumented Automatically

The Azure Monitor OpenTelemetry package automatically instruments:

  • Azure SDK libraries (including azure.ai.openai)
  • HTTP client libraries (requests, aiohttp)

This means when you use Azure AI Foundry components, telemetry is captured without any additional code.

Configuration Parameters

  • connection_string: Azure Monitor connection string
  • customer_name: Maps to service.name in OpenTelemetry resource
  • agent_name: Maps to service.instance.id in OpenTelemetry resource

Environment Variables

You can set these environment variables:

  • AZURE_MONITOR_CONNECTION_STRING: The connection string for Azure Monitor
  • CUSTOMER_NAME: Maps to service.name in OpenTelemetry resource
  • AGENT_NAME: Maps to service.instance.id in OpenTelemetry resource

Telemetry Types Captured

The configuration captures:

  • Traces: Request flows and operations
  • Metrics: Performance measurements
  • Logs: When integrated with Python logging

Example in Azure AI Foundry Project

# Import the NTT AI Observability Exporter
from ntt_ai_observability_exporter import configure_telemetry

# Configure telemetry with your project details
configure_telemetry(
    connection_string="InstrumentationKey=xxx;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com/",
    customer_name="customer-name-foundry",
    agent_name="ai-foundry-agent"
)

# Now use Azure AI components as normal - telemetry is automatic
from azure.ai.assistant import AssistantClient

client = AssistantClient(...)
# All operations are automatically instrumented

Semantic Kernel Telemetry Support

For applications using Semantic Kernel, use the specialized configuration function:

from ntt_ai_observability_exporter import configure_semantic_kernel_telemetry

# Configure Semantic Kernel telemetry BEFORE creating any Kernel instances
configure_semantic_kernel_telemetry(
    connection_string="your_connection_string",
    customer_name="your_customer_name",
    agent_name="your_agent_name"
)

# Then create and use your Semantic Kernel
from semantic_kernel import Kernel
kernel = Kernel()
# ... rest of your code

Development and Testing

Installation for Development

Install the package with development dependencies:

# Install with development dependencies
pip install -e ".[dev]"

# Or install with just testing dependencies
pip install -e ".[test]"

# Or install from requirements-dev.txt
pip install -r requirements-dev.txt

Running Tests

# Run all tests
pytest

# Run tests with coverage
pytest --cov=src/ntt_ai_observability_exporter

# Run tests with detailed coverage report
pytest --cov=src/ntt_ai_observability_exporter --cov-report=term-missing

# Run specific test file
pytest tests/test_semantic_kernel_telemetry.py -v

Test Coverage

The package includes comprehensive unit tests with:

  • 93% overall test coverage
  • 100% coverage for semantic kernel telemetry module
  • 17 test cases covering all functionality
  • Validation of configuration, error handling, and Azure Monitor integration

Code Quality

The project uses:

  • pytest for testing framework
  • black for code formatting
  • flake8 for linting
  • mypy for type checking
  • isort for import sorting

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ntt_ai_observability_exporter-0.2.0.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ntt_ai_observability_exporter-0.2.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file ntt_ai_observability_exporter-0.2.0.tar.gz.

File metadata

File hashes

Hashes for ntt_ai_observability_exporter-0.2.0.tar.gz
Algorithm Hash digest
SHA256 20a26db08d5f0f3928868671db2035ad66a2560c7db51572d754714f2dc2922e
MD5 fbec53a7d3909068600a2fdc9f3be893
BLAKE2b-256 074f04be5ce3c6f002ae61ccf87e76b0e46fb333b715dd7ab2a9230ef2fb80f4

See more details on using hashes here.

File details

Details for the file ntt_ai_observability_exporter-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ntt_ai_observability_exporter-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36bcda79afd3f82a44fcfb2cd12824c2e31167ee83031264f94a595ba57a1128
MD5 bca9c6fbb611d784c3eb1dfbe9e094ad
BLAKE2b-256 332a142de8e41143eaeba5001421fc77e9fc4ccdc1b0b439f6f2dbd48d971e08

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page