diff --git a/docs/apm/advanced-queries.asciidoc b/docs/apm/advanced-queries.asciidoc index 7b771eb66261..8aac22c74243 100644 --- a/docs/apm/advanced-queries.asciidoc +++ b/docs/apm/advanced-queries.asciidoc @@ -2,42 +2,63 @@ [[advanced-queries]] === Query your data -Querying your APM data is a powerful tool that can make finding bottlenecks in your code even easier. -Imagine you have a user that complains about a slow response time in a specific service. -With the query bar, you can easily filter the APM app to only display trace data for that user, -or, to only show transactions that are slower than a specified time threshold. +Querying your APM data is an essential tool that can make finding bottlenecks in your code even more straightforward. -[float] -==== Example APM app queries +Using the query bar, a powerful data query feature, you can pass advanced queries on your data +to filter on specific pieces of information you’re interested in. + +The query bar comes with a handy autocomplete that helps find the fields and even provides suggestions to the data they include. +You can select the query bar and hit the down arrow on your keyboard to begin scanning recommendations. -* Exclude response times slower than 2000 ms: `transaction.duration.us > 2000000` -* Filter by response status code: `context.response.status_code ≥ 400` -* Filter by single user ID: `context.user.id : 12` +[float] +[[apm-app-advanced-queries]] +=== Querying in the APM app -When querying in the APM app, you're merely searching and selecting data from fields in Elasticsearch documents. -Queries entered into the query bar are also added as parameters to the URL, -so it's easy to share a specific query or view with others. +When querying in the APM app, you’re merely searching and selecting data from fields in {es} documents. Queries entered +into the query bar are also added as parameters to the URL, so it’s easy to share a specific query or view with others. When you type, you can begin to see some of the transaction fields available for filtering: [role="screenshot"] image::apm/images/apm-query-bar.png[Example of the Kibana Query bar in APM app in Kibana] -TIP: Read the {kibana-ref}/kuery-query.html[Kibana Query Language Enhancements] documentation to learn more about the capabilities of the {kib} query language. +[TIP] +===== +To learn more about the {kib} query language capabilities, see the {kibana-ref}/kuery-query.html[Kibana Query Language Enhancements] documentation. +===== + +[float] +[[apm-app-queries]] +==== APM app queries + +APM queries can be handy for removing noise from your data in the <>, <>, +<>, <>, and <> views. + +For example, in the *Services* view, you can quickly view a list of all the instrumented services running on your production +environment: `service.environment : production`. Or filter the list by including the APM agent's name and the host it’s running on: +`service.environment : "production" and agent.name : "java" and host.name : "prod-server1"`. + +On the *Traces* view, you might want to view failed transaction results from any of your running containers: +`transaction.result :"FAILURE" and container.id : *`. + +On the *Transactions* view, you may want to list only the slower transactions than a specified time threshold: `transaction.duration.us > 2000000`. +Or filter the list by including the service version and the Kubernetes pod it's running on: +`transaction.duration.us > 2000000 and service.version : "7.12.0" and kubernetes.pod.name : "pod-5468b47f57-pqk2m"`. [float] [[discover-advanced-queries]] === Querying in Discover Alternatively, you can query your APM documents in {kibana-ref}/discover.html[*Discover*]. -Querying documents in *Discover* works the same way as querying in the APM app, +Querying documents in *Discover* works the same way as queries in the APM app, and *Discover* supports all of the example APM app queries shown on this page. [float] -==== Example Discover query +[[discover-queries]] +==== Discover queries One example where you may want to make use of *Discover*, -is for viewing _all_ transactions for an endpoint, instead of just a sample. +is to view _all_ transactions for an endpoint instead of just a sample. TIP: Starting in v7.6, you can view ten samples per bucket in the APM app, instead of just one. diff --git a/docs/apm/filters.asciidoc b/docs/apm/filters.asciidoc index 3fe9146658ee..56602ab7c05c 100644 --- a/docs/apm/filters.asciidoc +++ b/docs/apm/filters.asciidoc @@ -6,49 +6,34 @@ Filter data ++++ -APM provides two different ways you can filter your data within the APM App: - -* <> -* <> - -[[global-filters]] -==== Global filters - -Global filters are ways you can filter any and all data across the APM app. -They are available in the Services, Transactions, Errors, Metrics, and Traces views, -and any filter applied will persist as you move between pages. +Global filters are ways you can filter data across the APM app based on a specific +time range or environment. They are available in the Services, Transactions, Errors, +Metrics, and Traces views, and any filter applied will persist as you move between pages. [role="screenshot"] image::apm/images/global-filters.png[Global filters available in the APM app in Kibana] -[float] -===== Global time range - -The <> in {kib} restricts APM data to a specific time period. - -[float] -[[query-bar]] -===== Query bar +[NOTE] +===== +If you prefer to use advanced queries on your data to filter on specific pieces +of information, see <>. +===== -The query bar is a powerful data query feature. -Similar to the query bar in {kibana-ref}/discover.html[Discover], -it enables you to pass advanced queries on your data to filter on particular pieces of information that you're interested in. -It comes with a handy autocomplete that helps find the fields and even provides suggestions to the data they include. -You can select the query bar and hit the down arrow on your keyboard to begin seeing recommendations. +[[global-time-range]] +==== Global time range -See <> for more information and sample queries. +The <> in {kib} restricts APM data to a specific time period. -[float] [[environment-selector]] -===== Service environment filter +==== Service environment filter The environment selector is a global filter for `service.environment`. -It allows you to view only relevant data, and is especially useful for separating development from production environments. +It allows you to view only relevant data and is especially useful for separating development from production environments. By default, all environments are displayed. If there are no environment options, you'll see "not defined". Service environments are defined when configuring your APM agents. It's vital to be consistent when naming environments in your agents. -See the documentation for each agent you're using to learn how to configure service environments: +To learn how to configure service environments, see the specific agent documentation: * *Go:* {apm-go-ref}/configuration.html#config-environment[`ELASTIC_APM_ENVIRONMENT`] * *Java:* {apm-java-ref}/config-core.html#config-environment[`environment`] @@ -58,19 +43,3 @@ See the documentation for each agent you're using to learn how to configure serv * *Python:* {apm-py-ref}/configuration.html#config-environment[`environment`] * *Ruby:* {apm-ruby-ref}/configuration.html#config-environment[`environment`] * *Real User Monitoring:* {apm-rum-ref}/configuration.html#environment[`environment`] - -[[contextual-filters]] -==== Contextual filters - -Contextual filters are ways you can filter your specific APM data on each individual page. -The filters shown are relevant to your data, and will persist between pages, -but only where they are applicable -- they are typically most useful in their original context. -As an example, if you select a host on the Services overview, then select a transaction group, -the host filter will still be applied. - -These filters are very useful for quickly and easily removing noise from your data. -With just a click, you can filter your transactions by the transaction result, -host, container ID, Kubernetes pod, and more. - -[role="screenshot"] -image::apm/images/local-filter.png[Local filters available in the APM app in Kibana] \ No newline at end of file diff --git a/docs/apm/images/apm-errors-overview.png b/docs/apm/images/apm-errors-overview.png index 5b3b00a3b1ef..425464a1ffd2 100644 Binary files a/docs/apm/images/apm-errors-overview.png and b/docs/apm/images/apm-errors-overview.png differ diff --git a/docs/apm/images/apm-metrics.png b/docs/apm/images/apm-metrics.png index af083b5ba3c0..c2d609c7c4cd 100644 Binary files a/docs/apm/images/apm-metrics.png and b/docs/apm/images/apm-metrics.png differ diff --git a/docs/apm/images/apm-query-bar.png b/docs/apm/images/apm-query-bar.png index 92398065c254..a1fb129d3c20 100644 Binary files a/docs/apm/images/apm-query-bar.png and b/docs/apm/images/apm-query-bar.png differ diff --git a/docs/apm/images/apm-services-overview.png b/docs/apm/images/apm-services-overview.png index 3a56d597abfb..1c16ac5b572c 100644 Binary files a/docs/apm/images/apm-services-overview.png and b/docs/apm/images/apm-services-overview.png differ diff --git a/docs/apm/images/apm-traces.png b/docs/apm/images/apm-traces.png index ed15423b42c5..0e9062ee448b 100644 Binary files a/docs/apm/images/apm-traces.png and b/docs/apm/images/apm-traces.png differ diff --git a/docs/apm/images/apm-transactions-overview.png b/docs/apm/images/apm-transactions-overview.png index 1b25668f0fd9..be292c37e24e 100644 Binary files a/docs/apm/images/apm-transactions-overview.png and b/docs/apm/images/apm-transactions-overview.png differ diff --git a/docs/apm/images/global-filters.png b/docs/apm/images/global-filters.png index 70ae50aea605..f93a5214c316 100644 Binary files a/docs/apm/images/global-filters.png and b/docs/apm/images/global-filters.png differ diff --git a/docs/apm/images/jvm-metrics-overview.png b/docs/apm/images/jvm-metrics-overview.png index 4b882574e2b9..c6f28f7bdf48 100644 Binary files a/docs/apm/images/jvm-metrics-overview.png and b/docs/apm/images/jvm-metrics-overview.png differ