Skip to content

Commit

Permalink
[APM] Synthtrace - Add service.name in metricsetPicker for breakdown …
Browse files Browse the repository at this point in the history
…metrics (#140256)

* Add service.name in metricsetPicker for breakdown metrics

* Run cypress tests on synthtrace changes
  • Loading branch information
gbamparop authored Sep 21, 2022
1 parent 7be5ac4 commit ee4b451
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .buildkite/scripts/pipelines/pull_request/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,23 +105,23 @@ 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);

if (!metricset) {
metricset = {
...key,
...instance,
'processor.event': 'metric',
'processor.name': 'metric',
'metricset.name': `span_breakdown`,
Expand Down

0 comments on commit ee4b451

Please sign in to comment.