{"action":"created","issue":{"url":"https://api.github.com/repos/google/mtail/issues/15","labels_url":"https://api.github.com/repos/google/mtail/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/google/mtail/issues/15/comments","events_url":"https://api.github.com/repos/google/mtail/issues/15/events","html_url":"https://github.com/google/mtail/issues/15","id":124674203,"number":15,"title":"Timer metric not supported by Prometheus","user":{"login":"dylanmei","id":109874,"avatar_url":"https://avatars.githubusercontent.com/u/109874?v=3","gravatar_id":"","url":"https://api.github.com/users/dylanmei","html_url":"https://github.com/dylanmei","followers_url":"https://api.github.com/users/dylanmei/followers","following_url":"https://api.github.com/users/dylanmei/following{/other_user}","gists_url":"https://api.github.com/users/dylanmei/gists{/gist_id}","starred_url":"https://api.github.com/users/dylanmei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylanmei/subscriptions","organizations_url":"https://api.github.com/users/dylanmei/orgs","repos_url":"https://api.github.com/users/dylanmei/repos","events_url":"https://api.github.com/users/dylanmei/events{/privacy}","received_events_url":"https://api.github.com/users/dylanmei/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-03T22:21:06Z","updated_at":"2016-01-04T07:09:23Z","closed_at":null,"body":"When I add a `timer` metric for [a HAProxy log tailer](https://github.com/dylanmei/haproxy_mtail/blob/master/haproxy.mtail), Prometheus can't scrape the /metrics endpoint.\r\n\r\n    text format parsing error in line 13: unknown metric type \"timer\"\r\n\r\nThe `timer` metric works well with the StatsD exporter, but to expose this kind of information to the pull-based Prometheus they use [summaries](http://prometheus.io/docs/practices/histograms/) for metrics representing request durations or response sizes. \r\n\r\nThings that could be done\r\n1. Don't publish `timer` metrics via Prometheus export\r\n2. Add an explicit `summary` metric type \r\n3. Back a `timer` with a `summary` metric, but only expose it fully during Prometheus export\r\n\r\nItems 2. and 3. may or may not include bringing in the [Prometheus packages](https://godoc.org/github.com/prometheus/client_golang/prometheus#Summary).\r\n"},"comment":{"url":"https://api.github.com/repos/google/mtail/issues/comments/168600045","html_url":"https://github.com/google/mtail/issues/15#issuecomment-168600045","issue_url":"https://api.github.com/repos/google/mtail/issues/15","id":168600045,"user":{"login":"dylanmei","id":109874,"avatar_url":"https://avatars.githubusercontent.com/u/109874?v=3","gravatar_id":"","url":"https://api.github.com/users/dylanmei","html_url":"https://github.com/dylanmei","followers_url":"https://api.github.com/users/dylanmei/followers","following_url":"https://api.github.com/users/dylanmei/following{/other_user}","gists_url":"https://api.github.com/users/dylanmei/gists{/gist_id}","starred_url":"https://api.github.com/users/dylanmei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylanmei/subscriptions","organizations_url":"https://api.github.com/users/dylanmei/orgs","repos_url":"https://api.github.com/users/dylanmei/repos","events_url":"https://api.github.com/users/dylanmei/events{/privacy}","received_events_url":"https://api.github.com/users/dylanmei/received_events","type":"User","site_admin":false},"created_at":"2016-01-04T07:09:22Z","updated_at":"2016-01-04T07:09:22Z","body":"I see, so `timer` is simply a gauge but for StatsD it's formatted differently.\r\n\r\n[This kind of change](https://github.com/dylanmei/mtail/commit/1bc2ec1ad7955089434e4071831ca32862ef383d) fixes it for Prometheus by examining the metric `kind` before printing. If you're fine with that I can repeat the solution for other exporters. But ultimately this seems like a design problem."}}