Comments (4)
🤖
Hello,
Thank you for your interest in the one-click observability feature. As of now, the Portkey Python SDK does not have built-in support for observability. However, you can integrate it with an external observability tool of your choice. Here's a general way to do it:
-
Choose an observability tool that supports Python. Some popular choices are Datadog, New Relic, and Elastic APM.
-
Install the observability tool's Python SDK. This is usually done via pip. For example, if you're using Datadog, you would run
pip install datadog
. -
Configure the observability tool. This usually involves setting some environment variables or calling a setup function with your API key and other configuration options.
-
Instrument the Portkey Python SDK. This involves adding calls to the observability tool's API at key points in your code. For example, you might start a new transaction at the beginning of a request to the Portkey API, and end it when the request is done.
Here's an example of how you might do this with Datadog:
from datadog import initialize, statsd
import portkey
# Initialize Datadog
options = {
'statsd_host':'127.0.0.1',
'statsd_port':8125
}
initialize(**options)
# Use Portkey
def use_portkey():
statsd.increment('portkey.requests')
try:
# Your code here
pass
except Exception:
statsd.increment('portkey.errors')
finally:
statsd.decrement('portkey.requests')
use_portkey()
In this example, we're tracking the number of active requests and the number of errors. You can add more metrics as needed.
Please note that this is a general guide and the exact steps may vary depending on the observability tool you choose. Always refer to the tool's official documentation for the most accurate information.
As for the one-click observability feature, it would require changes to the Portkey Python SDK. These changes would likely involve adding built-in support for one or more observability tools, and providing a way to enable them with a single configuration option. This would be a significant undertaking and would need to be prioritized and scheduled by the maintainers of the SDK.
I hope this helps! If you have any other questions, feel free to ask.
Sources
- setup.cfg
- portkey/init.py
- portkey/api_resources/init.py
- portkey/api_resources/base_client.py
- portkey/api_resources/utils.py
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
from portkey-python-sdk.
@noble-varghese Tell Dosu what you want in the comment. For example, "How do I implement this feature?"
From this issue description Dosu, thinks its help isn't needed because there isn't a clear request
from portkey-python-sdk.
from portkey-python-sdk.
How do I implement this feature?
from portkey-python-sdk.
Related Issues (20)
- Add blurb about OpenAI wrapper benefits HOT 1
- PythonSDK: OpenAI dependency HOT 1
- PythonSDK: DevEx HOT 1
- PythonSDK: prompt methods
- PythonSDK: black dependency
- Fix: Pydantic v1 private attribute error
- Update typing dependencies version version contraint HOT 1
- Allow tools, tool_choice, logprobs and top_logprobs for chat completions HOT 1
- Fix: pydantic v2 compatibility for Optional fields HOT 1
- Too strict `mypy` dependency HOT 3
- Allow new embeddings params in python SDK HOT 1
- Bug: Cache Force Refresh not working in python SDK HOT 1
- [Bug]: portkey_ai.api_resources.exceptions.NotFoundError: Error code: 404 - Unable to find requested model. Please confirm that the model exists and you have permission. (Request ID: ) HOT 4
- Update python-sdk README (async) HOT 1
- Revamp Python SDK: Wrapper HOT 1
- [Bug]: ModuleNotFoundError: No module named 'llama_index.llms.anthropic_utils' HOT 4
- Support for Custom Host & Forward Headers HOT 2
- Python: DevEx: Suggestion HOT 1
- PythonSDK Render Method HOT 1
- Fix: build errors due to test cases HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from portkey-python-sdk.