2. Getting Started
Gather Details: Tenant ID & Environment#
You will need access to a Dynatrace tenant. If you do not have access, sign up for a free 15 day trial.
Make a note of your Dynatrace tenant ID. It is the first bit of your URL (eg. abc12345
in the following examples):
https://abc12345.live.dynatrace.com
https://abc12345.apps.dynatrace.com
Gather Details: Environment Type#
Make a note of your "environment type" based on your URL.
If you are unsure, use live
.
URL | Environment Type |
---|---|
abc12345.apps.dynatrace.com | live |
abc12345.live.dynatrace.com | live |
abc12345.sprint.dynatracelabs.com | sprint |
abc12345.dev.dynatracelabs.com | dev |
Gather Details: Create API Token#
k6 requires an API token to stream metrics to Dynatrace.
This demo also sends an SDLC event after the test has finished. For this, it needs the events_sdlc
API permission.
Create an API token with the following permissions:
metrics.ingest
openpipeline.events_sdlc
Recap Required Info
You should now have three pieces of information:
- Environment ID
- Environment Type
- API Token
Start Demo#
Enter Required Information
During the next step you will be prompted for some details.
Enter the relevant details in the GitHub form.
Click this button to launch the demo in a new tab.
- Clone the repository to your local machine
git clone https://github.com/dynatrace/obslab-k6
- Open the folder in Visual Studio code
- Ensure the Microsoft devcontainer extension is installed in VSCode
-
Open a new terminal in VSCode and set your environment variables as appropriate:
set DT_ENVIRONMENT_ID=abc12345 set DT_ENVIRONMENT_TYPE=live set DT_API_TOKEN=dt0c01.******.***********
-
Start Docker / Podman
-
Create the environment
devcontainer up
It will take a few moments but you should see:
{"outcome":"success","containerId":"...","remoteUser":"root","remoteWorkspaceFolder":"/workspaces/obslab-k6"}
- Connect to the demo environment. This will launch a new Visual Studio Code window
devcontainer open
In the new Visual Studio code window, open a new terminal and continue with the tutorial.