Collecting custom application metrics from docker containers
Is there a way to collect custom metrics (e.g. a /metrics endpoint serving metrics in Prometheus format) from docker containers? I'm currently running https://github.com/SumoLogic/sumologic-collector-docker but I can't seem to find a way to instruct it to collect metrics
https://help.sumologic.com/03Send-Data/Sources/01Sources-for-Installed-Collectors
Do I have to resort to using hosted collectors https://help.sumologic.com/03Send-Data/Sources/02Sources-for-Hosted-Collectors/HTTP-Source/Upload-Metrics-to-an-HTTP-Source
-
Not currently through the installed Collector. Collecting Prometheus metrics will require a Hosted Collector and HTTP(S) Source and the following script.
https://github.com/SumoLogic/sumologic-prometheus-scraper
-
Hi Jacob,
I note that a more recent check-in to the Docker collector does add support for Prometheus format See https://github.com/SumoLogic/sumologic-collector-docker/releases/tag/v19.227-19
The installed collection method relies on a stream over TCP or UDP, with setup instructions detailed here:
If you're using JSON configuration and streaming over TCP port 2003 for example, the source might look something like this
{
"api.version":"v1",
"source":{
"name":"MySteamMetrics",
"category":"metrics/prometheus/test",
"automaticDateParsing":true,
"multilineProcessingEnabled":false,
"useAutolineMatching":false,
"contentType":"Prometheus",
"forceTimeZone":false,
"filters":[],
"cutoffTimestamp":0,
"encoding":"UTF-8",
"protocol":"TCP",
"port":2003,
"sourceType":"StreamingMetrics"
}
}
Please sign in to leave a comment.
Comments
2 comments