2. Getting Started
Getting Started#
Live Code Snippets
The code snippets in this tutorial can be executed live from within the browser. To enable this, just follow the instructions below.
Then click the green buttons below each code snippet. After the command has executed, the response will appear in a popup box at the bottom of the screen.
If you do not want to use this functionality, you can still copy and paste the commands into the codespace terminal.
Set Details for Live Code Snippets#
Your browser needs to make an authenticated connection to the codespace. To do so, the browser needs the endpoint and secret key available.
These are stored in the browsers local storage and you will retrieve and set these now.
Retrieve the URL by going to the Ports
tab in the codespace, click the row corresponding to port 8000
and press Ctrl + c
.
Alternatively you can right click and choose Copy Local address
Retrieve authentication token by running this command in your codespace terminal:
cat /tmp/secret
Paste the details into these boxes and click the Save button.
Connection Item | Description |
---|---|
Server URL | |
Secret Key |
Start Server#
Start the server now. Run the following command in the codespace terminal.
This server will receive commands from the browser and use runme to find and run that code snippet from the markdown documentation.
nohup fastapi run /workspaces/$RepositoryName/listenserver.py &
Test the connection#
Response will appear here...
Click the button below. If you see a green popup at the bottom of the screen, this confirms that the browser to codespace connection works.
echo "Success! The connection works."
Gather Details: Tenant ID#
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
Reformat the URL like this: https://TENANT_ID.live.dynatrace.com
eg. https://abc12345.live.dynatrace.com
Gather Details: Create API Token#
k6 requires an API token to stream metrics to Dynatrace.
Create an API token with the following permissions:
metrics.ingest
openpipeline.events_sdlc
Start Demo#
Click this button to launch the demo in a new tab.