Skip to main content

No project description provided

Project description

OuteropInstrumentor

The OuteropInstrumentor is a powerful tool designed to integrate Outerop services with OpenTelemetry, providing observability and tracing capabilities for applications using Outerop. This package allows developers to easily instrument their code, enabling detailed insights into the performance and behavior of their Outerop interactions.

Installation

To install the OuteropInstrumentor, you need to have Python installed on your machine. Then, you can install the package using pip:

pip install outerop-instrumentation

Ensure you also have outerop installed:

pip install outerop 

Quick Start

To get started with OuteropInstrumentor, follow the steps below to instrument your application:

Configure OpenTelemetry Tracer Provider:

from opentelemetry import trace as trace_api
from outerop import Outerop
from outerop_instrumentation import OuteropInstrumentor
from opentelemetry.sdk.trace.export import ConsoleSpanExporter, SimpleSpanProcessor
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
from opentelemetry.sdk.resources import Resource
from opentelemetry.sdk import trace as trace_sdk

# Endpoint for the OTLP exporter
endpoint = "http://localhost:4318/v1/traces"

# Resource attributes
resource = Resource.create({"service.name": "outerop-service"})

# Tracer provider setup
tracer_provider = trace_sdk.TracerProvider(resource=resource)
tracer_provider.add_span_processor(SimpleSpanProcessor(ConsoleSpanExporter()))
tracer_provider.add_span_processor(SimpleSpanProcessor(OTLPSpanExporter(endpoint)))
trace_api.set_tracer_provider(tracer_provider)

# Instrument Outerop
OuteropInstrumentor().instrument()

outerop = Outerop(outerop_api_key="your_api_key", options={
    "openaiApiKey": "your_openai_api_key"
})

result = outerop.chat(
    prompt_uuid="<UUID>",
    environment="<environment>",
    version="<Version>",
    variables={"variable": "example"}
)

Usage

After following the quick start guide, your application will be instrumented to provide tracing data to the specified backend (e.g., console, OTLP exporter). You can customize the tracing setup by adjusting the OpenTelemetry and Outerop configurations according to your needs.

For more advanced usage and configurations, refer to the OpenTelemetry and Outerop documentation.

Support

If you encounter any issues or have questions about using the OuteropInstrumentor, please file an issue on our GitHub repository.

Contributing

We welcome contributions! If you would like to contribute to the project, please read our CONTRIBUTING.md file for guidelines.

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

outerop_instrumentation-0.1.1.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

outerop_instrumentation-0.1.1-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file outerop_instrumentation-0.1.1.tar.gz.

File metadata

  • Download URL: outerop_instrumentation-0.1.1.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.2 Darwin/22.4.0

File hashes

Hashes for outerop_instrumentation-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3958114ac3d4c4b305263dd7d61cc270f9ba045aec9bf97ad1d3a6a9073ec662
MD5 5cb6f913076a5a469ed97369680d59ad
BLAKE2b-256 31e7a798cd3a07763d938ed5d746965737a0954bbbd93dc51190ab2e6f60a34b

See more details on using hashes here.

File details

Details for the file outerop_instrumentation-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for outerop_instrumentation-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 30565cf26a3baabfcb45f26f0e4a680b912983e12bfb8aea1b5a73b1eebbfd96
MD5 c369e4ef582870e71c6cff0827ef5374
BLAKE2b-256 0c120324832df22c9d1e64fb64d663f6d86cace1bfcf762a89ab345bf5a4e24a

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