Skip to main content

No project description provided

Project description

Iudex

Next generation observability.

Table of contents

Getting Started

Instrumenting your Python service to send logs to Iudex just takes a few steps.

  1. Pip install dependencies
pip install iudex
  1. At the top of your entrypoint (usually main.py), import instrument from iudex and invoke it.
from iudex.instrumentation import instrument
instrument(
  service_name=__name__, # or any string describing your service
  env="production", # or any string for your env
)
  1. Make sure the app has access to the environment variable IUDEX_API_KEY
  2. You should be all set! Go to https://app.iudex.ai/ and enter your API key
  3. Go to https://app.iudex.ai/logs and press Search to view your logs

FastAPI

If you use FastAPI, we highly recommend instrumenting your app for even more detailed logging and tracing.

Setup is the mostly the same as above, but you'll instead import instrument_fastapi where you define your FastAPI app (usually main.py) at the top of your file.

# Add this
from iudex import instrument_fastapi

# Find this in your codebase
app = FastAPI()

# Add this
instrument_fastapi(
  app=app,
  service_name=__name__, # or any string describing your service
  env="production", # or any string for your env
)

Lambda

If you use lambdas, we recommend instrumenting and adding tracing to your handlers.

  1. Add this to the top of your handler file
from iudex import instrument, trace_lambda
instrument(
  app=app,
  service_name=__name__, # or any string describing your service
  env="production", # or any string for your env
)
  1. Add the decorator to the lambda handler
@trace_lambda(name="name_of_my_lambda")
def lambda_handler(event, context):
  pass

Custom Functions

We recommend that you trace important functions in your code base that would be helpful to see when following a stack trace. It is required to call instrument earlier in the code before the traced function is invoked.

from iudex import instrument, trace

@trace()
def my_function(arg1, arg2):
  pass

Slack Alerts

You can easily configure Slack alerts on a per-log basis.

First visit https://app.iudex.ai/logs and click on the Add to Slack button in the top right.

Once installed to your workspace, tag your logs with the iudex.slack_channel_id attribute.

logger.info("Hello from Slack!", extra={"iudex.slack_channel_id": "YOUR_SLACK_CHANNEL_ID"})

Your channel ID can be found by clicking the name of the channel in the top left, then at the bottom of the dialog that pops up.

As long as the channel is public or you've invited the Iudex app, logs will be sent as messages to their tagged channel any time they are logged.

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

iudex-0.9.0.tar.gz (28.6 kB view hashes)

Uploaded Source

Built Distribution

iudex-0.9.0-py3-none-any.whl (37.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page