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.1.tar.gz (12.3 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.1-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for ntt_ai_observability_exporter-0.2.1.tar.gz
Algorithm Hash digest
SHA256 7bb051cf5f77050a498e7edcaa6ce80ebaddc8dbd8f016a6057e8bee95f4cf05
MD5 6b9809c7de031114329cc2408739f6b3
BLAKE2b-256 4ca263efb4bbbf813aa8a6feac0096ff21a8bd645093c7e20a5113e199863729

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ntt_ai_observability_exporter-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9a47c93413083bf4746d83b384c8d74ac99d54b15835e6144b6c47f015a0431a
MD5 bbbeb000ea577e9743da19b7ca567b73
BLAKE2b-256 3dbb7d419644840b9aa44d9ebdbf2d0606f6c988c6756551897239cda6605720

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