Docs » Integrations Guide » Integrations Reference » Kong

image0 Kong

Metadata associated with the Kong plugin for collectd can be found here.

The relevant code for the integration can be found here and for its Kong plugin dependency here.

DESCRIPTION

The SignalFx Kong collectd plugin provides users with the ability to gather and report their service traffic
metrics with collectd, in tandem with kong-plugin-signalfx.

This plugin emits metrics for configurable request/response lifecycle groups including:

  • Counters for response counts
  • Counters for cumulative response and request sizes
  • Counters for cumulative request, upstream, and Kong latencies

These request/response lifecycle groups can be optionally partitioned by tunable levels of granularity by:

  • API or Service Name/ID
  • Route ID
  • Request HTTP Method
  • Response HTTP Status Code

In addition to these groups, system-wide connection stats can be provided, including:

  • A counter for total fielded requests
  • Gauges for active connections and their various states
  • A gauge for database connectivity

FEATURES

Built-in dashboards

  • Kong Servers Overview: High-level Kong performance for all reporting servers

image1

  • Kong Server Overview: High-level Kong performance for an individual server

image2

  • API Objects: API object activity metrics

image3

  • Service Objects: Service object activity metrics

image4

  • Route Objects: Route object activity metrics

image5

REQUIREMENTS AND DEPENDENCIES

This plugin requires:

Software Version
collectd 4.9+
Python plugin for collectd (included with SignalFx collectd agent)
Python 2.6+
Kong 0.11.2+
Configured kong-plugin-signalfx 0.0.1+

INSTALLATION

Both the SignalFx Smart Agent and collectd agent report metrics made available by the kong-plugin-signalfx metric endpoint. Please download and install this Lua module on all Kong servers using its instructions.

  • If you are using the SignalFx Smart Agent, collectd-kong is already included. Please see the monitor documentation for configuration instructions.
  • If you are using the SignalFx collectd agent follow the steps below.
  1. Download and install the collectd-kong Python module.
  2. Download SignalFxs sample configuration file to /etc/collectd/managed_config.
  3. Modify the configuration file as described in Configuration below.
  4. Restart collectd.

CONFIGURATION

Using the example configuration file 10-kong.conf as a guide, provide values for the configuration options listed below that make sense for your environment.

Configuration option Definition Example value
URL The URL for the /signalfx kong-plugin-signalfx metric endpoint "https://my_kong_server:8443/signalfx"
AuthHeader The name and value of a header to be passed with GETs to the URL "Authorization" "Basic YWRtaW46cGFzc3dvcmQ="
VerifyCerts Whether to verify the ssl certificates for HTTPS requests to the URL true
CABundle Path to a CA_BUNDLE file or directory with certificates of trusted CAs when VerifyCerts is true "/path/ca_bundle/
ClientCert Client side certificate to use for HTTPS requests to the URL "/path/client.cert"
ClientCertKey Separate client side certificate key if not included with cert file "/path/client.key"
Metric The short name and report boolean for (un)desired metrics to emit. See Metrics. "request_latency" false
ExtraDimension The name and value of any custom dimension to be sent with each datapoint "my_dimension" "my_dimension_value"
ReportAPIIDs The UUID assigned to each API object upon creation false
ReportAPINames The optional, user-created name assigned to API objects (recommended) true
ReportServiceIDs The UUID assigned to each Service object upon creation false
ReportServiceNames The optional, user-created name assigned to Service objects (recommended) true
ReportRouteIDs The UUID assigned to each Route object upon creation (recommended) true
ReportHTTPMethods The HTTP method of each request made to the Kong proxy true
ReportStatusCodeGroups The HTTP status code group (e.g. 4xx) for each proxy server fielded request (recommended) true
ReportStatusCodes The HTTP status code for each fielded request false
APIIDs The pattern(s) of API IDs to add as dimensions for applicable datapoints "my-api-id"
APIIDsBlacklist The pattern(s) of API IDs to not report as dimensions for applicable datapoints "my-unwanted-id" "my-other-unwanted-id"
APINames The pattern(s) of API Names to add as dimensions for applicable datapoints "MyAPI"
APINamesBlacklist The pattern(s) of API Names to not report as dimensions for applicable datapoints "MyUnwantedAPI" "MyOtherUnwantedAPI"
ServiceIDs The pattern(s) of Service IDs to add as dimensions for applicable datapoints "my-service-id"
ServiceIDsBlacklist The pattern(s) of Service IDs to not report as dimensions for applicable datapoints "my-unwanted-id" "my-other-unwanted-id"
ServiceNames The pattern(s) of Service Names to add as dimensions for applicable datapoints "MyService"
ServiceNamesBlacklist The pattern(s) of Service Names to not report as dimensions for applicable datapoints "MyUnwantedService" "MyOtherUnwantedService"
RouteIDs The pattern(s) of Route IDs to add as dimensions for applicable datapoints "my-route-id"
RouteIDsBlacklist The pattern(s) of Route IDs to not report as dimensions for applicable datapoints "my-unwanted-id" "my-other-unwanted-id"
HTTPMethods The pattern(s) of HTTP methods to add as dimensions for applicable datapoints "GET" "POST" "DELETE"
HTTPMethodsBlacklist The pattern(s) of HTTP methods to not report as dimensions for applicable datapoints "HEAD" "OPTIONS"

