Registry / database / mongo-tooling-metrics

mongo-tooling-metrics

JSON →
library1.0.8pypypiunverified

A slim library which leverages Pydantic to reliably collect type-enforced metrics and store them to MongoDB. Version 1.0.8 supports Python >=3.7,<4.0. Low release cadence.

pip install mongo-tooling-metrics
INSTALL
IMPORT
SIG · MONGO-TOOLING-METR
M
mongo-tooling-metrics
databasepythonv1.0.8
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MetricCollector
from mongo_tooling_metrics import MetricCollector
from mongo_tooling_metrics import MetricCollector

Initialize MetricsConfig with MongoDB URI and collection details, then create a MetricCollector and send a gauge metric.

from mongo_tooling_metrics import MetricCollector, MetricsConfig import os config = MetricsConfig( mongo_uri=os.environ.get('MONGO_URI', 'mongodb://localhost:27017'), database_name='metrics', collection_name='my_metrics' ) collector = MetricCollector(config) collector.send_gauge('my_gauge', 42) print('Metric sent successfully.')
Debug
Known issues
gotchaMetricCollector.send_gauge() and send_counter() accept only int or float values; passing a string will raise a ValidationError silently if using Pydantic v1?
fix
Ensure metric values are numeric (int or float).
affects: >=1.0.0
gotchaIf MongoDB connection fails, metrics are silently dropped; no exception is raised by default.
fix
Enable logging or check the return value of send methods if available.
affects: >=1.0.0
Upgrade
Version history
1.0.8latest on PyPI · released Jun 1, 2023
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
8
OpenAI (training)
3
Resources
mongo-tooling-metrics — pip install mongo-tooling-metrics · libregistry