The MongoDB exporter plugin serializes metric timestamps as plain text Strings instead of native MongoDB BSON Date / ISODate types. Because of this, it is impossible to use MongoDB's native TTL (Time-To-Live) indexes (expireAfterSeconds) for automatic data retention. This forces users to build custom purging scripts to prevent disk exhaustion when running telemetry at 1Hz.
Environment information
OS: Ubuntu 22.04 (Cgroups V2)
Alumet version: v0.9.5
Enabled plugins: mongodb, cgroups, rapl, k8s
To Reproduce
Steps to reproduce the behavior:
Configure alumet.toml with [plugins.mongodb] and [plugins.cgroups] enabled at 1Hz.
Start alumet-agent to ingest data into a local MongoDB instance.
Attempt to create a TTL index in MongoDB for the timestamp field.
See error/failure: the index never triggers because the database reads the timestamp as a regular string, not a temporal value.
Expected behavior
Timestamps should be exported and stored as native BSON Date / ISODate types so standard database lifecycle policies can drop old telemetry data automatically without external intervention.
Logs / Output
Example of current output stored in MongoDB:
{ "timestamp": "2026-08-07T10:00:00.000000000Z", "metric": "energy", "value": ... }
Expected output:
{ "timestamp": ISODate("2026-08-07T10:00:00.000Z"), "metric": "energy", "value": ... }
The MongoDB exporter plugin serializes metric timestamps as plain text Strings instead of native MongoDB BSON Date / ISODate types. Because of this, it is impossible to use MongoDB's native TTL (Time-To-Live) indexes (expireAfterSeconds) for automatic data retention. This forces users to build custom purging scripts to prevent disk exhaustion when running telemetry at 1Hz.
Environment information
OS: Ubuntu 22.04 (Cgroups V2)
Alumet version: v0.9.5
Enabled plugins: mongodb, cgroups, rapl, k8s
To Reproduce
Steps to reproduce the behavior:
Configure alumet.toml with [plugins.mongodb] and [plugins.cgroups] enabled at 1Hz.
Start alumet-agent to ingest data into a local MongoDB instance.
Attempt to create a TTL index in MongoDB for the timestamp field.
See error/failure: the index never triggers because the database reads the timestamp as a regular string, not a temporal value.
Expected behavior
Timestamps should be exported and stored as native BSON Date / ISODate types so standard database lifecycle policies can drop old telemetry data automatically without external intervention.
Logs / Output
Example of current output stored in MongoDB:
{ "timestamp": "2026-08-07T10:00:00.000000000Z", "metric": "energy", "value": ... }
Expected output:
{ "timestamp": ISODate("2026-08-07T10:00:00.000Z"), "metric": "energy", "value": ... }