USAGE

Sample of built-in dashboard in SignalFx:

image6

METRICS

Below is a list of all metrics.

Metric Name Brief Type
counter.kong.connections.accepted Total number of all accepted connections. counter
counter.kong.connections.handled Total number of all handled connections (accounting for resource limits). counter
counter.kong.kong.latency Time spent in Kong request handling and balancer (ms). counter
counter.kong.requests.count Total number of all requests made to Kong API and proxy server. counter
counter.kong.requests.latency Total time for request handling (ms) counter
counter.kong.requests.size Total bytes received/proxied from client requests. counter
counter.kong.responses.count Total number of responses provided to clients. counter
counter.kong.responses.size Total bytes sent/proxied to clients. counter
counter.kong.upstream.latency Time spent waiting for upstream response (ms). counter
gauge.kong.connections.active The current number of active client connections (includes waiting). gauge
gauge.kong.connections.reading The current number of connections where Kong is reading the request header. gauge
gauge.kong.connections.waiting The current number of idle client connections waiting for a request. gauge
gauge.kong.connections.writing The current number of connections where Kong is writing the response back to the client. gauge
gauge.kong.database.reachable Kong.dao:db.reachable() at time of metric query gauge

counter.kong.connections.accepted

counter

Total number of all accepted connections, including those not fielded by upstream entities.

counter.kong.connections.handled

counter

Total number of all handled connections (accounting for resource limits), including those of unproxied requests to
upstream entities.

counter.kong.kong.latency

counter

Time spent in Kong request handler and balancer (ms).

counter.kong.requests.count

counter

Total number of all requests made to Kong API and proxy server.

counter.kong.requests.latency

counter

Time elapsed between the first bytes being read from each client request and the log writes after the last bytes were sent to the clients (ms).

counter.kong.requests.size

counter

Total bytes received/proxied from client requests.

counter.kong.responses.count

counter

Total number of responses provided to clients by proxy server.

counter.kong.responses.size

counter

Total bytes sent/proxied to clients.

counter.kong.upstream.latency

counter

Proxy server’s total time spent waiting for upstream response (ms).

gauge.kong.connections.active

gauge

The current number of active client connections (includes waiting).

gauge.kong.connections.reading

gauge

The current number of connections where Kong is reading the request header.

gauge.kong.connections.waiting

gauge

The current number of idle client connections waiting for a request.

gauge.kong.connections.writing

gauge

The current number of connections where Kong is writing the response back to the client.

gauge.kong.database.reachable

gauge

kong.dao:db.reachable() at time of metric endpoint query. Connection issues can cause API changes not to propagate to
clusters and uncached route lookups to fail.