No project description provided
Project description
OuteropInstrumentor
OuteropInstrumentor is a tool designed to integrate Outerop services with OpenTelemetry. It provides observability and tracing capabilities for applications using Outerop. This package allows developers to instrument their code, enabling detailed insights into the performance and behavior of their Outerop interactions.
Installation
Ensure you have Python installed on your machine. You can install the package using pip:
pip install outerop-instrumentation
pip install outerop
Quick Start
To get started with OuteropInstrumentor, follow the steps below to instrument your application:
Configure OpenTelemetry Tracer Provider:
from outerop import Outerop
from outerop_instrumentation import OuteropInstrumentor
from opentelemetry import trace as trace_api
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
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file outerop_instrumentation-0.1.2.tar.gz.
File metadata
- Download URL: outerop_instrumentation-0.1.2.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.2 Darwin/22.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5cab384e2d90bd6074a65a5bffd0858d10f1811c8fbe757dec29c3650c192514
|
|
| MD5 |
aea59629dab232ff57c7d58c0430a8ee
|
|
| BLAKE2b-256 |
4c811fee3ce11c535d5aa26ef1dae72f041cda377398d972860670d6c01a9864
|
File details
Details for the file outerop_instrumentation-0.1.2-py3-none-any.whl.
File metadata
- Download URL: outerop_instrumentation-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.2 Darwin/22.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63552320f7a270aa3b07a80e3951decf8ad12fdf14d7bcb676713a6181df90db
|
|
| MD5 |
3a2118655cc72b4424ae3246d263eea7
|
|
| BLAKE2b-256 |
5481bb74655fb06fd1275a2f46556bd3fec334a3189c10ec7779262f2b362ba6
|