Skip to main content

OpenInference Portkey AI Instrumentation

Project description

OpenInference Portkey AI Instrumentation

This package provides instrumentation for the Portkey AI library using OpenInference.

Installation

pip install openinference-instrumentation-portkey

Usage

from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import ConsoleSpanExporter
from opentelemetry.sdk.trace.export import SimpleSpanProcessor

from openinference.instrumentation.portkey import PortkeyInstrumentor

# Set up the tracer provider
trace.set_tracer_provider(TracerProvider())
trace.get_tracer_provider().add_span_processor(
    SimpleSpanProcessor(ConsoleSpanExporter())
)

# Instrument Portkey AI
PortkeyInstrumentor().instrument()

# Use Portkey AI as usual
# ...

# Uninstrument when done
PortkeyInstrumentor().uninstrument()

Features

  • Automatic instrumentation of Portkey AI API calls
  • Capture of input messages, output messages, and model information
  • Integration with OpenTelemetry for distributed tracing

Requirements

  • Python 3.9+
  • Portkey AI 0.1.0+

License

Apache License 2.0

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

Built Distribution

File details

Details for the file openinference_instrumentation_portkey-0.1.0.tar.gz.

File metadata

File hashes

Hashes for openinference_instrumentation_portkey-0.1.0.tar.gz
Algorithm Hash digest
SHA256 52ead3b9a03672a171446bbf802d8c88ab9677cfb871d17e2e167caaacb46d2f
MD5 a8be1006b75f10be6d07799b9aeed36b
BLAKE2b-256 29d9b392f97a10ff5927a36f03c8bc1f8769092e75c792dedf8107f597c25d60

See more details on using hashes here.

File details

Details for the file openinference_instrumentation_portkey-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for openinference_instrumentation_portkey-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e5631c63a937f13d86646340d2a49edb34893667d9518276aa6937265db6bfa
MD5 e7802b02fd392d1be2cb86863c44d6de
BLAKE2b-256 df09a95191c7b4b8edebb7efc361fceb4c0de48023205bdf46c37d35d7b5b8a7

See more details on using hashes here.

Supported by

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