Metadata-Version: 2.1
Name: iudex
Version: 0.9.0
Summary: 
Author: Drake Wong
Author-email: drake@iudex.ai
Requires-Python: >=3.9,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: opentelemetry-distro (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-exporter-otlp-proto-http (>=1.25.0,<2.0.0)
Requires-Dist: opentelemetry-instrumentation-aio-pika (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-aiohttp-client (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-aiopg (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-alephalpha (>=0.23.0,<0.24.0)
Requires-Dist: opentelemetry-instrumentation-anthropic (>=0.23.0,<0.24.0)
Requires-Dist: opentelemetry-instrumentation-asyncio (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-asyncpg (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-aws-lambda (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-bedrock (>=0.23.0,<0.24.0)
Requires-Dist: opentelemetry-instrumentation-boto (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-boto3sqs (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-botocore (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-cassandra (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-celery (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-chromadb (>=0.23.0,<0.24.0)
Requires-Dist: opentelemetry-instrumentation-cohere (>=0.23.0,<0.24.0)
Requires-Dist: opentelemetry-instrumentation-confluent-kafka (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-django (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-elasticsearch (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-falcon (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-fastapi (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-flask (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-google-generativeai (>=0.23.0,<0.24.0)
Requires-Dist: opentelemetry-instrumentation-grpc (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-haystack (>=0.23.0,<0.24.0)
Requires-Dist: opentelemetry-instrumentation-httpx (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-jinja2 (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-kafka-python (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-langchain (>=0.23.0,<0.24.0)
Requires-Dist: opentelemetry-instrumentation-llamaindex (>=0.23.0,<0.24.0)
Requires-Dist: opentelemetry-instrumentation-logging (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-milvus (>=0.23.0,<0.24.0)
Requires-Dist: opentelemetry-instrumentation-mistralai (>=0.23.0,<0.24.0)
Requires-Dist: opentelemetry-instrumentation-mysql (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-mysqlclient (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-ollama (>=0.23.0,<0.24.0)
Requires-Dist: opentelemetry-instrumentation-openai (>=0.23.0,<0.24.0)
Requires-Dist: opentelemetry-instrumentation-pika (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-pinecone (>=0.23.0,<0.24.0)
Requires-Dist: opentelemetry-instrumentation-psycopg (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-psycopg2 (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-pymemcache (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-pymongo (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-pymysql (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-pyramid (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-qdrant (>=0.23.0,<0.24.0)
Requires-Dist: opentelemetry-instrumentation-redis (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-remoulade (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-replicate (>=0.23.0,<0.24.0)
Requires-Dist: opentelemetry-instrumentation-requests (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-sklearn (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-sqlalchemy (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-sqlite3 (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-system-metrics (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-threading (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-together (>=0.23.0,<0.24.0)
Requires-Dist: opentelemetry-instrumentation-tornado (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-tortoiseorm (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-transformers (>=0.23.0,<0.24.0)
Requires-Dist: opentelemetry-instrumentation-urllib (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-urllib3 (>=0.46b0,<0.47)
Requires-Dist: opentelemetry-instrumentation-vertexai (>=0.23.0,<0.24.0)
Requires-Dist: opentelemetry-instrumentation-watsonx (>=0.23.0,<0.24.0)
Requires-Dist: opentelemetry-instrumentation-weaviate (>=0.23.0,<0.24.0)
Requires-Dist: opentelemetry-semantic-conventions-ai (>=0.3.1,<0.4.0)
Requires-Dist: tiktoken (>=0.7.0,<0.8.0)
Requires-Dist: wrapt (>=1.16.0,<2.0.0)
Description-Content-Type: text/markdown

# Iudex

Next generation observability.


### Table of contents
- [Iudex](#iudex)
    - [Table of contents](#table-of-contents)
- [Getting Started](#getting-started)
    - [FastAPI](#fastapi)
    - [Lambda](#lambda)
    - [Custom Functions](#custom-functions)
- [Slack Alerts](#slack-alerts)


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

1. Pip install dependencies
```bash
pip install iudex
```
2. At the top of your entrypoint (usually `main.py`), import `instrument` from `iudex` and invoke it.
```python
from iudex.instrumentation import instrument
instrument(
  service_name=__name__, # or any string describing your service
  env="production", # or any string for your env
)
```
3. Make sure the app has access to the environment variable `IUDEX_API_KEY`
4. You should be all set! Go to [https://app.iudex.ai/](https://app.iudex.ai/) and enter your API key
5. Go to [https://app.iudex.ai/logs](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.
```python
# 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
```python
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
)
```

2. Add the decorator to the lambda handler
```python
@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.

```python
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](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.
```python
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.

