Hello,
I try to add labels to my monitors using the project setting monitor.fields in synthetics.config.ts file.
When i push all my monitors, labels are added only to lightweight monitors.
Let's check my setup below.
An other question about tags. I would like to create tags at project level to apply to all my monitors but i need also to add specific tags for each monitor.
Finally after pushing journeys with Elastic CLI i realise list of tags added inside each monitor fully overwrite tags declared at project level in synthetics.config.ts file.
Here is my setup :
synthetics.config.ts
import type { SyntheticsConfig } from '@elastic/synthetics';
export default env => {
const config: SyntheticsConfig = {
params: {
url: 'https://www.elastic.co',
},
playwrightOptions: {
ignoreHTTPSErrors: false,
locale: 'fr-FR'
},
/**
* Configure global monitor settings
*/
monitor: {
schedule: 20,
locations: [],
privateLocations: ['synthetics-agent-demo'],
tags: [ 'demo1', 'demo2' ],
fields: { 'label1' : 'value1' },
},
/**
* Project monitors settings
*/
project: {
id: 'my_awesome_project-new',
url: 'http://kibana-demo/',
space: 'default',
},
};
if (env !== 'development') {
/**
* Override configuration specific to environment
* For example, config.params.url = ""
*/
}
return config;
};
And the related journey:
import { journey, step, monitor, expect } from '@elastic/synthetics';
journey('Monitor demo', ({ page, params }) => {
monitor.use({
id: 'demo-journey',
tags: ["prd"],
});
step('Step 1 - Monitor sample - Load the demo page', async () => {
await page.goto(params.url);
});
});
Using this setup
- i get only one tag in this case "prd" (same for browser or lightweight monitors)
- i don't get any fields/labels (only for browser monitor)
How to make fields/labels work with browser monitor ?
Is there any way to merge tags from project and journey ?
Thank you