Coder Social home page Coder Social logo

Comments (4)

dosubot avatar dosubot commented on June 15, 2024 2

🤖

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:

  1. Choose an observability tool that supports Python. Some popular choices are Datadog, New Relic, and Elastic APM.

  2. 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.

  3. Configure the observability tool. This usually involves setting some environment variables or calling a setup function with your API key and other configuration options.

  4. 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


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.

devstein avatar devstein commented on June 15, 2024 1

@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.

noble-varghese avatar noble-varghese commented on June 15, 2024

@dosu-bot

from portkey-python-sdk.

noble-varghese avatar noble-varghese commented on June 15, 2024

How do I implement this feature?

from portkey-python-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.