All Products
Search
Document Center

Application Real-Time Monitoring Service:Enable tracing for NGINX Ingress Controller

Last Updated:Jul 19, 2024

You can enable tracing for NGINX Ingress Controller deployed in a Container Service for Kubernetes (ACK) cluster, and import trace data to Managed Service for OpenTelemetry. Then, you can view traces and topology in Managed Service for OpenTelemetry to troubleshoot issues related to NGINX Ingress Controller. This topic describes how to enable tracing for NGINX Ingress Controller.

Prerequisites

Step 1: Obtain an endpoint from Managed Service for OpenTelemetry

Select a client to obtain an endpoint based on your requirements. In this example, a Zipkin client is used.

  1. Log on to the Managed Service for OpenTelemetry console.

  2. In the left-side navigation pane, click Cluster Configurations. In the top navigation bar, select a region. Then, click the Access point information tab

    Note

    The region that you select must be the same as the region of the cluster used in Step 2: Enable Managed Service for OpenTelemetry for an Ingress in the ACK console.

  3. On the Access point information tab, turn on Show Token. Click Zipkin. In the Related Information column of the table, click the copy icon next to the value of Access point of Alibaba Cloud vpc in the v1 endpoint section.

    Note

    The NGINX Ingress controller is deployed on Alibaba Cloud and resides in the same region as the endpoint of Managed Service for OpenTelemetry. Therefore, we recommend that you use a VPC endpoint. Otherwise, use a public endpoint.

    20240527143714.jpg

Step 2: Enable Managed Service for OpenTelemetry for an Ingress in the ACK console

  1. Log on to the ACK console. In the left-side navigation pane, click Clusters.

  2. On the Clusters page, find the cluster that you want to manage and click its name. In the left-side navigation pane, choose Configurations > ConfigMaps.

  3. In the upper part of the ConfigMap page, select kube-system from the Namespace drop-down list, enter nginx-configuration in the Name search box, and then click Edit in the Actions column of the search result.

  4. Configure Zipkin as the tracing analysis client.

    In the Edit panel, click Add. Enter zipkin-collector-host in the Name field and enter the endpoint that is obtained in Step 1: Obtain the endpoint from Managed Service for OpenTelemetry in the Value field.

    Important

    You must delete http:// at the beginning of the endpoint and add a question mark (?) at the end of the endpoint. Example:

    • Original endpoint: http://tracing-analysis-dc-hz-internal.aliyuncs.com/adapt_******_******/api/v1/spans

    • Modified endpoint: tracing-analysis-dc-hz-internal.aliyuncs.com/adapt_******_******/api/v1/spans?

  5. Enable the tracing analysis feature.

    In the Edit panel, click Add. Enter enable-opentracing in the Name field and enter true in the Value field. Then, click OK.

    image

Step 3: View trace data

Use the ARMS console

  1. Log on to the ARMS console.
  2. In the left-side navigation pane, choose Application Monitoring > Applications.

  3. In the top navigation bar of the Applications page, select a region and click the nginx application.

  4. In the left-side navigation pane of the details page, click Interface Invocation. In the right-side section of the Interface Calls page, view the information about traces.

    • On the Overview tab, view the topology.3.jpg

    • Click the Traces tab to view the top 100 traces that consume the most amount of time for the application. For more information, see API calls.调用链路

    • On the Traces tab, find a trace that you want to view and click its ID to view the details of the trace.2.jpg

Use the Managed Service for OpenTelemetry console

  1. Log on to the Managed Service for OpenTelemetry console.

  2. In the left-side navigation pane, click Applications.

  3. On the Applications page, select a region in the top navigation bar, find the nginx application, and then click the application name. The details page of the application appears.

  4. In the left-side navigation pane of the details page, click Interface Invocation. In the right-side section of the Interface Calls page, view the information about traces.

    • On the Overview tab, view the topology.3.jpg

    • Click the Traces tab to view the top 100 traces that consume the most amount of time for the application. For more information, see API calls.调用链路

    • On the Traces tab, find a trace that you want to view and click its ID to view the details of the trace.2.jpg

References

  • For more information about Managed Service for OpenTelemetry, see What is Managed Service for OpenTelemetry?

  • For more information about ACK, see What is ACK?

  • To use different tracing clients, such as Zipkin, Jaeger, and SkyWalking, you must configure different parameters in the nginx-configuration ConfigMap of ACK. In this example, Zipkin is used.Managed Service for OpenTelemetry For more information about how to access Managed Service for OpenTelemetry, see Preparations.