Clutta-py is the official Python SDK for interacting with Clutta, a platform for observability and monitoring.
Project description
Clutta-Python SDK
Clutta-Python is the official Python SDK for interacting with Clutta, a platform for observability and monitoring. Use this SDK to send pulse data, either individually or in batches, with ease and reliability.
Installation
To add Clutta-Go to your Go project, use the following command:
pip install clutta-py
Features
- Effortless Integration: Simple setup with reusable client initialization.
- Single Pulse Support: Send individual data points with precision.
- Batch Processing: Transmit multiple data points efficiently in one operation.
Getting Started
1. Initialize the Client
This involves setting up the client once and reusing it across your application. Copy the code below into a new python file or into your preferred location.
import os
from dotenv import load_dotenv
from clutta.core import Clutta
from clutta.pulse import Pulse
load_dotenv() # To load your API key and other sensitive information from your environment or .env file.
api_key=os.getenv("API_KEY")
# Set up your new Clutta client called "test" with your API key
test=Clutta(api_key)
test.new_client()
2. Sending a Pulse
You can then send an individual pulse for targeted updates. Copy and paste the following code inside the same file as above. Remember to replace the placeholder values of the signatureId, chainId etc. with actual values from your Clutta account.
# Create a pulse
pulse1=Pulse(
signatureId="unique-signature-id",
chainId="unique-chain-id",
correlationId="unique-correlation-id",
sourceId="your-source",
userId="your user-id",
status=1, # Status: 0 for unknown, 1 for success, 2 for failure
statusDescription="Success"
)
# Send the pulse
test.send_pulse(pulse1)
3. Sending Multiple Pulses
You can also Ooptimize performance by sending pulses in bulk. Copy and paste the following code as well. Remember to replace placeholder values as needed.
# Create 2 pulses
pulse2=Pulse(
signatureId="unique-signature-id",
chainId="unique-chain-id",
correlationId="unique-correlation-id",
sourceId="your-source",
userId="your user-id",
status=1, # Status: 0 for unknown, 1 for success, 2 for failure
statusDescription="Success"
)
pulse3=Pulse(
signatureId="unique-signature-id",
chainId="unique-chain-id",
correlationId="unique-correlation-id",
sourceId="your-source",
userId="your user-id",
status=1, # Status: 0 for unknown, 1 for success, 2 for failure
statusDescription="Success"
)
# Send the pulses in bulk as a list
test.send_pulses([pulse2,pulse3])
License
Clutta-Python is open-source and licensed under the MIT License. Contributions are welcome.
Support
For technical support, documentation, or to report issues, visit the Clutta Documentation or contact our support team.
About Clutta
Clutta is redefining observability with cutting-edge tools designed to help organizations monitor, analyze, and optimize their systems. Whether you're scaling to millions of users or managing critical infrastructure, Clutta provides the insights you need to excel.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file clutta_py-0.0.1.tar.gz.
File metadata
- Download URL: clutta_py-0.0.1.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b152f47264f5bbd1c71091f68b61a53de6a78c98664f44d7b392c32f13db394
|
|
| MD5 |
767113ea9801dfa66021e47476643e7e
|
|
| BLAKE2b-256 |
25d8a5d8b65551b3e2a642cd67bedcba3ca2edf33fd5ca96bc6b99d2fd8cc141
|
File details
Details for the file clutta_py-0.0.1-py3-none-any.whl.
File metadata
- Download URL: clutta_py-0.0.1-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0215a0174552c2c0dba9a8b0183bcef42d5c0c949bbe1c6879a92eaeebe17d2
|
|
| MD5 |
89a28e1be14aa9dcb1b05dccd549847e
|
|
| BLAKE2b-256 |
b7703eff58f9f3460bea23702089eaf389fac88d9f21f2e50e670dee801e7e94
|