Synthetic Monitoring with Real Browsers
MIT License
Bot releases are hidden (Show)
Published by vigneshshanmugam about 1 year ago
devices
directly from the @elastic/synthetics
inside their journeys instead of importing from @playwright-core
which might not work as expected when running project monitors #810
// synthetics.config.ts
import { devices } from "@elastic/synthetics"
export default {
playwrightOptions: {
...devices['Galaxy S9+'],
},
}
--no-headless
flag options #813116.0.5845.82
- #816journey
files which will update the monitors correctly #802Url
and Auth
flags has been made optional for locations
command, Its only required if users are interested in listing their privateLocations #814Full Changelog: https://github.com/elastic/synthetics/compare/v1.3.0...v1.4.0
Published by vigneshshanmugam over 1 year ago
Tags
and Match
CLI flags have been removed when using the npx @elastic/synthetics push
command since we never intended project monitors to have support for filtering when pushed to Synthetics Kibana app.The main intention of Push command
at any synthetics project was to deploy the current state of the monitors to our globally managed infrastructure. Any time we detect a change, whether its an Create or update/delete, the monitor status will get updated based on those changes. Having the ability to allow filtering during the deploy works against the model and brings in more problems. With that said, there are other ways to manage the synthetics monitors.
project-a/synthetics.config.ts
and project-b/synthetics.config.ts
would have their own Kibana settings. npx @elastic/synthetics push --space <name>
NOTE: Tags and Match for filtering are still supported when running the tests locally as we want the Synthetics runner to have the ability to grep and run any journey/tests.
Monitor tags can be configured for all project based lightweight and browser monitors either via the synthetics.config.ts
file or using the monitor.use
API.
{
monitor: {
tags: ["global1", "global2"]
},
};
For Individual browser monitors we can use monitor.use(tags: ["local"])
or for lightweight monitors on the yml file.
heartbeat.monitors:
- type: http
tags:
- tag1
- tag2
Users can enable TLS and Status alerts for Project based lightweight and browser monitors. Alerts can be configured both globally via synthetics.config.ts
file or on individual monitors #785 #795
{
monitor: {
alert: {
status: {
enabled: true,
}
},
},
};
For lightweight monitors, it can be configured via the yml syntax.
alert.status.enabled: true
alert.tls.enabled: false
Full Changelog: https://github.com/elastic/synthetics/compare/v1.2.0...v1.3.0
Published by vigneshshanmugam over 1 year ago
1.35.0
which updates the Chromium browser to 115.0.5790.13
warn and errors
are captured automatically for all iframes, popups etc which was missing previously. Console events in general are reported only reported when the synthetic tests fail #784Full Changelog: https://github.com/elastic/synthetics/compare/v1.1.0...v1.2.0
Published by vigneshshanmugam over 1 year ago
kibana version >= 8.8.0
#725init
command #771Full Changelog: https://github.com/elastic/synthetics/compare/v1.0.0...v1.1.0
Published by vigneshshanmugam over 1 year ago
--pattern
, --tags
, --match
flags same as their browser journey counterparts #761Full Changelog: https://github.com/elastic/synthetics/compare/v1.0.0-beta.46...v1.0.0
Published by vigneshshanmugam over 1 year ago
Full Changelog: https://github.com/elastic/synthetics/compare/v1.0.0-beta.45...v1.0.0-beta.46
Published by vigneshshanmugam over 1 year ago
navigationTimeout
and actionTimeout
via PlaywrightOptions
configuration https://github.com/elastic/synthetics/pull/742
playwrightOptions: {
navigationTimeout: 60000, // 60 seconds
actionTimeout: 10000 // 10 seconds
}
Existing synthetics journeys that have a explicit timeout on the locator and other playwright API's will not be affected.
await page.goto("url", { timeout: 1000}) // not affected
await page.locator(".test", {timeout: 1000}) // not affected
load
or other events https://github.com/elastic/synthetics/pull/747
Full Changelog: https://github.com/elastic/synthetics/compare/v1.0.0-beta.44...v1.0.0-beta.45
Published by vigneshshanmugam over 1 year ago
push command
#724push
command #732Note: Playwright version is upgraded to v1.32.3
Full Changelog: https://github.com/elastic/synthetics/compare/v1.0.0-beta.43...v1.0.0-beta.44
Published by vigneshshanmugam over 1 year ago
Full Changelog: https://github.com/elastic/synthetics/compare/v1.0.0-beta.42...v1.0.0-beta.43
Published by vigneshshanmugam over 1 year ago
Full Changelog: https://github.com/elastic/synthetics/compare/v1.0.0-beta.41...v1.0.0-beta.42
Published by vigneshshanmugam over 1 year ago
data-test-id
via PlaywrightOptions
, this would help in the tests for locating the element via the custom attributes via page.getByTestId #7061.31.1
heartbeat.monitors
to lightweight scaffolding template #696--pattern
option when help command is run #710Full Changelog: https://github.com/elastic/synthetics/compare/v1.0.0-beta.40...v1.0.0-beta.41
Published by vigneshshanmugam almost 2 years ago
ts-node
to esbuild
for transforming the TypeScript
files at runtime. This includes journeys, synthetics config files which are .ts
extensions and transform the files at runtime along with full source-map support. One of the advantage this provides is the ability to use the same esbuild
API for both transpiling and bundling of the monitors #687Synthetics config
or by setting throttling: false
#690init
command is called multiple times inside a Synthetics project #688Full Changelog: https://github.com/elastic/synthetics/compare/v1.0.0-beta.39...v1.0.0-beta.40
Published by vigneshshanmugam almost 2 years ago
init
command #650init
command #658Full Changelog: https://github.com/elastic/synthetics/compare/v1.0.0-beta.38...v1.0.0-beta.39
Published by vigneshshanmugam almost 2 years ago
Improve the validation of project monitor schedule
for both browser and lightweight monitors. Error would be thrown if users would configure monitor schedule that are not supported. For lightweight monitors, we would save the schedule to the nearest supported schedule frequency #622
Current allowed schedule values are 1, 3, 5, 10, 15, 30, 60 minutes respectively.
Improve the push command experience by showing the monitor management URL link once the push has been completed successfully #637
Playwright version has been updated to 1.27.1
Full Changelog: https://github.com/elastic/synthetics/compare/v1.0.0-beta.37...v1.0.0-beta.38
Published by vigneshshanmugam about 2 years ago
Full Changelog: https://github.com/elastic/synthetics/compare/v1.0.0-beta.36...v1.0.0-beta.37
Published by vigneshshanmugam about 2 years ago
In addition to pushing Project based browser monitors to Monitor management UI, the agent now supports pushing existing lightweight monitors directly from the heartbeat.yml
files #542. Users can directly import the existing heartbeat.yml
files in to their Synthetics project and configure the required project settings (Kibana host, auth key, locations, etc.) and run the push
command.
npx @elastic/synthetics init <dir-name>
and configure the project related settings.heartbeat.yml
files in to the synthetics project directory. Example // heartbeat.yml example
- type: http
enabled: true
id: my-monitor
name: My Monitor
urls: ["http://localhost:9200"]
schedule: @every 10m
locations: ["singapore"]
private_locations: ["private-1"]
timeout: 16s
schedule
, locations
and private locations
for specific monitors. Otherwise the defaults would be picked from synthetics.config.ts
files.SYNTHETICS_API_KEY=<key> npm run push
1.26.0
, this means the tests will be run on Google Chrome/106.0.5249.30
.Full Changelog: https://github.com/elastic/synthetics/compare/v1.0.0-beta.35...v1.0.0-beta.36
Published by vigneshshanmugam about 2 years ago
--yes
or -y
flag #602
SYNTHETICS_API_KEY="key" npx @ealstic/synthetics push --yes
Full Changelog: https://github.com/elastic/synthetics/compare/v1.0.0-beta.34...v1.0.0-beta.35
Published by vigneshshanmugam about 2 years ago
Synthetics push command now supports bundling external packages from node_modules
folder for browser monitors, users can now use external packages utility packages like lodash, moment.js, etc,
in their synthetics scripts and push them instantaneously to Kibana. https://github.com/elastic/synthetics/pull/580
Example journey code below using an external package is-positive
from NPM.
// test.journey.ts
import { journey, step, monitor, expect } from '@elastic/synthetics';
import isPositive from 'is-positive';
journey('bundle test', ({ page, params }) => {
step('check if positive', () => {
expect(isPositive(4)).toBe(true);
});
});
If you run npm run push
inside the synthetics project, we would bundle the whole journey file along with the package is-positive
to make the experience smooth. However, there are a few caveats when pushing external modules.
800 Kilobytes
.Introduce configuring project monitor settings in the Synthetics config file https://github.com/elastic/synthetics/pull/592. Comes in handy when running push
command, users would be able to configure project-related settings like projectId
, kibana host
, and schedule
and save them for successive runs.
Support the SYNTHETICS_API_KEY
env variable for Kibana authentication when pushing monitors to Kibana https://github.com/elastic/synthetics/pull/588
Full Changelog: https://github.com/elastic/synthetics/compare/v1.0.0-beta.33...v1.0.0-beta.34
Published by vigneshshanmugam about 2 years ago
Full Changelog: https://github.com/elastic/synthetics/compare/v1.0.0-beta.32...v1.0.0-beta.33