Skip to content

Commit

Permalink
Deployed c054b70 with MkDocs version: 1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
agardnerIT committed Sep 18, 2024
1 parent c244ad7 commit d74f51e
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 31 deletions.
4 changes: 2 additions & 2 deletions getting-started/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -517,9 +517,9 @@ <h1>2. Getting Started</h1>
<h2 id="gather-details-tenant-id">Gather Details: Tenant ID<a class="headerlink" href="#gather-details-tenant-id" title="Permanent link">#</a></h2>
<p>You will need access to a Dynatrace tenant. If you do not have access, <a href="https://dt-url.net/trial" target="_blank">sign up for a free 15 day trial</a>.</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
<div class="highlight"><pre><span></span><code>https://abc12345.live.dynatrace.com
https://abc12345.apps.dynatrace.com
</code></pre>
</code></pre></div>
<p>Reformat the URL like this: <code>https://TENANT_ID.live.dynatrace.com</code> eg. <code>https://abc12345.live.dynatrace.com</code></p>
<h2 id="gather-details-create-api-token">Gather Details: Create API Token<a class="headerlink" href="#gather-details-create-api-token" title="Permanent link">#</a></h2>
<p>k6 requires an API token to stream metrics to Dynatrace.</p>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/load-test-integration-flow.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 6 additions & 17 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -499,10 +499,15 @@ <h1>1. About</h1>
<h2 id="logical-architecture">Logical Architecture<a class="headerlink" href="#logical-architecture" title="Permanent link">#</a></h2>
<p>Below is the "flow" of information and actors during this demo.</p>
<p>This architecture also holds true for other load testing tools (eg. JMeter).</p>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>This can (and should be) extended as demonstrated in the <a href="https://dt-url.net/obslab-release-validation" target="_blank">release validation Observability Lab</a>)
to include the ability to trigger automated deployment checks.</p>
</div>
<ol>
<li>
<p>A load test is executed.
The HTTP requests are annotated with <a href="https://docs.dynatrace.com/docs/platform-modules/automations/cloud-automation/test-automation#tag-tests-with-http-headers">the standard header values</a>(target=_blank).</p>
The HTTP requests are annotated with <a href="https://docs.dynatrace.com/docs/platform-modules/automations/cloud-automation/test-automation#tag-tests-with-http-headers" target="_blank">the standard header values</a>.</p>
</li>
<li>
<p>Metrics are streamed during the load test (if the load testing tool supports this)
Expand All @@ -513,22 +518,6 @@ <h2 id="logical-architecture">Logical Architecture<a class="headerlink" href="#l
Integrators are responsible for crafting this event to contain any important information required by Dynatrace
such as the test duration.</p>
</li>
<li>
<p>A <a href="https://docs.dynatrace.com/docs/platform-modules/automations/workflows" target="_blank">workflow</a> is triggered on receipt of this event.
The workflow triggers the <a href="https://docs.dynatrace.com/docs/platform-modules/automations/site-reliability-guardian" target="_blank">Site Reliability Guardian</a>.</p>
</li>
<li>
<p>The Site Reliability Guardian processes the load testing metrics and to provide an automated load testing report.
This can be used for information only or can be used as an automated "go / no go" decision point.</p>
</li>
<li>
<p>Dynatrace users can view the results in a dashboard, notebook or use the result as a trigger for further automated workflows.</p>
</li>
<li>
<p>Integrators have the choice to send (emit) the results to an external tool.
This external tool can then use this result.
One example would be sending the SRG result to Jenkins to progress or prevent a deployment.</p>
</li>
</ol>
<p><img alt="Logical Architecture" src="images/load-test-integration-flow.jpg" /></p>
<h2 id="compatibility">Compatibility<a class="headerlink" href="#compatibility" title="Permanent link">#</a></h2>
Expand Down
22 changes: 11 additions & 11 deletions run-demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -560,15 +560,15 @@ <h2 id="import-dynatrace-dashboard">Import Dynatrace Dashboard<a class="headerli
<h2 id="start-k6">Start k6<a class="headerlink" href="#start-k6" title="Permanent link">#</a></h2>
<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
</code></pre>
<div class="highlight"><pre><span></span><code>CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
</code></pre></div>
<p>Now run k6 with the demo script. Copy and paste this as-is into the terminal window:</p>
<pre><code>docker run \
<div class="highlight"><pre><span></span><code>docker run \
-e K6_DYNATRACE_URL=$DT_URL \
-e K6_DYNATRACE_APITOKEN=$DT_K6_TOKEN \
--mount type=bind,source=./k6scripts,target=/k6scripts hrexed/xk6-dynatrace-output:0.11 run /k6scripts/script.js \
-o output-dynatrace
</code></pre>
</code></pre></div>
<h2 id="validate-metrics">Validate Metrics<a class="headerlink" href="#validate-metrics" title="Permanent link">#</a></h2>
<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>
Expand All @@ -581,19 +581,19 @@ <h2 id="validate-metrics">Validate Metrics<a class="headerlink" href="#validate-
<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
<div class="highlight"><pre><span></span><code>// Run load with 2 virtual users for 1 minute
export const options = {
vus: 2,
duration: '1m',
duration: &#39;1m&#39;,
};

...

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

Expand All @@ -607,7 +607,7 @@ <h2 id="view-events">View Events<a class="headerlink" href="#view-events" title=
}
let res = http.post(`${__ENV.K6_DYNATRACE_URL}/platform/ingest/v1/events.sdlc`, JSON.stringify(payload), post_params);
}
</code></pre>
</code></pre></div>
<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>
Expand All @@ -616,10 +616,10 @@ <h2 id="view-events">View Events<a class="headerlink" href="#view-events" title=
<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
<div class="highlight"><pre><span></span><code>fetch events
| filter event.kind == &quot;SDLC_EVENT&quot;
| filter event.provider == &quot;k6&quot;
</code></pre>
</code></pre></div>
<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>
Expand Down
Loading

0 comments on commit d74f51e

Please sign in to comment.