Integrate With Jaeger ​
Overview ​
| 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.
Table of Content ​
Prerequisites ​
- 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
Installation ​
Preparation ​
Export your namespace as a variable with the following command:
bashexport 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:
bashexport HELM_JAEGER_RELEASE="jaeger"Update your Helm installation with the required Helm repository:
bashhelm repo add jaegertracing https://jaegertracing.github.io/helm-charts helm repo update
Install Jaeger ​
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.yamlThe 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.
Verify the Installation ​
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_RELEASEActivate a TracePipeline ​
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
EOFActivate Istio Tracing ​
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
EOFAccess Jaeger ​
To access Jaeger using port forwarding, run:
bashkubectl -n $K8S_NAMESPACE port-forward svc/$HELM_JAEGER_RELEASE-query 16686Open the Jaeger UI in your browser under
http://localhost:16686.
Deploy a Workload and Activate Kyma’s TracePipeline Feature ​
To see distributed traces visualized in Jaeger, follow the instructions for the sample app or the OpenTelemetry Demo App.
Advanced Topics ​
Integrate With Grafana ​
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 integration guide.
To have a Jaeger data source as part of the Grafana installation, deploy a Grafana data source in the following way:
bashcat <<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 EOFRestart the Grafana instance. Afterwards, the Jaeger data source is available in the
Exploreview.
Authentication ​
By itself, Jaeger does not provide authentication mechanisms. To secure Jaeger, follow the instructions provided in the Jaeger documentation.
Expose Jaeger ​
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:
bashcat <<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 EOFGet the public URL of your Jaeger instance:
bashkubectl -n $K8S_NAMESPACE get vs -l apirule.gateway.kyma-project.io/v1beta1=jaeger.$K8S_NAMESPACE -ojsonpath='{.items[*].spec.hosts[*]}'
Clean Up ​
When you're done, remove the example and all its resources from the cluster.
Remove the stack by calling Helm:
bashhelm delete -n $K8S_NAMESPACE $HELM_JAEGER_RELEASEIf you created the
$K8S_NAMESPACENamespace specifically for this tutorial, remove the Namespace:bashkubectl delete namespace $K8S_NAMESPACE