elli_prometheus
所属分类:collect
开发工具:Erlang
文件大小:0KB
下载次数:0
上传日期:2020-02-16 21:47:37
上 传 者:
sh-1993
说明: Elli中间件,用于通过普罗米修斯收集统计信息。,
(Elli middleware for collecting stats via Prometheus.,)
文件列表:
.dir-locals.el (392, 2020-02-16)
.travis.yml (298, 2020-02-16)
LICENSE (1449, 2020-02-16)
doc/ (0, 2020-02-16)
doc/edoc-info (102, 2020-02-16)
doc/elli_prometheus.md (1235, 2020-02-16)
doc/elli_prometheus_config.md (1260, 2020-02-16)
doc/erlang.png (2109, 2020-02-16)
doc/stylesheet.css (869, 2020-02-16)
elvis.config (1342, 2020-02-16)
rebar.config (1057, 2020-02-16)
rebar.config.script (226, 2020-02-16)
rebar.lock (169, 2020-02-16)
src/ (0, 2020-02-16)
src/elli_prometheus.app.src (383, 2020-02-16)
src/elli_prometheus.erl (13726, 2020-02-16)
src/elli_prometheus_config.erl (1708, 2020-02-16)
test/ (0, 2020-02-16)
test/elli_prometheus_test_callback.erl (488, 2020-02-16)
test/elli_prometheus_tests.erl (13731, 2020-02-16)
# elli_prometheus
[![Hex.pm][hex badge]][hex package]
[![Documentation][docs badge]][docs]
[![Erlang][erlang badge]][erlang downloads]
[![Travis CI][build badge]][travis link]
[![Coveralls][coverage badge]][coveralls link]
[![BSD-3 License][license badge]](https://github.com/elli-lib/elli_prometheus/blob/master/LICENSE)
*[Elli][] middleware for collecting stats via [Prometheus][].*
## Metrics
How Elli represents timings:
```
request_start
headers_start
...headers receiving & parsing...
headers_end
body_start
...body receiving & parsing...
body_end
user_start
...callback code...
user_end
send_start
...sending reply....
send_end
request_end
```
How Elli represents sizes:
Each request has `resp_headers` key and, depending on
response type, `resp_body` or `file` or `chunks` key.
- `resp_header` is always present and denotes response headers wire size;
- `resp_body` set for regular responses;
- `file` set for file responses;
- `chunks` set for chunked responses, wire size too.
Elli_prometheus exports the following metrics:
- `http_requests_total`, counter. Total count of requests;
- `http_request_duration_microseconds`, histogram. The difference between
`request_end` and `request_start`;
- `http_request_headers_microseconds`, histogram. The difference between
`headers_end` and `headers_start`;
- `http_request_body_microseconds`, histogram. The difference between
`body_end` and `body_start`;
- `http_request_user_microseconds`, histogram. The difference between
`user_end` and `user_start`;
- `http_request_send_microseconds`, histogram. The difference between
`send_end` and `send_start`;
- `http_response_size_bytes`, summary. Total size of the response, includes
headers, body|file|chuncks;
- `http_response_headers_size_bytes`, summary. Size of the response headers;
- `http_response_body_size`, summary.
Size of the response body;
For failed requests:
- `http_requests_failed_total{reason}`, Total count of failed requests. Reasons:
- `request_closed` - the client closes the connection when Elli is waiting for
the next request;
- `request_timeout` - the client times out when Elli is waiting for the request;
- `request_parse_error` - the request is invalid and cannot be parsed or it
contains a path Elli cannot parse or doesn't support;
- `client_closed` - the client closes the connection or socket closed
unexpectedly;
- `client_timeout` - data can't be received within a timeout;
- `bad_request` - Elli detects a request isn't well formatted or doesn't conform
to the configured limits.
- `http_bad_requests_total{reason}` - Total count of `bad_request` errors.
Reasons:
- `too_many_headers`;
- `body_size`.
- `http_client_closed_total{request_part}` - Total count of `client_closed` errors.
Parts:
- `receiving_headers`;
- `receiving_body`;
- `before_response`.
- `http_client_timeout_total{request_part}` Total count of `client_timeout` errors.
Parts:
- `receiving_headers`;
- `receiving_body`.
Exporter metrics:
* `telemetry_scrape_duration_seconds`
Type: summary.
Labels: `registry`, `content_type`.
Scrape duration.
* `telemetry_scrape_size_bytes`
Type: summary.
Labels: `registry`, `content_type`.
Scrape size, not encoded.
* `telemetry_scrape_encoded_size_bytes`
Type: summary.
Labels: `registry`, `content_type`, `encoding`.
Scrape size, encoded.
## Dependencies
`elli_prometheus` requires [Elli][] and [Prometheus][], but neither are included
in this project. It has been tested and is known to work with `{elli, "2.0.1"}`
and `{prometheus, "3.1.1"}`.
[hex badge]: https://img.shields.io/hexpm/v/elli_prometheus.svg?maxAge=2592000
[hex package]: https://hex.pm/packages/elli_prometheus
[erlang badge]: https://img.shields.io/badge/erlang-%E2%89%A518.0-red.svg
[erlang downloads]: http://www.erlang.org/downloads
[build badge]: https://travis-ci.org/elli-lib/elli_prometheus.svg?branch=develop
[travis link]: https://travis-ci.org/elli-lib/elli_prometheus
[docs badge]: https://img.shields.io/badge/docs-edown-green.svg
[docs]: doc/README.md
[coverage badge]: https://coveralls.io/repos/github/elli-lib/elli_prometheus/badge.svg?branch=develop
[coveralls link]: https://coveralls.io/github/elli-lib/elli_prometheus?branch=develop
[license badge]: https://img.shields.io/badge/license-BSD--3-blue.svg
[Elli]: https://github.com/elli-lib/elli
[Prometheus]: https://github.com/deadtrickster/prometheus.erl
近期下载者:
相关文件:
收藏者: