Kubernetes

Before you begin, you need to make a code change! Here's why.

Watch our demonstration video!

Overview

Sprkl Integration with Kubernetes provides auto instrumentation with both infra-level (OpenTelemetry) and code-level (Sprkl) instrumentation for all the services in the cluster.

Currently, we provide infra-level instrumentation (libraries and infrastructure-level instrumentation using OpenTelemetry) for:

  • Java

  • C#

  • Python

  • Node.js

And code-level Instrumentation (code changes instrumentation using Sprkl) for:

  • Node.js

Usage

To run Sprkl in your Kubernetes environment:

  1. Make sure code changes that you want to instrument are deployed to your cluster and in sync with the local files.

  2. Make sure kubectl it is configured to work with your cluster.

  3. Deploy Sprkl Operator on your development cluster:

sprkl k8s up

The Sprkl Operator applies automatic library and infrastructure-level instrumentation (using Opentelemetry libraries). It also integrates Sprkl instrumentation with it. Together Sprkl brings you cluster-level distributed tracing with personalization on your Node.js services.

  1. Select deployments/pods you want to instrument with infra-level (opt-in mode) / avoid instrument (opt-out mode). This list will appear only if you have any pods running on your cluster.

Opt In will instrument only the pods you will select in the next phase. Opt out will instrument all pods (system-wide) except those you will select in the next phase

  1. Select deployments/pods you want to instrument with code-level instrumentation. This list will appear only if you have any pods with infra-level instrumentation.

Code-level instrumentation is available only for pods selected for infra-level instrumentation (meaning only pods with infra-level instrumentation are eligible for an upgrade to code-level instrumentation)

  1. Choose the repository to analyze for code changes. Please provide a full path or choose from the existing known paths by pressing TAB TAB. This option will appear only if you choose any deployments for code-level instrumentation.

  2. Choose the recipe (filter) for determining which code changes you would like to include in the analysis. This option will appear only if you choose any deployments for code-level instrumentation.

  3. Select the pods you wish to restart so the instrumentation will take effect. All the pods in thnoteis list are not in the desired state (meaning the current instrumentation level is different from the desired instrumentation level), we recommend choosing all the options. This option will appear only if there are deployments at the code level or has a different state from the desired state.

Making a code change

From now on, every new pod which matches your selection - will be instrumented with infra-level.

The instrumentation is according to the latest analysis done on your local machine. So, when trying new code changes, make sure they are analyzed before deploying them to the cluster or execute sprkl k8s repeat.

To provide analysis that can be consumed by sprkl within the cluster, use the sprkl apply command on the target repository. And restart the relevant pods.

Deploy the changes to your cluster and execute the code changes. For example: run a curl command to the micro-service in which the code was changed) and see the relevant traces in the Sprkl Dashboard.

Video of Sprkl on a Kubernetes cluster using Okteto

Video of Sprkl on a local Kubernetes cluster using TILT

Last updated