-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
examples/tracetest-azure-app-insights-collector/Dockerfile.tracetest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM alpine | ||
|
||
WORKDIR /app | ||
ARG TRACETEST_IMAGE_VERSION=v1.4.0 | ||
|
||
RUN apk --update add bash jq curl | ||
RUN curl -L https://raw.githubusercontent.com/kubeshop/tracetest/main/install-cli.sh | bash -s -- $TRACETEST_IMAGE_VERSION | ||
|
||
WORKDIR /resources | ||
|
||
ENTRYPOINT ["echo", "Tracetest CLI installed"] |
20 changes: 20 additions & 0 deletions
20
examples/tracetest-azure-app-insights-collector/resources/apply.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
TOKEN=$TRACETEST_TOKEN | ||
ENVIRONMENT_ID=$TRACETEST_ENVIRONMENT_ID | ||
ARM_ID=$APP_INSIGHTS_ARM_ID | ||
ACCESS_TOKEN=$APP_INSIGHTS_ACCESS_TOKEN | ||
|
||
apply() { | ||
echo "Configuring TraceTest" | ||
tracetest configure --token $TOKEN --environment $ENVIRONMENT_ID | ||
|
||
echo "Applying Resources" | ||
tracetest apply datastore -f /resources/datastore.yaml | ||
tracetest apply pollingprofile -f /resources/pollingprofile.yaml | ||
tracetest apply test -f /resources/test.yaml | ||
} | ||
|
||
apply |
9 changes: 9 additions & 0 deletions
9
examples/tracetest-azure-app-insights-collector/resources/datastore.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
type: DataStore | ||
spec: | ||
id: current | ||
name: azureappinsights | ||
type: azureappinsights | ||
azureappinsights: | ||
connectionType: collector | ||
useAzureActiveDirectoryAuth: false |
9 changes: 9 additions & 0 deletions
9
examples/tracetest-azure-app-insights-collector/resources/pollingprofile.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
type: PollingProfile | ||
spec: | ||
id: azure | ||
name: azure | ||
strategy: periodic | ||
periodic: | ||
retryDelay: 4s | ||
timeout: 10m |
16 changes: 16 additions & 0 deletions
16
examples/tracetest-azure-app-insights-collector/resources/run.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
TOKEN=$TRACETEST_TOKEN | ||
ENVIRONMENT_ID=$TRACETEST_ENVIRONMENT_ID | ||
|
||
run() { | ||
echo "Configuring Tracetest" | ||
tracetest configure --token $TOKEN --environment $ENVIRONMENT_ID | ||
|
||
echo "Running Trace-Based Tests..." | ||
tracetest run test -f /resources/test.yaml | ||
} | ||
|
||
run |
18 changes: 18 additions & 0 deletions
18
examples/tracetest-azure-app-insights-collector/resources/test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
type: Test | ||
spec: | ||
id: W656Q0c4g | ||
name: Test API | ||
description: Test the App. | ||
trigger: | ||
type: http | ||
httpRequest: | ||
method: GET | ||
url: http://app:8080 | ||
headers: | ||
- key: Content-Type | ||
value: application/json | ||
specs: | ||
- selector: span[tracetest.span.type="http" name="GET /"] | ||
assertions: | ||
- attr:http.status_code = 200 | ||
- attr:tracetest.span.duration < 500ms |