[APM] Synthtrace - Add service.name in metricsetPicker for breakdown metrics (#140256)

* Add service.name in metricsetPicker for breakdown metrics

* Run cypress tests on synthtrace changes
This commit is contained in:
Giorgos Bamparopoulos 2022-09-21 15:38:13 +01:00 committed by GitHub
parent 7be5ac42a0
commit ee4b451ed4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -90,7 +90,7 @@ const uploadPipeline = (pipelineContent: string | object) => {
}
if (
(await doAnyChangesMatch([/^x-pack\/plugins\/apm/])) ||
(await doAnyChangesMatch([/^x-pack\/plugins\/apm/, /^packages\/kbn-apm-synthtrace/])) ||
GITHUB_PR_LABELS.includes('ci:all-cypress-suites')
) {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/apm_cypress.yml'));

View file

@ -105,15 +105,16 @@ export function getBreakdownMetrics(events: ApmFields[]) {
lastMeasurement = timestamp;
}
const instance = pickBy(event, instancePicker);
const key = {
'@timestamp': event['@timestamp']! - (event['@timestamp']! % (30 * 1000)),
'transaction.type': transaction['transaction.type'],
'transaction.name': transaction['transaction.name'],
...pickBy(event, metricsetPicker),
...instance,
};
const instance = pickBy(event, instancePicker);
const metricsetId = objectHash(key);
let metricset = metricsets.get(metricsetId);
@ -121,7 +122,6 @@ export function getBreakdownMetrics(events: ApmFields[]) {
if (!metricset) {
metricset = {
...key,
...instance,
'processor.event': 'metric',
'processor.name': 'metric',
'metricset.name': `span_breakdown`,