Skip to content

Commit

Permalink
Deployed 0867e07 with MkDocs version: 1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
agardnerIT committed Aug 29, 2024
1 parent 8f3c282 commit 0d7f6c0
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 1 deletion.
Binary file added images/sdlc-event.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions run-demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,15 @@
</span>
</a>

</li>

<li class="md-nav__item">
<a href="#view-events" class="md-nav__link">
<span class="md-ellipsis">
View Events
</span>
</a>

</li>

<li class="md-nav__item">
Expand Down Expand Up @@ -510,6 +519,15 @@
</span>
</a>

</li>

<li class="md-nav__item">
<a href="#view-events" class="md-nav__link">
<span class="md-ellipsis">
View Events
</span>
</a>

</li>

<li class="md-nav__item">
Expand Down Expand Up @@ -579,6 +597,49 @@ <h2 id="validate-metrics">Validate Metrics<a class="headerlink" href="#validate-
<li>Press <code>ctrl + =</code> to bring up auto completion. You should see the list of ingest</li>
</ul>
<p><img alt="notebook showing metrics" src="../images/notebook-showing-metrics.png" /></p>
<h2 id="view-events">View Events<a class="headerlink" href="#view-events" title="Permanent link">#</a></h2>
<p>When the load test finished, the <a href="https://github.com/Dynatrace/obslab-k6/blob/d2e11127f3a9e7665d67ab2015c7e4a2d7599b96/k6scripts/script.js#L17" target="_blank">teardown function</a> sends a Software Delivery Lifecycle Event (SDLC) to Dynatrace.</p>
<pre><code>// Run load with 2 virtual users for 1 minute
export const options = {
vus: 2,
duration: '1m',
};

...

