Open
Description
To enhance the capability of our GitOps Project Monitors offering it would be great if we could specify connectors on a per-monitor basis rather than all using the default connector.
Use Case
I have a customer who would like to offer service monitoring as a service enabled by customers making pull requests to a centralised repo. Each customer would want unique connectors, for example a group email for that customers team.
A basic implementation could look something like this.
import { journey, step, monitor, expect } from '@elastic/synthetics';
journey('www.example.com', ({ page, params }) => {
// Only relevant for the push command to create
// monitors in Kibana
monitor.use({
id: 'https://www.example.com/',
schedule: 5,
connector: "slack-dev-channel",
});
step('Go to https://www.example.com/', async () => {
await page.goto('https://www.example.com/');
});
});
To add more CI/CD functionality, customers could even specify an email address if connector type is SMTP, something like this:
import { journey, step, monitor, expect } from '@elastic/synthetics';
journey('www.example.com', ({ page, params }) => {
// Only relevant for the push command to create
// monitors in Kibana
monitor.use({
id: 'https://www.example.com/',
schedule: 5,
connector: "Elastic-Cloud-SMTP",
emailTo: "joe.blogs@example.com",
});
step('Go to https://www.example.com/', async () => {
await page.goto('https://www.example.com/');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
No labels