Kubernetes
Last updated
Last updated
Before you begin, you need to make a code change! Here's why.
Watch our demonstration video!
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
To run Sprkl in your Kubernetes environment:
Make sure code changes that you want to instrument are deployed to your cluster and in sync with the local files.
Make sure kubectl
it is configured to work with your cluster.
Deploy Sprkl Operator on your development cluster:
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.
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
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)
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.
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.
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.
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.