Instana U

 View Only

Monitoring Kong Gateway in Instana with Prometheus

By K M Abhijith posted Wed December 28, 2022 09:43 AM

  
                           
​​​Co-authors: @Swathi Kannan, @Vaishak A

Instana is a product that helps you conduct both monitoring and observability.It collects data and automatically analyses it by using an intelligent Instana backend. This helps in troubleshooting and optimization.

Kong is an Orchestration Microservice API Gateway that provides a flexible abstraction layer and securely manages communication between clients and micro services.

Prometheus is an open-source monitoring and alerting tool. The metrics information that is collected by Prometheus is stored with the timestamp at which it was recorded.


You can monitor Kong gateway by using Prometheus and Instana. Ready to try? Follow the guide.

Prerequisites

  • Ensure that the Instana agent is installed and is reporting to your Instana backend.

  • Ensure that Kong is installed on the same VM/environment where the Instana agent is installed.

Installing and configuring Instana agent

Instana agents are available for both standalone VMs and cluster environments such as a Kubernetes cluster or an OpenShift cluster.

The following configurations are used to deploy and configure Instana agents in a Standalone VM:

  • Download the agent package. Follow these steps to install the package.
  • After you download the required deb/rpm package, run the following command to install the agent:
Debian derivatives: sudo apt install ./<Package_name>
Redhat derivatives: rpm -i <Package_name>

For more information about agent configurations, see the topic here.

Kong Installation

Kong can be installed in a variety of operating systems and in a cluster environment. For more information about installation and configuration, see the topic here.

Configuring Prometheus plugin in Kong API

Kong supports the Prometheus plugin, which can be used to visualise the metrics on Instana UI.
Configuring the Prometheus plugin in Kong Gateway will expose an endpoint /metrics in Kong.

curl -X POST http://localhost:8001/plugins/ \
--data "name=prometheus" \
--data "config.per_consumer=true" \
--data "config.status_code_metrics=true"\
--data "config.latency_metrics=true" \
--data "config.bandwidth_metrics=true" \
--data "config.upstream_health_metrics=true"

For more information about the configuration of the plugin, see this link.

Configuring Prometheus plugin in Instana agent

To monitor Prometheus by using Instana, you don’t need to install a Prometheus server. The Prometheus sensor directly captures the metrics from the endpoints exposed by the system.

Steps:

  1. To configure the Prometheus plugin on your Instana agent, update your YAML file in the directory <agent_install_dir>/etc/instana/configuration.yaml with the following details.


  2. On the Instana backend, you can see that the Prometheus dashboard is linked on the Host dashboard page and metrics that are related to Prometheus are listed as follows:


  3.  Follow the steps to create a dashboard to monitor specific metric data, which you are fetching by using the script.
    1. Switch to the main page on Instana UI.
    2. Click Create Dashboard.

    3. Select the Prometheus metrics that are specific to your host by applying a filtering mechanism. The dashboard will be displayed.           


    More information

    If you want to find more about Instana and its monitoring capabilities, refer to this document.



     


    ​​​​​​​

    Permalink

    Comments

    Wed March 22, 2023 08:24 AM

    Nice step-by-step summary, thank you for sharing.