Skip to content

Commit

Permalink
[APM] Transaction group agg size config (elastic#26683)
Browse files Browse the repository at this point in the history
* [APM] Fixes elastic#24204 by adding default configs to kibana.yml

* [APM] fixes elastic#25940 by adding APM config to control top transation group agg size

* Revert the default configs added to kibana.yml and define joi validations for `xpack.apm.ui.transactionGroupBucketSize`

* fix broken test for incorrect config

* [APM] add docs entry for `xpack.apm.ui.transactionGroupBucketSize`
  • Loading branch information
ogupte committed Dec 8, 2018
1 parent d6c920d commit 8c09455
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docs/settings/apm-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ xpack.apm.enabled:: Set to `false` to disabled the APM plugin {kib}. Defaults to
xpack.apm.ui.enabled:: Set to `false` to hide the APM plugin {kib} from the menu. Defaults to
`true`.

xpack.apm.ui.transactionGroupBucketSize:: Number of top transaction groups displayed in APM plugin in Kibana. Defaults to `100`.

apm_oss.indexPattern:: Index pattern is used for integrations with Machine Learning and Kuery Bar. It must match all apm indices. Defaults to `apm-*`.

apm_oss.errorIndices:: Matcher for indices containing error documents. Defaults to `apm-*`.
Expand Down
3 changes: 2 additions & 1 deletion x-pack/plugins/apm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ export function apm(kibana) {
return Joi.object({
// display menu item
ui: Joi.object({
enabled: Joi.boolean().default(true)
enabled: Joi.boolean().default(true),
transactionGroupBucketSize: Joi.number().default(100)
}).default(),

// enable plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ describe('transactionGroupsFetcher', () => {
end: 1528977600000,
client: clientSpy,
config: {
get: () => 'myIndex' as any
get: jest.fn((key: string) => {
switch (key) {
case 'apm_oss.transactionIndices':
return 'myIndex';
case 'xpack.apm.ui.transactionGroupBucketSize':
return 100;
}
})
}
};
const bodyQuery = { my: 'bodyQuery' };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function transactionGroupsFetcher(
terms: {
field: `${TRANSACTION_NAME}.keyword`,
order: { sum: 'desc' },
size: 100
size: config.get<number>('xpack.apm.ui.transactionGroupBucketSize')
},
aggs: {
sample: {
Expand Down

0 comments on commit 8c09455

Please sign in to comment.