Monium
This library is designed for working with Monium from Yandex Cloud. It provides a simplified way to write logs and metrics. Internally, it uses the OpenTelemetry protocol. This is not the official Monium library from Yandex Cloud.
Performance
- The library uses asynchronous calls to obtain IAM tokens and API keys. Renewal and deletion are also performed asynchronously.
- API keys are cached. If any existing key contains the required set of roles, that key is returned. In other words, the role set of an existing key must include the role set of the requested key.
- Token validation runs as a background process, so it does not block the main execution flow.
Security
Several security measures are implemented:
- IAM token rotation. Tokens have a short lifespan — 1 hour by default — after which they become invalid and are automatically renewed.
- API key rotation. Each API key is created with the minimum required permissions requested by the user. When the key expires, it is deleted from the cloud and a new one is created.
- Automatic metadata detection. If the program is running on a Yandex Cloud VM, the library automatically obtains the IAM token from the VM metadata.
Usage
First, you need to provide the data for connection.:
from monium_sdk.security import ApiKey, IAMToken
key = ApiKey(
secret="secret"
)
# or
key = IAMToken(
secret="secret"
)
After that, you can use all the library's functionality:
import asyncio
from monium_sdk import Telemetry
from monium_sdk.security import ApiKey
def test():
key = ApiKey(
secret="secret"
)
with Telemetry.logging_start(
key=key,
project="folder__<folder_id>",
service="<service>",
cluster="<cluster>"
) as res:
Telemetry.log.info("first message")
Telemetry.log.error("error")
Telemetry.metric.add_to_counter(count=5)
if __name__ == "__main__":
test()
Metadata
Release files for monium-sdk 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| monium_sdk-1.2.0.tar.gz | 11.5 kB | Without provenance | Details for monium_sdk-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| monium_sdk-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for monium_sdk-1.2.0-py3-none-any.whl |
Total release size: 23.6 kB
Release files / monium_sdk-1.2.0.tar.gz
| Download URL | monium_sdk-1.2.0.tar.gz |
|---|---|
| Size | 11.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aca1a325da2f84b81ea8fc82d288237f56bdda9db93e10a5002b734cbf0e998d
|
|
BLAKE2b-256 checksum How to use checksums |
bdf61f887d8491d032e8c542b36f0c58dcdd0b5277d09f7fd88b7670ad3b11dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / monium_sdk-1.2.0-py3-none-any.whl
| Download URL | monium_sdk-1.2.0-py3-none-any.whl |
|---|---|
| Size | 12.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2556a2b0c5430f6b707bf5dd9b41bc8a9f457ea1e16d999228f8ebecf0c39f8e
|
|
BLAKE2b-256 checksum How to use checksums |
f1d17cb4cd11e130198d05fa2f1802e1af171e384e2eb62424be2a8ad420d08d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for monium-sdk 1.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.