Category | |
---|---|
Signal types | traces |
Backend type | custom in-cluster |
OTLP-native | yes |
Learn how to use Jaeger as a tracing backend with Kyma's TracePipeline.
- Kyma as the target deployment environment
- The Telemetry module is added
- Kubectl version that is within one minor version (older or newer) of
kube-apiserver
- Helm 3.x
-
Export your namespace as a variable with the following command:
export K8S_NAMESPACE="jaeger"
-
Export the Helm release name that you want to use. The release name must be unique for the chosen Namespace. Be aware that all resources in the cluster will be prefixed with that name. Run the following command:
export HELM_JAEGER_RELEASE="jaeger"
-
Update your Helm installation with the required Helm repository:
helm repo add jaegertracing https://jaegertracing.github.io/helm-charts helm repo update
Note
It is officially recommended to install Jaeger with the Jaeger operator. Because the operator requires a cert-manager to be installed, the following instructions use a plain Jaeger installation. However, the described installation is not meant to be used for production setups.
Run the Helm upgrade command, which installs the chart if not present yet.
helm upgrade --install --create-namespace -n $K8S_NAMESPACE $HELM_JAEGER_RELEASE jaegertracing/jaeger -f https://raw.githubusercontent.com/kyma-project/telemetry-manager/main/docs/user/integration/jaeger/values.yaml
The previous command uses the values.yaml provided in this jaeger
folder, which contains customized settings deviating from the default settings. Alternatively, you can create your own values.yaml
file and adjust the command.
Check if the jaeger
Pod was successfully created in the Namespace and is in the Running
state:
kubectl -n $K8S_NAMESPACE rollout status deploy $HELM_JAEGER_RELEASE
To configure the Kyma trace gateway with the deployed Jaeger instance as the backend. To create a new TracePipeline, execute the following command:
cat <<EOF | kubectl -n $K8S_NAMESPACE apply -f -
apiVersion: telemetry.kyma-project.io/v1alpha1
kind: TracePipeline
metadata:
name: jaeger
spec:
output:
otlp:
protocol: http
endpoint:
value: http://$HELM_JAEGER_RELEASE-collector.$K8S_NAMESPACE.svc.cluster.local:4318
EOF
To enable Istio to report span data, apply an Istio telemetry resource and set the sampling rate to 100%. This approach is not recommended for production.
cat <<EOF | kubectl apply -f -
apiVersion: telemetry.istio.io/v1
kind: Telemetry
metadata:
name: tracing-default
namespace: istio-system
spec:
tracing:
- providers:
- name: "kyma-traces"
randomSamplingPercentage: 100.00
EOF
-
To access Jaeger using port forwarding, run:
kubectl -n $K8S_NAMESPACE port-forward svc/$HELM_JAEGER_RELEASE-query 16686
-
Open the Jaeger UI in your browser under
http://localhost:16686
.
To see distributed traces visualized in Jaeger, follow the instructions for the OpenTelemetry Demo App.
Jaeger can be provided as a data source integrated into Grafana. For example, it can be part of a Grafana installation as described in the Prometheus tutorial.
-
To have a Jaeger data source as part of the Grafana installation, deploy a Grafana data source in the following way:
cat <<EOF | kubectl -n $K8S_NAMESPACE apply -f - apiVersion: v1 kind: ConfigMap metadata: name: jaeger-grafana-datasource labels: grafana_datasource: "1" data: jaeger-grafana-datasource.yaml: |- apiVersion: 1 datasources: - name: Jaeger-Tracing type: jaeger access: proxy url: http://$HELM_JAEGER_RELEASE-query.$K8S_NAMESPACE:16686 editable: true EOF
-
Restart the Grafana instance. Afterwards, the Jaeger data source is available in the
Explore
view.
By itself, Jaeger does not provide authentication mechanisms. To secure Jaeger, follow the instructions provided in the Jaeger documentation .
CAUTION: The following approach exposes the Jaeger instance as it is, without providing any ways of authentication.
-
To expose Jaeger using Kyma API Gateway, create the following APIRule:
cat <<EOF | kubectl -n $K8S_NAMESPACE apply -f - apiVersion: gateway.kyma-project.io/v1beta1 kind: APIRule metadata: name: jaeger spec: host: jaeger-ui service: name: $HELM_JAEGER_RELEASE-query port: 16686 gateway: kyma-system/kyma-gateway rules: - path: /.* methods: ["GET", "POST"] accessStrategies: - handler: noop mutators: - handler: noop EOF
-
Get the public URL of your Jaeger instance:
kubectl -n $K8S_NAMESPACE get vs -l apirule.gateway.kyma-project.io/v1beta1=jaeger.$K8S_NAMESPACE -ojsonpath='{.items[*].spec.hosts[*]}'
When you're done, remove the example and all its resources from the cluster.
-
Remove the stack by calling Helm:
helm delete -n $K8S_NAMESPACE $HELM_JAEGER_RELEASE
-
If you created the
$K8S_NAMESPACE
Namespace specifically for this tutorial, remove the Namespace:kubectl delete namespace $K8S_NAMESPACE