mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[Synthetics] Fix service name usage from project monitors !! (#212229)
## Summary In support of https://github.com/elastic/synthetics/pull/974 Fix service name usage from project monitors !! <img width="1728" alt="image" src="https://github.com/user-attachments/assets/cb88cb9c-f4a2-41e9-a869-96c25d14ec67" />
This commit is contained in:
parent
5f05349930
commit
40dd061823
3 changed files with 8 additions and 3 deletions
|
@ -63,6 +63,7 @@ export const ProjectMonitorCodec = t.intersection([
|
|||
namespace: t.string,
|
||||
retestOnFailure: t.boolean,
|
||||
fields: t.record(t.string, t.string),
|
||||
'service.name': t.string,
|
||||
}),
|
||||
]);
|
||||
|
||||
|
|
|
@ -73,6 +73,7 @@ describe('browser normalizers', () => {
|
|||
tags: ['tag1', 'tag2'],
|
||||
ignoreHTTPSErrors: true,
|
||||
hash: testHash,
|
||||
'service.name': 'test-service',
|
||||
} as ProjectMonitor, // test that normalizers defaults to browser when type is omitted
|
||||
{
|
||||
type: MonitorTypeEnum.BROWSER,
|
||||
|
@ -144,7 +145,7 @@ describe('browser normalizers', () => {
|
|||
unit: 'm',
|
||||
},
|
||||
screenshots: 'off',
|
||||
'service.name': '',
|
||||
'service.name': 'test-service',
|
||||
'source.project.content': 'test content 1',
|
||||
tags: ['tag1', 'tag2'],
|
||||
params: '',
|
||||
|
@ -328,7 +329,7 @@ describe('browser normalizers', () => {
|
|||
unit: 'm',
|
||||
},
|
||||
screenshots: 'off',
|
||||
'service.name': '',
|
||||
'service.name': 'test-service',
|
||||
'source.project.content': 'test content 1',
|
||||
tags: ['tag1', 'tag2'],
|
||||
params: '',
|
||||
|
@ -398,7 +399,7 @@ describe('browser normalizers', () => {
|
|||
unit: 'm',
|
||||
},
|
||||
screenshots: 'off',
|
||||
'service.name': '',
|
||||
'service.name': 'test-service',
|
||||
'source.project.content': 'test content 1',
|
||||
tags: ['tag1', 'tag2'],
|
||||
params: '',
|
||||
|
|
|
@ -96,6 +96,9 @@ export const getNormalizeCommonFields = ({
|
|||
// picking out keys specifically, so users can't add arbitrary fields
|
||||
[ConfigKey.ALERT_CONFIG]: getAlertConfig(monitor),
|
||||
[ConfigKey.LABELS]: monitor.fields || defaultFields[ConfigKey.LABELS],
|
||||
...(monitor[ConfigKey.APM_SERVICE_NAME] && {
|
||||
[ConfigKey.APM_SERVICE_NAME]: monitor[ConfigKey.APM_SERVICE_NAME],
|
||||
}),
|
||||
};
|
||||
return { normalizedFields, errors };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue