The Template Library documentation has moved
This topic is not up-to-date. View the latest documentation for the NGINX Ingress Controller Template.
The LogDNA NGINX Ingress Controller Template provides you better observability into your infrastructure with NGINX Ingress Controller (nginxinc/kubernetes-ingress) logs. The Template includes pre-configured views, boards, screens, and a logging format to get the most out of your logs. After configuring the Template, you can set up alerts on excessive HTTP 500's, graph response codes broken down by upstream service name, and more.
Interested in other LogDNA Templates? Browse the full Template Library here.
Start working with the NGINX Ingress Controller Template in 3 steps
- Click the "Configure Template" button above and sign into your LogDNA account.
- A file will be generated with your Template. Drag and drop the file where directed.
- See your new Views, Boards, and Screens in the LogDNA web application!
Afterwards, optionally modify the Template and add alerts to suit your needs.
Surfacing Additional Metadata
To surface additional metadata in this Template such as upstream Kubernetes service name or response time, you'll need to set up our recommended logging format.
The NGINX Ingress Controller Template consists of a collection of pre-configured views, boards, and screens. To learn more about these visibility tools and their specific use cases, click on the respective links above. Detailed below are the different insights provided by the NGINX Ingress Controller Template.
- HTTP 2XX
- HTTP 5XX
- HTTP 404 Errors
- HTTP Forbidden/Unauthorized (401, 403)
- HTTP Server Errors
- Includes 500's and NGINX error logs, if those error logs are using the default error log format.
- HTTP Response Codes and Errors
- Breakdown by App, Host, Request (Path), Client IP, and Upstream Kubernetes Service
- 95th Percentile Response Times for Upstream and Total Time
- Traffic Volume with Total Bytes and Requests
- Web Analytics, such as traffic trends, most popular pages, and referrers
- Server Health, such as number of 500s by grouped by upstream service
- Web Server Security, such as top 401 and 403 errors by IP Address
To take full advantage of the the NGINX Ingress Controller Template with nginxinc/kubernetes-ingress, users should add our recommended custom log format. If you're using the community version (
kubernetes/ingress-nginx) see the following section. The custom log format exposes additional NGINX variables such as upstream service name and response times to further aid in debugging your infrastructure. Without this custom log format, parts of the Template will not be populated with data.
See here for more details on configuring NGINX via a ConfigMap resource. Log formats that deviate from this format or the default Apache Common or Combined log format will lead to incorrect data being populated in this Template.
Recommended log format configuration:
log-format: 'verb="$request_method" request="$uri" response=$status clientip="$remote_addr" scheme="$scheme" bytes=$bytes_sent agent="$http_user_agent" referrer="$http_referer" request_time=$request_time upstream_response=$upstream_status upstream_response_time=$upstream_response_time upstream_service="$service" resource_name="$resource_name" resource_namespace="$resource_namespace" resource_type="$resource_type" http_host="$http_host" request_id="$request_id" time_date="$time_iso8601"' log-format-escaping: 'json'
Example ConfigMap (you'll need to modify this depending on your NGINX Ingress Controller setup):
kind: ConfigMap apiVersion: v1 metadata: name: nginx-config namespace: default data: log-format: 'verb="$request_method" request="$uri" response=$status clientip="$remote_addr" scheme="$scheme" bytes=$bytes_sent agent="$http_user_agent" referrer="$http_referer" request_time=$request_time upstream_response=$upstream_status upstream_response_time=$upstream_response_time upstream_service="$service" resource_name="$resource_name" resource_namespace="$resource_namespace" resource_type="$resource_type" http_host="$http_host" request_id="$request_id" time_date="$time_iso8601"' log-format-escaping: 'json'
If you're not using the
nginxinc/kubernetes-ingress but instead using the ingress version from
kubernetes/ingress-nginx the out-of-the-box Template will still be compatible, but the extra Kubernetes metadata will not be parsed automatically so Template elements that require data like upstream service/response time will not be available.
If you have an ad blocker enabled, you may not see the configuration tutorial provided. As a workaround, you can whitelist LogDNA in your ad blocker. Alternatively, you can install the Template by downloading the configuration file here. Afterwards, drag it into your import config settings and click "Import". You can find additional docs on importing configurations here.