Note: This should be moved to a Dynatrace owned repo and the shortcut link should be updated to point to the new endpoint
- Sign into GitHub.com then click the
Code
button. - Select the
Codespaces
tab - Click "Create codespace on main"
Wait for the system to start. A new browser window will be created and a Kubernetes cluster will be installed for you. Towards the bottom of the screen, you should see an empty terminal prompt like this:
Soon after the codespace starts, you should see this in the terminal window. Wait until it says "Done". While you are waiting, you can proceed to the next step to create an access token.
- Press
Ctrl + k
to bring up the search box. - Type
access tokens
and select the first option - Create an access token with these permissions:
openTelemetryTrace.ingest
,metrics.ingest
andlogs.ingest
- Click
Generate token
and save the token
Use kubectl
to create a Secret
to store your Dynatrace connection details.
Substitute your values into the following command and execute it.
Note: Do not change the name. Leave as dynatrace-otelcol-dt-api-credentials
kubectl create secret generic dynatrace-otelcol-dt-api-credentials \
--from-literal=DT_ENDPOINT=https://abc12345.live.dynatrace.com \
--from-literal=DT_API_TOKEN=dt0c01.sample.secret
You should see this: secret/dynatrace-otelcol-dt-api-credentials created
Copy and paste the following to add the OpenTelemetry Helm chart and update it to the latest versions.
helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
helm repo update
The OpenTelemetry collector requires a configuration file. This is already available in the environment. See collector-values.yaml
You do not need to modify this file.
Install the collector by copy and pasting this content:
helm upgrade -i dynatrace-collector open-telemetry/opentelemetry-collector -f collector-values.yaml
After Helm indicates it has installed, run the following command and you should see a pod either Pending
or Running
.
kubectl get pods
Wait and periodically re-run kubectl get pods
until the Pod is Running
.
Use Helm to install the OpenTelemetry demo system, passing the configuration file (already created for you - see otel-demo-values.yaml).
helm upgrade -i my-otel-demo open-telemetry/opentelemetry-demo -f otel-demo-values.yaml
The Pods may take 2-3 minutes to start, but running kubectl get pods
should eventually show the pods running.
Note: This step is optional because there is a load generator already running. Observability data will be flowing into Dynatrace.
Expose the user interface on port 8080 by port-forwarding:
kubectl -n default port-forward sv/my-otel-demo-frontendproxy 8080:8080
Open a browser and go to http://localhost:8080
In Dynatrace, press Ctrl + k
again and search for Notebooks
.
Create a new notebook and add a new section exploring the logs.
Add a new section and choose Query Grail
. This section type allows you to write your own Dynatrace Query Language (DQL) to have full control over the data you retrieve.
Type: fetch spans
in the DQL box and execute the query.