Skip to content

Instantly share code, notes, and snippets.

@yunyu
Created May 7, 2017 23:15
Show Gist options
  • Save yunyu/861461da5b9f8a8b564d4f6db03dea8e to your computer and use it in GitHub Desktop.
Save yunyu/861461da5b9f8a8b564d4f6db03dea8e to your computer and use it in GitHub Desktop.
# HELP http_requests_total The total number of HTTP requests.
# TYPE http_requests_total counter
http_requests_total{method="post",code="200"} 1027 1395066363000
http_requests_total{method="post",code="400"} 3 1395066363000
# Escaping in label values:
msdos_file_access_time_seconds{path="C:\\DIR\\FILE.TXT",error="Cannot find file:\n\"FILE.TXT\""} 1.458255915e9
# Minimalistic line:
metric_without_timestamp_and_labels 12.47
# A weird metric from before the epoch:
something_weird{problem="division by zero"} +Inf -3982045
# A histogram, which has a pretty complex representation in the text format:
# HELP http_request_duration_seconds A histogram of the request duration.
# TYPE http_request_duration_seconds histogram
http_request_duration_seconds_bucket{le="0.05"} 24054
http_request_duration_seconds_bucket{le="0.1"} 33444
http_request_duration_seconds_bucket{le="0.2"} 100392
http_request_duration_seconds_bucket{le="0.5"} 129389
http_request_duration_seconds_bucket{le="1"} 133988
http_request_duration_seconds_bucket{le="+Inf"} 144320
http_request_duration_seconds_sum 53423
http_request_duration_seconds_count 144320
# Finally a summary, which has a complex representation, too:
# HELP rpc_duration_seconds A summary of the RPC duration in seconds.
# TYPE rpc_duration_seconds summary
rpc_duration_seconds{quantile="0.01"} 3102
rpc_duration_seconds{quantile="0.05"} 3272
rpc_duration_seconds{quantile="0.5"} 4773
rpc_duration_seconds{quantile="0.9"} 9001
rpc_duration_seconds{quantile="0.99"} 76656
rpc_duration_seconds_sum 1.7560473e+07
rpc_duration_seconds_count 2693
[
{
"name":"something_weird",
"help":"",
"type":"UNTYPED",
"metrics":[
{
"labels":{
"problem":"division by zero"
},
"value":"+Inf"
}
]
},
{
"name":"http_request_duration_seconds",
"help":"A histogram of the request duration.",
"type":"HISTOGRAM",
"metrics":[
{
"buckets":{
"+Inf":"144320",
"0.05":"24054",
"0.1":"33444",
"0.2":"100392",
"0.5":"129389",
"1":"133988"
},
"count":"144320",
"sum":"0"
}
]
},
{
"name":"rpc_duration_seconds",
"help":"A summary of the RPC duration in seconds.",
"type":"SUMMARY",
"metrics":[
{
"quantiles":{
"0.01":"3102",
"0.05":"3272",
"0.5":"4773",
"0.9":"9001",
"0.99":"76656"
},
"count":"2693",
"sum":"1.7560473e+07"
}
]
},
{
"name":"http_requests_total",
"help":"The total number of HTTP requests.",
"type":"COUNTER",
"metrics":[
{
"labels":{
"code":"200",
"method":"post"
},
"value":"1027"
},
{
"labels":{
"code":"400",
"method":"post"
},
"value":"3"
}
]
},
{
"name":"msdos_file_access_time_seconds",
"help":"",
"type":"UNTYPED",
"metrics":[
{
"labels":{
"error":"Cannot find file:\n\"FILE.TXT\"",
"path":"C:\\DIR\\FILE.TXT"
},
"value":"1.458255915e+09"
}
]
},
{
"name":"metric_without_timestamp_and_labels",
"help":"",
"type":"UNTYPED",
"metrics":[
{
"value":"12.47"
}
]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment