Skip to content

Commit

Permalink
Prepare for 0.1.0 release 🎉
Browse files Browse the repository at this point in the history
  • Loading branch information
yciabaud committed May 17, 2018
1 parent a1fc96b commit c6e1f7f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# kong-prometheus-plugin
**WIP - not ready yet**

Widely inspired by [nginx-lua-prometheus](https://github.com/knyar/nginx-lua-prometheus/) NGINX module and the [Kong StatsD plugin](https://github.com/Mashape/kong/tree/master/kong/plugins/statsd).

Expand Down Expand Up @@ -51,23 +50,23 @@ The plugin exposes is metrics on kong's admin endpoint (port 8001 by default) on

Metrics the plugin can expose in the prometheus format:

Metric | description | namespace
--- | --- | ---
Metric | description | namespace
--- | --- | ---
`http_requests_total` | tracks api request | kong_http_requests_total
`http_request_size_bytes` | tracks api request's body size in bytes | kong_http_request_size_bytes
`http_response_size_bytes` | tracks api response's body size in bytes | kong_http_response_size_bytes
`http_request_duration_ms` | tracks the time interval between the request started and response received from the upstream server | kong_http_latency
`http_upstream_latency` | tracks the time it took for the final service to process the request | kong_http_upstream_latency
`http_kong_latency` | tracks the internal Kong latency that it took to run all the plugins | kong_http_kong_latency
`http_request_size_bytes` | tracks api request's body size in bytes | kong_http_request_size_bytes
`http_response_size_bytes` | tracks api response's body size in bytes | kong_http_response_size_bytes
`http_request_duration_ms` | tracks the time interval between the request started and response received from the upstream server | kong_http_latency
`http_upstream_duration_ms` | tracks the time it took for the final service to process the request | kong_http_upstream_latency
`http_kong_duration_ms` | tracks the internal Kong latency that it took to run all the plugins | kong_http_kong_latency

### Metric Fields

Plugin can be configured with any combination of [Metrics](#metrics), with each entry containing the following fields.

Field | description | allowed values
--- | --- | ---
`name` | Prometheus metric's name | [Metrics](#metrics)
`stat_type` | determines what sort of event the metric represents | `gauge`, `counter` and `histogram`
Field | description | allowed values
--- | --- | ---
`name` | Prometheus metric's name | [Metrics](#metrics)
`stat_type` | determines what sort of event the metric represents | `gauge`, `counter` and `histogram`

## Kong Process Errors

Expand Down Expand Up @@ -96,7 +95,8 @@ might want to keep the number of metrics (and distinct metric label values) to
a minimum.

## Credits
- Adapted and maintained by Yoann Ciabaud (@yciabaud)
- Adapted and maintained by Yoann Ciabaud [@yciabaud](#yciabaud)
- :heart: kindly improved and tested by [@jayhding](#jayhding)

### Kong StatsD plugin
- Source [Plugin](https://getkong.org/plugins/statsd/) created and maintained by the [Kong](https://getkong.org/) folks at [Mashape](https://www.mashape.com)
Expand Down
13 changes: 9 additions & 4 deletions schema.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
local metrics = {
["http_requests_total"] = true,
["http_requests_total"] = true,
["http_request_duration_ms"] = true,
["http_request_size_bytes"] = true,
["http_response_size_bytes"] = true,
["http_request_size_bytes"] = true,
["http_response_size_bytes"] = true,
["http_upstream_duration_ms"] = true,
["http_kong_duration_ms"] = true,
["http_connections"] = true,
["http_connections"] = true,
}


Expand Down Expand Up @@ -53,6 +53,11 @@ local default_metrics = {
stat_type = "histogram",
labels = {"api"},
},
{
name = "http_upstream_duration_ms",
stat_type = "gauge",
labels = {"api"},
},
{
name = "http_kong_duration_ms",
stat_type = "histogram",
Expand Down

0 comments on commit c6e1f7f

Please sign in to comment.