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

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.6.tar.gz.

File metadata

File hashes

Hashes for openinference_instrumentation_portkey-0.1.6.tar.gz
Algorithm Hash digest
SHA256 e7b974631ed3443f055c770f66bf833a8fe8714d10da9858429cd080719edc6e
MD5 15ba61b8a9ebc9dbb4350a46e263091b
BLAKE2b-256 9b94d9e4bf945cccd37a04e81b37eb53832fbed110aff367c9efb4997de51879

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openinference_instrumentation_portkey-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 9ec30c803e7881a2407b177255d6964cc2471bd0a3b2897d3821cc13af209ca5
MD5 8c1d811d2ff1453cd39f1c57523d3c2e
BLAKE2b-256 f9b1e85f64622f9361f9625b967cfe787caf62be1f7fdccadb3c4ea2111c572a

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