What if I don't have OpenTelemetry installed?
No worries! You can get started with no code changes at all!
This page will explain getting started with OpenTelemetry:
- Injecting auto instrumentation with no code changes.
- Auto instrumentation with limited code changes.
- Manual instrumentation with code changes.
You can also find more ways to instrument OpenTelemetry in their documentation.
- No Code Changes
- Other Options
- Auto Instrumentation
- Manual Instrumentation
You can install the OpenTelemetry Operator in any existing Kubernetes environment in under 5 minutes by running the following set of commands.
This is required for the OpenTelemetry Operator to work.
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.11.0/cert-manager.yaml
2. Install the OpenTelemetry Operator
Traces will be generated and collected automatically.
kubectl apply -f https://github.com/open-telemetry/opentelemetry-operator/releases/latest/download/opentelemetry-operator.yaml
3. Create a file named
otel-collector.yaml for the OpenTelemetry config
You configure 2 separate things:
1. The Instrumentation, which is an init-container that will run on any pod you explictly mark (see step 5).
2. The OpenTelemetry collector, which will collect the traces from the init-container and send them to Tracetest, and/or your trace data store.
What's amazing here is that you can add other exporters to this config file to send the traces to other services as explained here.
4. Apply the
otel-collector.yaml config file
kubectl apply -f otel-collector.yaml
5. Update any service you want to instrument
Add an environment variable named
SERVICE_NAME to your service so that you can
later identify it in the tests.
- name: SERVICE_NAME
This will automatically instrument your service with OpenTelemetry and send the traces to the OpenTelemetry collector.
Apply the changes and you're ready! You can start writing integration and end-to-end tests with trace-based testing!
Check the official OpenTelemetry docs explaining how to use the OpenTelemetry Operator.
Below we provide quick links to all key docs and samples.
Below we provide quick links to all key docs.
Jump back to the installation guide once you have OpenTelemetry installed.