export function teardown() {
let post_params = {
headers: {
'Content-Type': 'application/json',
'Authorization': `Api-Token ${__ENV.K6_DYNATRACE_APITOKEN}`
},
};

// Send SDLC event at the end of the test
let payload = {
&quot;event.provider&quot;: &quot;k6&quot;,
&quot;event.type&quot;: &quot;test&quot;,
&quot;event.category&quot;: &quot;finished&quot;,
&quot;service&quot;: &quot;dummyservice&quot;,
&quot;duration&quot;: options.duration
}
let res = http.post(`${__ENV.K6_DYNATRACE_URL}/platform/ingest/v1/events.sdlc`, JSON.stringify(payload), post_params);
}
</code></pre>
<p>Notice that the event contains metadata such as the <code>provider</code> and <code>service</code> which can be used for filtering in Dynatrace (see DQL below).</p>
<p>This event can be used as a trigger Dynatrace for workflows, synthetic tests, the site reliability guardian and more.</p>
<p>In Dynatrace:</p>
<ul>
<li>Press <code>ctrl + k</code> and search for <code>notebooks</code></li>
<li>Open an existing notebook or create a new one</li>
<li>Add a new <code>DQL</code> section and paste the following</li>
</ul>
<pre><code>fetch events
| filter event.kind == &quot;SDLC_EVENT&quot;
| filter event.provider == &quot;k6&quot;
</code></pre>
<p><img alt="sdlc event" src="../images/sdlc-event.png" /></p>
<p>User exercise: Modify the JSON body to also send the number of Virtual Users (VUs) used to Dynatrace. Re-run the load test to see the new event.</p>
<h2 id="view-dashboard">View Dashboard<a class="headerlink" href="#view-dashboard" title="Permanent link">#</a></h2>
<p>Open the prebuilt dashboard you previously uploaded.</p>
<p>Go to Dashboards (<code>ctrl + k</code> and search for <code>Dashboards</code>)</p>
Expand Down
2 changes: 1 addition & 1 deletion search/search_index.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"1. About","text":"<p>This demo will run a Grafana k6 script and use the Dynatrace output plugin to stream metrics to Dynatrace.</p> <p></p>"},{"location":"#compatibility","title":"Compatibility","text":"Deployment Tutorial Compatible Dynatrace Managed \u2714\ufe0f Dynatrace SaaS \u2714\ufe0f"},{"location":"#click-here-to-begin","title":"Click Here to Begin...","text":""},{"location":"cleanup/","title":"4. Cleanup","text":"<p>To cleanup resources, go to https://github.com/codespaces and delete the codespace.</p> <p>You may also want to deactivate or delete the API token.</p>"},{"location":"cleanup/#whats-next","title":"What's Next?","text":""},{"location":"getting-started/","title":"2. Getting Started","text":""},{"location":"getting-started/#gather-details-tenant-id","title":"Gather Details: Tenant ID","text":"<p>You will need access to a Dynatrace tenant. If you do not have access, sign up for a free 15 day trial.</p> <p>Make a note of your Dynatrace tenant ID. It is the first bit of your URL (eg. <code>abc12345</code> in the following examples):</p> <pre><code>https://abc12345.live.dynatrace.com\nhttps://abc12345.apps.dynatrace.com\n</code></pre> <p>Reformat the URL like this: <code>https://TENANT_ID.live.dynatrace.com</code> eg. <code>https://abc12345.live.dynatrace.com</code></p>"},{"location":"getting-started/#gather-details-create-api-token","title":"Gather Details: Create API Token","text":"<p>k6 requires an API token to stream metrics to Dynatrace.</p> <p>Create an API token with the following permissions:</p> <ul> <li><code>metrics.ingest</code></li> <li><code>openpipeline.events_sdlc</code></li> </ul>"},{"location":"getting-started/#start-demo","title":"Start Demo","text":"<p>Click this button to launch the demo in a new tab.</p> <p></p>"},{"location":"getting-started/#click-here-to-run-the-demo","title":"Click Here to Run the Demo...","text":""},{"location":"resources/","title":"6. Resources","text":""},{"location":"resources/#resources","title":"Resources","text":"<ul> <li>Sign up for a Dynatrace Trial</li> <li>k6 on Dynatrace Hub</li> <li>Dynatrace xk6 output plugin source code on GitHub</li> <li>This tutorial on GitHub</li> </ul>"},{"location":"run-demo/","title":"3. Run Demo","text":""},{"location":"run-demo/#import-dynatrace-dashboard","title":"Import Dynatrace Dashboard","text":"<p>While you are waiting for the environment, add the dashboard to your Dynatrace environment.</p> <ol> <li>Save the k6 dashboard to your local machine.</li> <li>In Dynatrace, navigate to <code>Dashboards</code> and click <code>Upload</code></li> <li>Upload the dashboard JSON file</li> </ol>"},{"location":"run-demo/#start-k6","title":"Start k6","text":"<p>In the codespace terminal, type <code>docker ps</code> and wait until Docker is running.</p> <p>You should see this:</p> <pre><code>CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES\n</code></pre> <p>Now run k6 with the demo script. Copy and paste this as-is into the terminal window:</p> <pre><code>docker run \\\n -e K6_DYNATRACE_URL=$DT_URL \\\n -e K6_DYNATRACE_APITOKEN=$DT_K6_TOKEN \\\n --mount type=bind,source=./k6scripts,target=/k6scripts hrexed/xk6-dynatrace-output:0.11 run /k6scripts/script.js \\\n -o output-dynatrace\n</code></pre>"},{"location":"run-demo/#validate-metrics","title":"Validate Metrics","text":"<p>k6 streams metrics into Dynatrace so after about a minute, do the following to ensure metrics are reaching Dynatrace.</p> <p>In Dynatrace:</p> <ul> <li>Press <code>ctrl + k</code> and search for <code>notebooks</code></li> <li>Create a new notebook and add a new <code>DQL</code> section</li> <li>Type the following: <code>timeseries avg(k6)</code></li> <li>Press <code>ctrl + =</code> to bring up auto completion. You should see the list of ingest</li> </ul> <p></p>"},{"location":"run-demo/#view-dashboard","title":"View Dashboard","text":"<p>Open the prebuilt dashboard you previously uploaded.</p> <p>Go to Dashboards (<code>ctrl + k</code> and search for <code>Dashboards</code>)</p> <p>The dashboard will begin to be populated with data.</p> <p></p> <p>The demo is complete.</p>"},{"location":"run-demo/#click-here-to-delete-and-cleanup-resources","title":"Click Here to Delete and Cleanup resources...","text":""},{"location":"whats-next/","title":"5. What's Next?","text":"<p>The k6 listing on the Dynatrace Hub contains information about how to build your own custom k6 binary using <code>xk6</code>.</p> <p>You can also browse the source code of the Dynatrace plugin, get support and request enhancements on the Dynatrace xk6 output plugin on Github.</p> <p>View the resources page for more links and useful materials.</p>"}]}
{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"1. About","text":"<p>This demo will run a Grafana k6 script and use the Dynatrace output plugin to stream metrics to Dynatrace.</p> <p></p>"},{"location":"#compatibility","title":"Compatibility","text":"Deployment Tutorial Compatible Dynatrace Managed \u2714\ufe0f Dynatrace SaaS \u2714\ufe0f"},{"location":"#click-here-to-begin","title":"Click Here to Begin...","text":""},{"location":"cleanup/","title":"4. Cleanup","text":"<p>To cleanup resources, go to https://github.com/codespaces and delete the codespace.</p> <p>You may also want to deactivate or delete the API token.</p>"},{"location":"cleanup/#whats-next","title":"What's Next?","text":""},{"location":"getting-started/","title":"2. Getting Started","text":""},{"location":"getting-started/#gather-details-tenant-id","title":"Gather Details: Tenant ID","text":"<p>You will need access to a Dynatrace tenant. If you do not have access, sign up for a free 15 day trial.</p> <p>Make a note of your Dynatrace tenant ID. It is the first bit of your URL (eg. <code>abc12345</code> in the following examples):</p> <pre><code>https://abc12345.live.dynatrace.com\nhttps://abc12345.apps.dynatrace.com\n</code></pre> <p>Reformat the URL like this: <code>https://TENANT_ID.live.dynatrace.com</code> eg. <code>https://abc12345.live.dynatrace.com</code></p>"},{"location":"getting-started/#gather-details-create-api-token","title":"Gather Details: Create API Token","text":"<p>k6 requires an API token to stream metrics to Dynatrace.</p> <p>Create an API token with the following permissions:</p> <ul> <li><code>metrics.ingest</code></li> <li><code>openpipeline.events_sdlc</code></li> </ul>"},{"location":"getting-started/#start-demo","title":"Start Demo","text":"<p>Click this button to launch the demo in a new tab.</p> <p></p>"},{"location":"getting-started/#click-here-to-run-the-demo","title":"Click Here to Run the Demo...","text":""},{"location":"resources/","title":"6. Resources","text":""},{"location":"resources/#resources","title":"Resources","text":"<ul> <li>Sign up for a Dynatrace Trial</li> <li>k6 on Dynatrace Hub</li> <li>Dynatrace xk6 output plugin source code on GitHub</li> <li>This tutorial on GitHub</li> </ul>"},{"location":"run-demo/","title":"3. Run Demo","text":""},{"location":"run-demo/#import-dynatrace-dashboard","title":"Import Dynatrace Dashboard","text":"<p>While you are waiting for the environment, add the dashboard to your Dynatrace environment.</p> <ol> <li>Save the k6 dashboard to your local machine.</li> <li>In Dynatrace, navigate to <code>Dashboards</code> and click <code>Upload</code></li> <li>Upload the dashboard JSON file</li> </ol>"},{"location":"run-demo/#start-k6","title":"Start k6","text":"<p>In the codespace terminal, type <code>docker ps</code> and wait until Docker is running.</p> <p>You should see this:</p> <pre><code>CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES\n</code></pre> <p>Now run k6 with the demo script. Copy and paste this as-is into the terminal window:</p> <pre><code>docker run \\\n -e K6_DYNATRACE_URL=$DT_URL \\\n -e K6_DYNATRACE_APITOKEN=$DT_K6_TOKEN \\\n --mount type=bind,source=./k6scripts,target=/k6scripts hrexed/xk6-dynatrace-output:0.11 run /k6scripts/script.js \\\n -o output-dynatrace\n</code></pre>"},{"location":"run-demo/#validate-metrics","title":"Validate Metrics","text":"<p>k6 streams metrics into Dynatrace so after about a minute, do the following to ensure metrics are reaching Dynatrace.</p> <p>In Dynatrace:</p> <ul> <li>Press <code>ctrl + k</code> and search for <code>notebooks</code></li> <li>Create a new notebook and add a new <code>DQL</code> section</li> <li>Type the following: <code>timeseries avg(k6)</code></li> <li>Press <code>ctrl + =</code> to bring up auto completion. You should see the list of ingest</li> </ul> <p></p>"},{"location":"run-demo/#view-events","title":"View Events","text":"<p>When the load test finished, the teardown function sends a Software Delivery Lifecycle Event (SDLC) to Dynatrace.</p> <pre><code>// Run load with 2 virtual users for 1 minute\nexport const options = {\n vus: 2,\n duration: '1m',\n};\n\n...\n\nexport function teardown() {\n let post_params = {\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': `Api-Token ${__ENV.K6_DYNATRACE_APITOKEN}`\n },\n };\n\n // Send SDLC event at the end of the test\n let payload = {\n \"event.provider\": \"k6\",\n \"event.type\": \"test\",\n \"event.category\": \"finished\",\n \"service\": \"dummyservice\",\n \"duration\": options.duration\n }\n let res = http.post(`${__ENV.K6_DYNATRACE_URL}/platform/ingest/v1/events.sdlc`, JSON.stringify(payload), post_params);\n}\n</code></pre> <p>Notice that the event contains metadata such as the <code>provider</code> and <code>service</code> which can be used for filtering in Dynatrace (see DQL below).</p> <p>This event can be used as a trigger Dynatrace for workflows, synthetic tests, the site reliability guardian and more.</p> <p>In Dynatrace:</p> <ul> <li>Press <code>ctrl + k</code> and search for <code>notebooks</code></li> <li>Open an existing notebook or create a new one</li> <li>Add a new <code>DQL</code> section and paste the following</li> </ul> <pre><code>fetch events\n| filter event.kind == \"SDLC_EVENT\"\n| filter event.provider == \"k6\"\n</code></pre> <p></p> <p>User exercise: Modify the JSON body to also send the number of Virtual Users (VUs) used to Dynatrace. Re-run the load test to see the new event.</p>"},{"location":"run-demo/#view-dashboard","title":"View Dashboard","text":"<p>Open the prebuilt dashboard you previously uploaded.</p> <p>Go to Dashboards (<code>ctrl + k</code> and search for <code>Dashboards</code>)</p> <p>The dashboard will begin to be populated with data.</p> <p></p> <p>The demo is complete.</p>"},{"location":"run-demo/#click-here-to-delete-and-cleanup-resources","title":"Click Here to Delete and Cleanup resources...","text":""},{"location":"whats-next/","title":"5. What's Next?","text":"<p>The k6 listing on the Dynatrace Hub contains information about how to build your own custom k6 binary using <code>xk6</code>.</p> <p>You can also browse the source code of the Dynatrace plugin, get support and request enhancements on the Dynatrace xk6 output plugin on Github.</p> <p>View the resources page for more links and useful materials.</p>"}]}
Binary file modified sitemap.xml.gz
Binary file not shown.

0 comments on commit 0d7f6c0

Please sign in to comment.