Name | outerop-instrumentation JSON |
Version |
0.1.2
JSON |
| download |
home_page | None |
Summary | None |
upload_time | 2024-03-20 17:26:59 |
maintainer | None |
docs_url | None |
author | Alexander |
requires_python | <4.0,>=3.11 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 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:
```bash
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:
```python
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.
Raw data
{
"_id": null,
"home_page": null,
"name": "outerop-instrumentation",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.11",
"maintainer_email": null,
"keywords": null,
"author": "Alexander",
"author_email": "alex@outerop.com",
"download_url": "https://files.pythonhosted.org/packages/4c/81/1fee3ce11c535d5aa26ef1dae72f041cda377398d972860670d6c01a9864/outerop_instrumentation-0.1.2.tar.gz",
"platform": null,
"description": "# OuteropInstrumentor\n\nOuteropInstrumentor 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.\n\n## Installation\n\nEnsure you have Python installed on your machine. You can install the package using pip:\n\n```bash\npip install outerop-instrumentation\npip install outerop \n```\n\n## Quick Start\nTo get started with OuteropInstrumentor, follow the steps below to instrument your application:\n\nConfigure OpenTelemetry Tracer Provider:\n```python\nfrom outerop import Outerop\nfrom outerop_instrumentation import OuteropInstrumentor\nfrom opentelemetry import trace as trace_api\nfrom opentelemetry.sdk.trace.export import ConsoleSpanExporter, SimpleSpanProcessor\nfrom opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter\nfrom opentelemetry.sdk.resources import Resource\nfrom opentelemetry.sdk import trace as trace_sdk\n\n# Endpoint for the OTLP exporter\nendpoint = \"http://localhost:4318/v1/traces\"\n\n# Resource attributes\nresource = Resource.create({\"service.name\": \"outerop-service\"})\n\n# Tracer provider setup\ntracer_provider = trace_sdk.TracerProvider(resource=resource)\ntracer_provider.add_span_processor(SimpleSpanProcessor(ConsoleSpanExporter()))\ntracer_provider.add_span_processor(SimpleSpanProcessor(OTLPSpanExporter(endpoint)))\ntrace_api.set_tracer_provider(tracer_provider)\n\n# Instrument Outerop\nOuteropInstrumentor().instrument()\n\nouterop = Outerop(outerop_api_key=\"your_api_key\", options={\n \"openaiApiKey\": \"your_openai_api_key\"\n})\n\nresult = outerop.chat(\n prompt_uuid=\"<UUID>\",\n environment=\"<environment>\",\n version=\"<Version>\",\n variables={\"variable\": \"example\"}\n)\n```\n\n## Usage\nAfter 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.\n\nFor more advanced usage and configurations, refer to the OpenTelemetry and Outerop documentation.\n\n## Support\nIf you encounter any issues or have questions about using the OuteropInstrumentor, please file an issue on our GitHub repository.\n\n## Contributing\nWe welcome contributions! If you would like to contribute to the project, please read our CONTRIBUTING.md file for guidelines.",
"bugtrack_url": null,
"license": null,
"summary": null,
"version": "0.1.2",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5481bb74655fb06fd1275a2f46556bd3fec334a3189c10ec7779262f2b362ba6",
"md5": "3a2118655cc72b4424ae3246d263eea7",
"sha256": "63552320f7a270aa3b07a80e3951decf8ad12fdf14d7bcb676713a6181df90db"
},
"downloads": -1,
"filename": "outerop_instrumentation-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3a2118655cc72b4424ae3246d263eea7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.11",
"size": 3504,
"upload_time": "2024-03-20T17:26:58",
"upload_time_iso_8601": "2024-03-20T17:26:58.357093Z",
"url": "https://files.pythonhosted.org/packages/54/81/bb74655fb06fd1275a2f46556bd3fec334a3189c10ec7779262f2b362ba6/outerop_instrumentation-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4c811fee3ce11c535d5aa26ef1dae72f041cda377398d972860670d6c01a9864",
"md5": "aea59629dab232ff57c7d58c0430a8ee",
"sha256": "5cab384e2d90bd6074a65a5bffd0858d10f1811c8fbe757dec29c3650c192514"
},
"downloads": -1,
"filename": "outerop_instrumentation-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "aea59629dab232ff57c7d58c0430a8ee",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.11",
"size": 3026,
"upload_time": "2024-03-20T17:26:59",
"upload_time_iso_8601": "2024-03-20T17:26:59.940514Z",
"url": "https://files.pythonhosted.org/packages/4c/81/1fee3ce11c535d5aa26ef1dae72f041cda377398d972860670d6c01a9864/outerop_instrumentation-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-20 17:26:59",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "outerop-instrumentation"
}