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:
And code-level Instrumentation (code changes instrumentation using Sprkl) for:
How it works
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
kubectlit is configured to work with your cluster.
- 4.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.
- 5.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
- 6.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)
- 7.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.
- 8.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.
- 9.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 applycommand on the target repository. And restart the relevant pods.
Deploy the changes to your cluster and execute the code changes. For example: run a
curlcommand to the micro-service in which the code was changed) and see the relevant traces in the Sprkl Dashboard.