Open KrisShannon opened 6 years ago
Correct, the log will show the PutMetric
endpoint being hit but it doesn't necessarily mean the value was persisted.
Try something like this, where you break up the name
into namespace
and subsystem
.
"metrics": [
{
"namespace": "wp",
"subsystem": "memory",
"name": "percent",
"help": "percentage of memory used",
"type": "gauge"
},
]
}
That should allow you to post a metric using the following command.
$ /bin/containerpilot -putmetric 'wp_memory_percent=42'
This is how our integration test checks a counter
. Though now I'm noticing that we're lacking tests for other prometheus metric types such as gauge
.
Separating the name into namespace, subsystem, and name worked.
If this is now required, then the docs need updating.
From Telemetry >> Collector configuration:
You can leave off the namespace and subsystem values and put everything into the name field if desired.
That's good to know. When someone has free time it would be nice to enforce that namespace
and subsystem
can be optional (and also add integration tests).
I'll leave this issue open for that.
Version: 3.8.0 GitHash: 408dbc9
The config is containerpilot.json:
An extract from the log is containerpilot.log:
These lines repeat every 5 seconds with only the
sensor
pid and the metric event values changing.From the log it does appear that the metric values are being received by containerpilot, but when I view the http://localhost:9090/metrics endpoint it always shows 0 for the custom metrics
wp_cpu_load
andwp_memory_percent
: