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.10+
  • 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

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

File details

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

File metadata

File hashes

Hashes for openinference_instrumentation_portkey-0.1.8.tar.gz
Algorithm Hash digest
SHA256 63c8a89ac842dbfae48267d23c06c69e37fdbcfe65bb6b65835891fef1f560ed
MD5 31ec33389a4d0ec1fa1f24425881f2e3
BLAKE2b-256 f83a75741fc5ed8c01f1b2d6ff5d40e3e93a52918c17b6a85c4850c051815deb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openinference_instrumentation_portkey-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 b9be21bf495b19e0203d0d31151ba78cf292b53e98a8d1897a2e1f07ce3fc49b
MD5 3f857fa6aaef4841fdb666efc159f5a2
BLAKE2b-256 ba72440365310942c3ab7d490cdd605d5733194cfaacfe6f737d117234362925

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