Zipkin

Zipkin is a distributed tracking system. It helps collect time data needed to troubleshoot latency issues in service architectures. Features include collecting and searching this data. Use Devprime’s standard OpenTelemetry protocol.

The integration with Open Telemetry is completely native, in the Devprime platform, simplifying the journey of the software developer with the use of this resource, which adds a lot of value in the distributed systems scenario, allowing you to track a business process in all the microservices involved.

The leading cloud platforms in the market are already supporting Open Telemetry, which facilitates adoption in the production environment. There is the option to use it on kubernetes or any other managed solution.

In the context of our demo, we’ll use a local docker container to have the data collector and the Zipkin tool.

Follow the steps below:

  1. Install the Devprime CLI.

  2. Initialize the Zipkin container provided in the docker documentation.

  3. Clone the repository with the two microservices (ms-order/ms-payment) or deploy manually.
    git clone https://github.com/devprime/devprime-microservices-order-payment.git.

  4. Update the Stack by running on the main folder to detect both microservices
    dp stack

  5. Locate the configuration file in the folder of each microservice that in this example mentioned in item 2 we will use “ms-order” and “ms-payment”.

a) Open the file in Visual Studio Code inside the microservice folder
code src/App/appsettings.json

b) Open the Observability switch and verify that the Enable option is true. Then go to the Trace option and set the Enable to true, Type to zipkin and the Endpoint with the url of the service. In on-premises docker, the url has the default value of “http://localhost:9411/api/v2/spans”.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 "Devprime_Observability": {
    "Enable": "true",
    "Log": {
      "Enable": "true",
      "Save": "false",
      "Type": "text",
      "FileSize": "5242880",
      "HideDetails": "false",
      "HideDateTime": "false",
      "ShowAppName": "false",
      "Path": "",
      "ShowHttpErrors": "400",
      "Export": {
        "Enable": "false",
        "Type": "seq",
        "Host": "http://localhost:5341",
        "ApiKey": "your api key",
        "ControlLevelSwitch": "Information"
      }
    },
    "Metrics": {
      "Enable": "false"
    },
    "Trace": {
      "Enable": "true",
      "Type": "zipkin",
      "Endpoint": "http://localhost:9411/api/v2/spans"
    }
  },
  1. Run the ‘ms-order’ microservice and notice in the log that the configured Open Telemetry information will already be up and running. The log already shows that the Trace is set to Enable and the Type is set to “ZipKin”.
1
2
[App][Observability]["Enable"][Log "Enable"][Export "Disable"]
[Trace "Enable"][Type "zipkin"][Metrics "Disable"]

Tracking the trace of a microservice

  1. Run the ms-order microservice
  2. Open in the browser in http://localhost:5000 and make one or more posts in /v1/order
  3. Open Zipkin in the browser in http://localhost:9411 and view

Welcome Zipkin

  1. Check all the details of the processing

Welcome Zipkin

Tracking the tracing of two or more microservices

  1. Run both microservices (ms-order / ms-payment)
  2. Post to the ms-order microservice
  3. View details on Zipkin

Welcome Zipkin

Legal information:
Zipkin is an open-source tool that supports the Open Telemetery standard. For any information on licensing and use, we recommend the manufacturer.

Last modified January 10, 2024 (967dcac3)