Using Jaeger to trace requests in Managed Service for YDB
The Jaeger
In this article, you will learn how to install the Jaeger platform in a Managed Service for Kubernetes cluster and configure it to work with Yandex Managed Service for YDB:
- Install and configure Jaeger.
- Install a test application to create load on a Kubernetes cluster.
- Test Jaeger by making a few test requests.
Getting started
-
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the
--folder-name
or--folder-id
parameter. -
Create security groups for the Managed Service for Kubernetes cluster and its node groups.
Warning
The configuration of security groups determines the performance and availability of the cluster and the services and applications running in it.
-
Create a Managed Service for Kubernetes cluster and a node group in any suitable configuration. When creating them, specify the security groups prepared in advance.
-
Install kubectl
and configure it to work with the created cluster.
Install and configure Jaeger
-
Install Jaeger over YDB from the Yandex Cloud Marketplace application catalog. When installing the application, select the default namespace (
default
). -
Make sure that all the Jaeger pods have changed their state to
Running
:kubectl get pods | grep jaeger
-
Retrieve the service name for
jaeger-ydb-store-agent
:kubectl get svc | grep ydb-store-agent
Result:
<jaeger-ydb-store-agent_application_name> ClusterIP 10.2.238.190 ...
Install a test application
To test Jaeger, use the HotROD
-
Create a manifest called
hotrod.yaml
with the application description:--- apiVersion: v1 kind: Pod metadata: name: hotrod spec: containers: - name: hotrod image: jaegertracing/example-hotrod:latest env: - name: JAEGER_AGENT_HOST value: "<jaeger-ydb-store-agent_application_name>.default.svc.cluster.local" - name: JAEGER_AGENT_PORT value: "6831" ports: - containerPort: 8080 - containerPort: 8081 - containerPort: 8082 - containerPort: 8083
-
Create a pod with the
hotrod
application:kubectl apply -f hotrod.yaml
-
Make sure the
hotrod
pods have changed their status toRunning
:kubectl get pods | grep hotrod
Test Jaeger
-
Retrieve the service name for
jaeger-ydb-store-query
:kubectl get svc | grep jaeger-ydb-store-query
Result:
<jaeger-ydb-store-query_application_name> LoadBalancer 10.2.222.155 130.133.51.247 16686:31189/TCP ...
-
Configure port forwarding for the
jaeger-ydb-store-query
service to redirect to the local machine:kubectl port-forward service/<jaeger-ydb-store-query_application_name> 16686:16686
-
In a different console window, configure port forwarding for the
hotrod
application to redirect to the local machine:kubectl port-forward hotrod 8080:8080
-
Open
hotrod's
URI in your browser and make a few test requests to Jaeger. -
Open Jaeger's URI in your browser.
Make sure that the test requests have been transmitted successfully and have been included in the trace.
Delete the resources you created
Delete the resources you no longer need to avoid paying for them:
- Delete the Managed Service for YDB database.
- Delete the Managed Service for Kubernetes cluster.
- If you reserved a public static IP address for the cluster, delete it.