...
Code Block | ||||
---|---|---|---|---|
| ||||
{ "@storages": [ { "name": "json-file", "clazz": "org.moskito.central.storage.fs.FileSystemStorage", "configName": "moskito-fs" }, { "name": "csv-file", "clazz": "org.moskito.central.storage.fs.CSVFileStorage", "configName": "moskito-csv" }, { "name": "psql-db", "clazz": "org.moskito.central.storage.psql.PSQLStorage", "configName": "moskito-psql-hibernate" }, { "name": "tsdb", "clazz": "org.moskito.central.storage.tsdb.OpenTSDBStorage", "configName": "moskito-tsdb" } ] } |
This variant will add two storages, a FileSystem storage and a CSFFileStorage. They require own configuration files (referred to in configName parameter).
...
"producerName" - you can point as full producer name like "testProducerId", also wildcard values like *API - PersistenceAPI, *Service* - RMICentralServiceImpl.
OpenTSDBStorage
Code Block | ||
---|---|---|
| ||
{
"url": "http://localhost:4242/api/put",
"@entries": [
{
"includedProducers": "SessionCount",
"includedStats": "*",
"includedIntervals": "*"
},
{
"includedProducers": "RequestURIFilter",
"includedStats": "cumulated",
"includedIntervals": "5m,1h"
}
]
}
|
The OpenTSDBStorage is configured in the code block above, url is OpenTSDB HTTP API path for storing data. The producers and their stats are configured separately in entries similar to CSVFileStorage.
Each stat are stored as a set of metrics with following tags: hostName, intervalName, componentName.
Example:
Code Block | ||
---|---|---|
| ||
{
"metaData": {
"producerId": "RequestURIFilter",
"componentName": "app",
"hostName": "MacBook-Pro",
"intervalName": "5m",
"creationTimestamp": 1385327470774,
"arrivalTimestamp": 1385327470868,
"category": "filter",
"subsystem": "default",
"statClassName": "net.anotheria.moskito.core.predefined.FilterStats"
},
"stats": {
"cumulated": {
"Last": "0",
"CR": "0",
"Max": "-9223372036854775808",
"MCR": "0",
"ERR": "0",
"TR": "0",
"TT": "0",
"Avg": "NaN",
"Min": "9223372036854775807"
}
}
}
|
Stat above stored as a set of metrics:
Code Block | ||
---|---|---|
| ||
[ { "metric": "RequestURIFilter.cumulated.Last", "timestamp": 1385327470774, "value": 0, "tags": { "hostName": "MacBook-Pro", "intervalName": "5m", "componentName": "app" } }, { "metric": "RequestURIFilter.cumulated.CR", "timestamp": 1385327470774, "value": 0, "tags": { "hostName": "MacBook-Pro", "intervalName": "5m", "componentName": "app" } }, { "metric": "RequestURIFilter.cumulated.Max", "timestamp": 1385327470774, "value": -9223372036854775808, "tags": { "hostName": "MacBook-Pro", "intervalName": "5m", "componentName": "app" } }, { "metric": "RequestURIFilter.cumulated.MCR", "timestamp": 1385327470774, "value": 0, "tags": { "hostName": "MacBook-Pro", "intervalName": "5m", "componentName": "app" } }, { "metric": "RequestURIFilter.cumulated.ERR", "timestamp": 1385327470774, "value": 0, "tags": { "hostName": "MacBook-Pro", "intervalName": "5m", "componentName": "app" } }, { "metric": "RequestURIFilter.cumulated.TR", "timestamp": 1385327470774, "value": 0, "tags": { "hostName": "MacBook-Pro", "intervalName": "5m", "componentName": "app" } }, { "metric": "RequestURIFilter.cumulated.TT", "timestamp": 1385327470774, "value": 0, "tags": { "hostName": "MacBook-Pro", "intervalName": "5m", "componentName": "app" } }, { "metric": "RequestURIFilter.cumulated.Min", "timestamp": 1385327470774, "value": 9223372036854775807, "tags": { "hostName": "MacBook-Pro", "intervalName": "5m", "componentName": "app" } } ] |
Notes:
- Empty and not numeric values skipped.
- Integration done for OpenTSDB running with --auto-metric flag, so please use it too.
- /api/put refers to OpenTSDB 2.x versions.