Skip to content

Commit

Permalink
Remove transaction breakdown metrics (elastic#115385) (elastic#119148)
Browse files Browse the repository at this point in the history
Co-authored-by: Felix Barnsteiner <[email protected]>
  • Loading branch information
kibanamachine and felixbarny authored Nov 19, 2021
1 parent 06d9ffb commit 75ca7e4
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 101 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion x-pack/plugins/apm/common/elasticsearch_fieldnames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export const TRANSACTION_RESULT = 'transaction.result';
export const TRANSACTION_NAME = 'transaction.name';
export const TRANSACTION_ID = 'transaction.id';
export const TRANSACTION_SAMPLED = 'transaction.sampled';
export const TRANSACTION_BREAKDOWN_COUNT = 'transaction.breakdown.count';
export const TRANSACTION_PAGE_URL = 'transaction.page.url';
// for transaction metrics
export const TRANSACTION_ROOT = 'transaction.root';
Expand Down
22 changes: 0 additions & 22 deletions x-pack/plugins/apm/dev_docs/apm_queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,28 +315,6 @@ GET apm-*-metric-*,metrics-apm*/_search?terminate_after=1000

The above example is overly simplified. In reality [we do a bit more](https://github.com/elastic/kibana/blob/fe9b5332e157fd456f81aecfd4ffa78d9e511a66/x-pack/plugins/apm/server/lib/metrics/by_agent/shared/memory/index.ts#L51-L71) to properly calculate memory usage inside containers. Please note that an [Exists Query](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-exists-query.html) is used in the filter context in the query to ensure that the memory fields exist.



# Transaction breakdown metrics

A pre-aggregations of transaction documents where `transaction.breakdown.count` is the number of original transactions.

Noteworthy fields: `transaction.name`, `transaction.type`

#### Sample document

```json
{
"@timestamp": "2021-09-27T21:59:59.828Z",
"processor.event": "metric",
"metricset.name": "transaction_breakdown",
"transaction.breakdown.count": 12,
"transaction.name": "GET /api/products",
"transaction.type": "request"
}
}
```

# Span breakdown metrics

A pre-aggregations of span documents where `span.self_time.count` is the number of original spans. Measures the "self-time" for a span type, and optional subtype, within a transaction group.
Expand Down
19 changes: 11 additions & 8 deletions x-pack/plugins/apm/ftr_e2e/cypress/tasks/es_archiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,29 @@
* 2.0.
*/

import Path from 'path';
import path from 'path';
import { execSync } from 'child_process';

const ES_ARCHIVE_DIR = './cypress/fixtures/es_archiver';
const ES_ARCHIVE_DIR = path.resolve(
__dirname,
'../../cypress/fixtures/es_archiver'
);

// Otherwise execSync would inject NODE_TLS_REJECT_UNAUTHORIZED=0 and node would abort if used over https
const NODE_TLS_REJECT_UNAUTHORIZED = '1';

export const esArchiverLoad = (folder: string) => {
const path = Path.join(ES_ARCHIVE_DIR, folder);
export const esArchiverLoad = (archiveName: string) => {
const archivePath = path.join(ES_ARCHIVE_DIR, archiveName);
execSync(
`node ../../../../scripts/es_archiver load "${path}" --config ../../../test/functional/config.js`,
`node ../../../../scripts/es_archiver load "${archivePath}" --config ../../../test/functional/config.js`,
{ env: { ...process.env, NODE_TLS_REJECT_UNAUTHORIZED }, stdio: 'inherit' }
);
};

export const esArchiverUnload = (folder: string) => {
const path = Path.join(ES_ARCHIVE_DIR, folder);
export const esArchiverUnload = (archiveName: string) => {
const archivePath = path.join(ES_ARCHIVE_DIR, archiveName);
execSync(
`node ../../../../scripts/es_archiver unload "${path}" --config ../../../test/functional/config.js`,
`node ../../../../scripts/es_archiver unload "${archivePath}" --config ../../../test/functional/config.js`,
{ env: { ...process.env, NODE_TLS_REJECT_UNAUTHORIZED }, stdio: 'inherit' }
);
};
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 1 addition & 15 deletions x-pack/plugins/apm/server/routes/transactions/breakdown/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
SPAN_SELF_TIME_SUM,
TRANSACTION_TYPE,
TRANSACTION_NAME,
TRANSACTION_BREAKDOWN_COUNT,
} from '../../../../common/elasticsearch_fieldnames';
import { Setup } from '../../../lib/helpers/setup_request';
import { rangeQuery, kqlQuery } from '../../../../../observability/server';
Expand Down Expand Up @@ -51,11 +50,6 @@ export async function getTransactionBreakdown({
field: SPAN_SELF_TIME_SUM,
},
},
total_transaction_breakdown_count: {
sum: {
field: TRANSACTION_BREAKDOWN_COUNT,
},
},
types: {
terms: {
field: SPAN_TYPE,
Expand Down Expand Up @@ -92,15 +86,7 @@ export async function getTransactionBreakdown({
...rangeQuery(start, end),
...environmentQuery(environment),
...kqlQuery(kuery),
{
bool: {
should: [
{ exists: { field: SPAN_SELF_TIME_SUM } },
{ exists: { field: TRANSACTION_BREAKDOWN_COUNT } },
],
minimum_should_match: 1,
},
},
{ exists: { field: SPAN_SELF_TIME_SUM } },
];

if (transactionName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ export const TRANSACTION_RESULT = 'transaction.result';
export const TRANSACTION_NAME = 'transaction.name';
export const TRANSACTION_ID = 'transaction.id';
export const TRANSACTION_SAMPLED = 'transaction.sampled';
export const TRANSACTION_BREAKDOWN_COUNT = 'transaction.breakdown.count';
export const TRANSACTION_PAGE_URL = 'transaction.page.url';
// for transaction metrics
export const TRANSACTION_ROOT = 'transaction.root';
Expand Down

0 comments on commit 75ca7e4

Please sign in to comment.