< img height="1" width="1" style="display:none;" alt="" src="https://px.ads.linkedin.com/collect/?pid=3131724&fmt=gif" />

Edit a Metrics Exporter

This section introduces how to edit a metrics exporter.

A metrics exporter is used to monitor applications. The monitoring and alerting functions of KubeSphere are implemented through Prometheus at the bottom layer. To monitor the running status of applications, you need to perform the following operations:

  1. Configure applications running in containers to expose monitoring metrics that conform to the Prometheus specification at a certain service endpoint. For more information, see the Prometheus Documentation.

  2. In the KubeSphere web console, set up a monitoring exporter on the service exposing the workload to declare the path providing application monitoring metrics. KubeSphere will get the application’s monitoring metrics based on the relevant parameters of the monitoring exporter.

  3. In the KubeSphere web console, create rule groups or custom monitoring dashboards using monitoring metrics to monitor the running status of applications.

Prerequisites

  • You should join a cluster or a project and have the Application Workload Management permission within the cluster or the project. For more information, refer to "Cluster Roles" and "Project Roles".

  • You should configure the application to expose monitoring metrics that conform to the Prometheus specification at a certain service endpoint. For more information, see the Prometheus Documentation.

  • If the monitoring metric collection process requires authentication, you also need to configure the relevant authentication logic in the target application and create a Secret containing the authentication information in the KubeSphere platform in advance.

Steps

  1. Log in to the KubeSphere web console with a user who has the Application Workload Management permission and enter your cluster or project.

  2. Click Application Workloads > Services in the left navigation pane.

  3. Click the name of a service in the list to open its details page.

  4. Select More > Edit Metrics Exporter in the upper left corner of the service details page.

  5. On the Edit Metrics Exporter page, set the collection path, collection interval, and timeout for the monitoring metrics, then click OK.

    The monitoring and alerting module of KubeSphere will access the service and collect the application’s monitoring metrics based on the parameters set here.

    ParameterDescription

    Protocol

    The protocol used for communication, which can be HTTP or HTTPS.

    Port

    The service port used for communication.

    Path

    The path exposing the application’s monitoring metrics.

    Authentication Method

    The communication authentication method for the process of collecting application monitoring metrics.

    • No Authentication: No authentication method is used. This method may have information security risks.

    • TLS: The process of collecting application monitoring metrics is authenticated through the TLS protocol.

    • Bearer Token: Authentication is performed through a token.

    • Basic Authentication: Authentication is performed through a username and password.

    Except for No Authentication, other authentication methods require corresponding authentication logic to be configured in the application and a Secret containing the authentication information to be created in advance.

    Collection Interval

    The collection interval for application monitoring metrics, in minutes.

    Timeout

    The timeout for each collection of application monitoring metrics, in seconds.

Note

After the metrics exporter is created, you also need to use the monitoring metrics to further create rule groups or custom monitoring dashboards in the KubeSphere web console to monitor the running status of the application.

Receive the latest news, articles and updates from KubeSphere


Thanks for the feedback. If you have a specific question about how to use KubeSphere, ask it on Slack. Open an issue in the GitHub repo if you want to report a problem or suggest an improvement.

What’s on this Page