-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(monitors): add monitors docs (#3921)
* docs(monitors): add monitors docs * Update docs/docs/web-ui/creating-monitors.mdx Co-authored-by: Julianne Fermi <[email protected]> * Update docs/docs/concepts/monitors.mdx Co-authored-by: Julianne Fermi <[email protected]> * Update docs/docs/concepts/monitors.mdx Co-authored-by: Julianne Fermi <[email protected]> * Update docs/docs/web-ui/creating-monitors.mdx Co-authored-by: Julianne Fermi <[email protected]> * Update docs/docs/web-ui/creating-monitors.mdx Co-authored-by: Julianne Fermi <[email protected]> --------- Co-authored-by: Julianne Fermi <[email protected]>
- Loading branch information
Showing
4 changed files
with
194 additions
and
0 deletions.
There are no files selected for viewing
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,73 @@ | ||
--- | ||
id: configuring-monitors | ||
title: Defining Monitors as Text Files | ||
description: Create and edit Monitors with the CLI. Just like other structures of Tracetest, you can also manage your Monitors using the CLI and definition files. | ||
keywords: | ||
- tracetest | ||
- trace-based testing | ||
- observability | ||
- distributed tracing | ||
- testing | ||
- monitoring | ||
- monitor | ||
- synthetic monitoring | ||
- synthetic testing | ||
image: https://res.cloudinary.com/djwdcmwdz/image/upload/v1698686403/docs/Blog_Thumbnail_14_rsvkmo.jpg | ||
--- | ||
|
||
This page showcases how to create and edit Monitors with the CLI. | ||
|
||
:::tip | ||
[To read more about Monitors, check out the Monitors concepts page.](/concepts/monitors) | ||
::: | ||
|
||
Just like other structures of Tracetest, you can also manage your Monitors using the CLI and definition files. | ||
|
||
A definition file for a Monitor looks like the following: | ||
|
||
```yaml | ||
type: Monitor | ||
spec: | ||
id: "abcdef" # optional | ||
name: Sample Monitor | ||
enabled: true | ||
variableSetId: "" | ||
tests: | ||
- ./tests/create-product.yaml | ||
- ./tests/add-product-to-cart.yaml | ||
- ./tests/complete-purchase.yaml | ||
- testID # you can also reference tests by their ids instead of referencing the definition file | ||
testSuites: | ||
- ./tests/create-product-suite.yaml | ||
- testSuiteID # you can also reference tests by their ids instead of referencing the definition file | ||
schedule: | ||
cron: "0 0 0 0 *" | ||
alerts: | ||
id: "" | ||
type: webhook | ||
webhook: | ||
url: https://... | ||
method: POST | ||
body: '{"text": "Monitor {{ .Monitor.name }} failed."}' | ||
events: | ||
- FAILED | ||
``` | ||
In order to apply this Monitor to your Tracetest instance, make sure to have your [CLI configured](/cli/configuring-your-cli) and run: | ||
```sh | ||
tracetest apply monitor -f <monitor.yaml> | ||
``` | ||
|
||
> If the file contains the property `spec.id`, the operation will be considered a Monitor update. | ||
To return a list of Monitors, run: | ||
|
||
```sh | ||
tracetest list monitor | ||
|
||
[Output] | ||
ID NAME VERSION RUNS LAST RUN TIME LAST RUN STATE URL | ||
----------- ---------------- --------- ------ --------------------- ---------------- -------------------------------------------- | ||
123456789 Sample Monitor 1 120 2024-06-27 13:00:01 https://api.tracetest.io/monitor/123456789 | ||
``` |
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,51 @@ | ||
--- | ||
id: monitors | ||
title: Monitors | ||
description: Tracetest has Monitors to execute multiple tests and test suites as a group and alert you if they fail. | ||
keywords: | ||
- tracetest | ||
- trace-based testing | ||
- observability | ||
- distributed tracing | ||
- testing | ||
- monitoring | ||
- monitor | ||
- synthetic monitoring | ||
- synthetic testing | ||
image: https://res.cloudinary.com/djwdcmwdz/image/upload/v1698686403/docs/Blog_Thumbnail_14_rsvkmo.jpg | ||
--- | ||
|
||
:::tip Commercial Feature | ||
[Feature available only in Cloud-based Managed Tracetest & Enterprise Self-hosted Tracetest.](https://tracetest.io/pricing) | ||
::: | ||
|
||
Tracetest Monitors is a framework for creating scheduled runs of tests and test suites and getting alerted when they fail. With native support for webhooks, you can choose how to integrate with your favorite alerting tools! | ||
|
||
## What is a Monitor? | ||
|
||
A Tracetest Monitor groups multiple tests and test suites to run as a group and alert you if they fail. Monitors give you the easiest way of automating test runs without needing external CI tools. | ||
|
||
![](https://res.cloudinary.com/djwdcmwdz/image/upload/v1719399627/Blogposts/Tracetest-Monitors-Trace-based-testing-meets-Synthetic-Monitoring/app-stage.tracetest.io_organizations_ttorg_bbf2def23aec248a_environments_ttenv_ee3687f0d89536d7_monitor_8zfKNkQSR_run_353_overview_3_tly95w.png) | ||
|
||
## Alerts | ||
|
||
With native support for webhooks, you can choose how to integrate with your favorite alerting tools! | ||
|
||
![](https://res.cloudinary.com/djwdcmwdz/image/upload/v1719399653/Blogposts/Tracetest-Monitors-Trace-based-testing-meets-Synthetic-Monitoring/app-stage.tracetest.io_organizations_ttorg_bbf2def23aec248a_environments_ttenv_ee3687f0d89536d7_monitor_8zfKNkQSR_run_353_overview_2_1_jqtuet.png) | ||
|
||
## Running a Monitor | ||
|
||
Create a Monitor to run tests and test suites on a schedule. Select from a few presets or use a cron expression. Get alerted via webhooks by integrating with your favorite alerting tools. | ||
|
||
![create monitor modal](https://res.cloudinary.com/djwdcmwdz/image/upload/v1719399711/Blogposts/Tracetest-Monitors-Trace-based-testing-meets-Synthetic-Monitoring/app-stage.tracetest.io_organizations_ttorg_bbf2def23aec248a_environments_ttenv_ee3687f0d89536d7_test_pokeshop-demo-import-pokemon-queue_run_277_automate_2_1_w3mwtw.png) | ||
|
||
Monitors leverage the existing [Runs](/concepts/runs) and [Run Groups](/concepts/run-groups) resources in Tracetest and build on top of it by enabling scheduling and alerting. | ||
|
||
Every Monitor you define will be presented as a Run Group with an additional tag using the specific name of the `Monitor`. Here you can see a list of Run Groups that include two Run Groups labeled as a `Monitor`. | ||
|
||
![run groups with monitor labels](https://res.cloudinary.com/djwdcmwdz/image/upload/v1719399770/Blogposts/Tracetest-Monitors-Trace-based-testing-meets-Synthetic-Monitoring/app-stage.tracetest.io_organizations_ttorg_bbf2def23aec248a_environments_ttenv_ee3687f0d89536d7_runs_page_1_name_startDate_endDate_monitorName_Pokeshop_20Monitor_1_1_aspntd.png) | ||
|
||
Filtering Runs by the `Monitor` tag is also available in the Runs view. | ||
|
||
![filter runs by monitor name tag](https://res.cloudinary.com/djwdcmwdz/image/upload/v1719399825/Blogposts/Tracetest-Monitors-Trace-based-testing-meets-Synthetic-Monitoring/app-stage.tracetest.io_organizations_ttorg_bbf2def23aec248a_environments_ttenv_ee3687f0d89536d7_runs_page_1_name_startDate_endDate_monitorName_Pokeshop_20Monitor_3_qhdltm.png) | ||
|
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,55 @@ | ||
--- | ||
id: creating-monitors | ||
title: Creating Monitors | ||
description: Tracetest enables creating monitors visually in the Tracetest Web UI. | ||
hide_table_of_contents: false | ||
keywords: | ||
- tracetest | ||
- trace-based testing | ||
- observability | ||
- distributed tracing | ||
- testing | ||
- monitoring | ||
- monitor | ||
- synthetic monitoring | ||
- synthetic testing | ||
image: https://res.cloudinary.com/djwdcmwdz/image/upload/v1698686403/docs/Blog_Thumbnail_14_rsvkmo.jpg | ||
--- | ||
|
||
👉 **Join our [shared Pokeshop API Demo environment](https://app.tracetest.io/organizations/ttorg_2179a9cd8ba8dfa5/invites/a3SW5oQIg/accept) and try creating a Monitor yourself!** | ||
|
||
This page showcases how to create and edit Monitors in the Web UI. | ||
|
||
:::tip | ||
[To read more about Monitors, check out the Monitors concepts page.](/concepts/monitors) | ||
::: | ||
|
||
Select **Monitors** in the left menu and then click the **Create** button to create a new Monitor: | ||
|
||
![all monitors](https://res.cloudinary.com/djwdcmwdz/image/upload/v1719399745/Blogposts/Tracetest-Monitors-Trace-based-testing-meets-Synthetic-Monitoring/app-stage.tracetest.io_organizations_ttorg_bbf2def23aec248a_environments_ttenv_ee3687f0d89536d7_test_pokeshop-demo-import-pokemon-queue_run_277_automate_1_1_mbr5b4.png) | ||
|
||
Give your Monitor a name, select a schedule, enable the monitor, and click on the Tests tab. | ||
|
||
![create monitor modal](https://res.cloudinary.com/djwdcmwdz/image/upload/v1719399711/Blogposts/Tracetest-Monitors-Trace-based-testing-meets-Synthetic-Monitoring/app-stage.tracetest.io_organizations_ttorg_bbf2def23aec248a_environments_ttenv_ee3687f0d89536d7_test_pokeshop-demo-import-pokemon-queue_run_277_automate_2_1_w3mwtw.png) | ||
|
||
Next, select which tests to run in the Monitor and click on the Test Suites tab. | ||
|
||
![Select Tests in Monitor](https://res.cloudinary.com/djwdcmwdz/image/upload/v1719492866/Blogposts/Tracetest-Monitors-Trace-based-testing-meets-Synthetic-Monitoring/app.tracetest.io_organizations_ttorg_2179a9cd8ba8dfa5_environments_ttenv_231b49e808c29e6a_monitors_page_1_o2pddt.png) | ||
|
||
Next, select which test suites to run in the Monitor and click on the Alerts tab. | ||
|
||
![Select Test Suites in Monitor](https://res.cloudinary.com/djwdcmwdz/image/upload/v1719492865/Blogposts/Tracetest-Monitors-Trace-based-testing-meets-Synthetic-Monitoring/app.tracetest.io_organizations_ttorg_2179a9cd8ba8dfa5_environments_ttenv_231b49e808c29e6a_monitors_page_1_1_cfsker.png) | ||
|
||
On the Alerts tab, configure sending a webhook alert and click "Create". | ||
|
||
![Alerts Tab](https://res.cloudinary.com/djwdcmwdz/image/upload/v1719492867/Blogposts/Tracetest-Monitors-Trace-based-testing-meets-Synthetic-Monitoring/app.tracetest.io_organizations_ttorg_2179a9cd8ba8dfa5_environments_ttenv_231b49e808c29e6a_monitors_page_1_2_v55ws4.png) | ||
|
||
The Monitor will run, and you will get the following result. | ||
|
||
![Edit Monitor](https://res.cloudinary.com/djwdcmwdz/image/upload/v1719399627/Blogposts/Tracetest-Monitors-Trace-based-testing-meets-Synthetic-Monitoring/app-stage.tracetest.io_organizations_ttorg_bbf2def23aec248a_environments_ttenv_ee3687f0d89536d7_monitor_8zfKNkQSR_run_353_overview_3_tly95w.png) | ||
|
||
You can now view all Monitor runs in the Runs and Run Groups tab. They're labeled `Monitor` and can be filtered by the Monitor's name. | ||
|
||
![filter runs by monitor name tag](https://res.cloudinary.com/djwdcmwdz/image/upload/v1719399825/Blogposts/Tracetest-Monitors-Trace-based-testing-meets-Synthetic-Monitoring/app-stage.tracetest.io_organizations_ttorg_bbf2def23aec248a_environments_ttenv_ee3687f0d89536d7_runs_page_1_name_startDate_endDate_monitorName_Pokeshop_20Monitor_3_qhdltm.png) | ||
|
||
👉 **Join our [shared Pokeshop API Demo environment](https://app.tracetest.io/organizations/ttorg_2179a9cd8ba8dfa5/invites/a3SW5oQIg/accept) and try creating a Monitor yourself!** |
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