├── LICENSE ├── README.md ├── apm-agent-android └── .keep ├── apm-agent-dotnet └── .keep ├── apm-agent-go ├── .keep └── dashboards │ ├── Go Runtime Metrics.png │ ├── README.md │ ├── go_metrics_dashboard_7.x.json │ └── go_metrics_dashboard_8.x.json ├── apm-agent-ios └── .keep ├── apm-agent-java ├── configuration │ ├── jmx.md │ └── trace_methods.md ├── dashboards │ ├── apm_agent_health_8.x.ndjson │ ├── java_metrics_dashboard_6.x.json │ ├── java_metrics_dashboard_7.x.json │ ├── jvm-metrics.ndjson │ └── readme.md ├── frameworks │ ├── grails3 │ │ └── README.md │ ├── servlet2 │ │ └── ApmServletFilter.java │ └── wicket │ │ └── WicketAjaxAPMFilter.java ├── log-ingest │ ├── .env │ ├── .gitignore │ ├── 00-compose.yml │ ├── 01-app-logging.xml │ ├── 01-compose.yml │ ├── 01-filebeat.yml │ ├── 02-app-logging.xml │ ├── 02-compose.yml │ ├── 02-filebeat.yml │ ├── 03-compose.yml │ ├── 03-filebeat.yml │ ├── 04-compose.yml │ ├── 05-compose.yml │ ├── README.md │ ├── app │ │ ├── .mvn │ │ │ └── wrapper │ │ │ │ ├── maven-wrapper.jar │ │ │ │ └── maven-wrapper.properties │ │ ├── Dockerfile │ │ ├── mvnw │ │ ├── mvnw.cmd │ │ ├── pom.xml │ │ ├── run.sh │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── demo │ │ │ │ ├── DemoApplication.java │ │ │ │ └── DemoController.java │ │ │ └── resources │ │ │ └── application.properties │ ├── build-and-run.sh │ ├── client │ │ ├── Dockerfile │ │ └── run.sh │ └── filebeat │ │ ├── Dockerfile │ │ └── run.sh └── readme.md ├── apm-agent-nodejs ├── .keep └── dashboards │ ├── nodejs-runtime-metrics-6.x.json │ ├── nodejs-runtime-metrics-7.x.json │ └── readme.md ├── apm-agent-php └── .keep ├── apm-agent-python └── .keep ├── apm-agent-ruby ├── .keep └── dashboards │ ├── readme.md │ └── ruby-runtime-metrics-7.3+.ndjson ├── apm-agent-rum-js ├── .keep └── README.md ├── apm-logo.svg ├── apm-server └── .keep ├── kibana ├── 6.x │ ├── error_details.json │ ├── errors.json │ ├── services.json │ ├── span_details.json │ └── transactions.json ├── 7.x │ ├── agent-versions.ndjson │ ├── error_details.json │ ├── errors.json │ ├── services.json │ ├── span_details.json │ └── transactions.json ├── 8.x │ ├── agent-versions.ndjson │ └── agent-versions.png └── readme.md ├── opentelemetry ├── .gitignore ├── README.md ├── docker-compose.yml ├── elastic-pinger │ ├── Dockerfile │ ├── go.mod │ ├── go.sum │ └── main.go ├── otel-js-frontend │ ├── Dockerfile │ ├── app.js │ ├── package-lock.json │ ├── package.json │ └── tracing.js └── otel-python-backend │ ├── Dockerfile │ ├── requirements.txt │ └── server.py └── stack ├── README.md └── docker-compose.yml /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2018 - 2019 Elasticsearch BV 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

Elastic APM Elastic APM Contrib

2 | 3 |

This repository includes contributions for Elastic APM.

4 | 5 | ## What we do… 6 | 7 | | Project | Repo | Docs | Contrib | 8 | | :------------------------ | :------------------- | :-------------------------------------- | :----------------------------- | 9 | | APM Server | [apm-server][] | [📘 elastic.co][apm-server-docs] | [📂 contrib](apm-server) | 10 | | APM UI | [apm-ui][] | [📘 elastic.co][apm-ui-docs] | [📂 contrib](apm-ui) | 11 | | Android Agent (🚧 In Development) | [apm-agent-android][] | [📘 elastic.co][apm-agent-android-docs] | [📂 contrib](apm-agent-android) 12 | | Go Agent | [apm-agent-go][] | [📘 elastic.co][apm-agent-go-docs] | [📂 contrib](apm-agent-go) | 13 | | iOS Agent (🚧 In Development) | [apm-agent-ios][] | [📘 elastic.co][apm-agent-ios-docs] | [📂 contrib](apm-agent-ios) | 14 | | Java Agent | [apm-agent-java][] | [📘 elastic.co][apm-agent-java-docs] | [📂 contrib](apm-agent-java) | 15 | | JavaScript RUM Agent | [apm-agent-rum-js][] | [📘 elastic.co][apm-agent-js-base-docs] | [📂 contrib](apm-agent-rum-js) | 16 | | .NET Agent | [apm-agent-dotnet][] | [📘 elastic.co][apm-agent-dotnet-docs] | [📂 contrib](apm-agent-dotnet) | 17 | | Node.js Agent | [apm-agent-nodejs][] | [📘 elastic.co][apm-agent-nodejs-docs] | [📂 contrib](apm-agent-nodejs) | 18 | | PHP Agent | [apm-agent-php][] | [📘 elastic.co][apm-agent-php-docs] | [📂 contrib](apm-agent-php) | 19 | | Python Agent | [apm-agent-python][] | [📘 elastic.co][apm-agent-python-docs] | [📂 contrib](apm-agent-python) | 20 | | Ruby Agent | [apm-agent-ruby][] | [📘 elastic.co][apm-agent-ruby-docs] | [📂 contrib](apm-agent-ruby) | 21 | 22 | ## APM Contrib Repository 23 | 24 | This is a collection of code and recipes to be used in conjunction with [Elastic APM](https://www.elastic.co/solutions/apm). The code here is not necessarily maintained by the core Elastic APM Team. 25 | 26 | ## Contributing 27 | 28 | All contributions are welcome: recipes, visualizations, dashboards, ingest processors, ideas, documentation, and even something you drew up on a napkin. 29 | 30 | For more information about contributing, see the relevant `CONTRIBUTING` file: 31 | 32 | * [APM Server](https://github.com/elastic/apm-server/blob/master/CONTRIBUTING.md) 33 | * [APM UI](https://github.com/elastic/kibana/blob/main/CONTRIBUTING.md) 34 | * [Android Agent](https://github.com/elastic/apm-agent-android/blob/main/CONTRIBUTING.md) 35 | * [Go Agent](https://github.com/elastic/apm-agent-go/blob/master/CONTRIBUTING.md) 36 | * [iOS Agent](https://github.com/elastic/apm-agent-ios/blob/master/CONTRIBUTING.md) 37 | * [Java Agent](https://github.com/elastic/apm-agent-java/blob/master/CONTRIBUTING.md) 38 | * [JavaScript RUM Agent](https://github.com/elastic/apm-agent-rum-js/blob/master/CONTRIBUTING.md) 39 | * [.NET Agent](https://github.com/elastic/apm-agent-dotnet/blob/master/CONTRIBUTING.md) 40 | * [Node.js Agent](https://github.com/elastic/apm-agent-nodejs/blob/master/CONTRIBUTING.md) 41 | * [PHP Agent](https://github.com/elastic/apm-agent-php/blob/master/CONTRIBUTING.md) 42 | * [Python Agent](https://github.com/elastic/apm-agent-python/blob/master/CONTRIBUTING.md) 43 | * [Ruby Agent](https://github.com/elastic/apm-agent-ruby/blob/master/CONTRIBUTING.md) 44 | 45 | ## Community Developed Agents 46 | 47 | The following agents are developed and maintained by members of the community. 48 | 49 | | Project | Repo | Docs | Notes | 50 | | :----------- | :--------------------------------------------------------- | :-------------------------------------- | :-------------------------- | 51 | | Meteor Agent | [kschingiz/meteor-elastic-apm][apm-agent-meteor] | [📘 README][apm-agent-meteor-docs] | | 52 | 53 | [apm-server]: https://github.com/elastic/apm-server 54 | [apm-server-docs]: https://www.elastic.co/guide/en/apm/guide/current/index.html 55 | 56 | [apm-ui]: https://github.com/elastic/kibana/tree/main/x-pack/plugins/apm 57 | [apm-ui-docs]: https://www.elastic.co/guide/en/kibana/current/xpack-apm.html 58 | 59 | [apm-agent-android]: https://github.com/elastic/apm-agent-android 60 | [apm-agent-android-docs]: https://www.elastic.co/guide/en/apm/agent/android/current/index.html 61 | 62 | [apm-agent-go]: https://github.com/elastic/apm-agent-go 63 | [apm-agent-go-docs]: https://www.elastic.co/guide/en/apm/agent/go/current/index.html 64 | 65 | [apm-agent-ios]: https://github.com/elastic/apm-agent-ios 66 | [apm-agent-ios-docs]: https://www.elastic.co/guide/en/apm/agent/swift/current/index.html 67 | 68 | [apm-agent-java]: https://github.com/elastic/apm-agent-java 69 | [apm-agent-java-docs]: https://www.elastic.co/guide/en/apm/agent/java/current/index.html 70 | 71 | [apm-agent-rum-js]: https://github.com/elastic/apm-agent-rum-js 72 | [apm-agent-js-base-docs]: https://www.elastic.co/guide/en/apm/agent/js-base/current/index.html 73 | 74 | [apm-agent-nodejs]: https://github.com/elastic/apm-agent-nodejs 75 | [apm-agent-nodejs-docs]: https://www.elastic.co/guide/en/apm/agent/nodejs/current/index.html 76 | 77 | [apm-agent-python]: https://github.com/elastic/apm-agent-python 78 | [apm-agent-python-docs]: https://www.elastic.co/guide/en/apm/agent/python/current/index.html 79 | 80 | [apm-agent-ruby]: https://github.com/elastic/apm-agent-ruby 81 | [apm-agent-ruby-docs]: https://www.elastic.co/guide/en/apm/agent/ruby/current/index.html 82 | 83 | [apm-agent-dotnet-docs]: https://www.elastic.co/guide/en/apm/agent/dotnet/current/index.html 84 | [apm-agent-dotnet]: https://github.com/elastic/apm-agent-dotnet 85 | 86 | [apm-agent-php-docs]: https://www.elastic.co/guide/en/apm/agent/php/current/index.html 87 | [apm-agent-php]: https://github.com/elastic/apm-agent-php 88 | 89 | [apm-agent-meteor]: https://github.com/kschingiz/meteor-elastic-apm 90 | [apm-agent-meteor-docs]: https://github.com/kschingiz/meteor-elastic-apm#readme 91 | -------------------------------------------------------------------------------- /apm-agent-android/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/apm-contrib/262d2704e2a7a2886795c82dea5385c9875ad022/apm-agent-android/.keep -------------------------------------------------------------------------------- /apm-agent-dotnet/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/apm-contrib/262d2704e2a7a2886795c82dea5385c9875ad022/apm-agent-dotnet/.keep -------------------------------------------------------------------------------- /apm-agent-go/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/apm-contrib/262d2704e2a7a2886795c82dea5385c9875ad022/apm-agent-go/.keep -------------------------------------------------------------------------------- /apm-agent-go/dashboards/Go Runtime Metrics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/apm-contrib/262d2704e2a7a2886795c82dea5385c9875ad022/apm-agent-go/dashboards/Go Runtime Metrics.png -------------------------------------------------------------------------------- /apm-agent-go/dashboards/README.md: -------------------------------------------------------------------------------- 1 | # Go Metrics 2 | 3 | Dashboard for Go Agent Metrics 4 | 5 | ![Elastic APM Go Agent Metrics](Go%20Runtime%20Metrics.png) 6 | -------------------------------------------------------------------------------- /apm-agent-go/dashboards/go_metrics_dashboard_7.x.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_id": "ea1cf250-6be1-11e9-9648-cb8c116f841a", 4 | "_type": "dashboard", 5 | "_source": { 6 | "title": "Go Runtime Metrics", 7 | "hits": 0, 8 | "description": "", 9 | "panelsJSON": "[{\"embeddableConfig\":{},\"gridData\":{\"h\":7,\"i\":\"1\",\"w\":48,\"x\":0,\"y\":0},\"panelIndex\":\"1\",\"version\":\"7.0.0\",\"panelRefName\":\"panel_0\"},{\"embeddableConfig\":{},\"gridData\":{\"h\":6,\"i\":\"2\",\"w\":48,\"x\":0,\"y\":7},\"panelIndex\":\"2\",\"version\":\"7.0.0\",\"panelRefName\":\"panel_1\"},{\"embeddableConfig\":{},\"gridData\":{\"h\":6,\"i\":\"4\",\"w\":23,\"x\":0,\"y\":13},\"panelIndex\":\"4\",\"version\":\"7.0.0\",\"panelRefName\":\"panel_2\"},{\"embeddableConfig\":{},\"gridData\":{\"h\":6,\"i\":\"5\",\"w\":25,\"x\":23,\"y\":13},\"panelIndex\":\"5\",\"version\":\"7.0.0\",\"panelRefName\":\"panel_3\"},{\"embeddableConfig\":{},\"gridData\":{\"h\":6,\"i\":\"6\",\"w\":48,\"x\":0,\"y\":19},\"panelIndex\":\"6\",\"version\":\"7.0.0\",\"panelRefName\":\"panel_4\"}]", 10 | "optionsJSON": "{\"hidePanelTitles\":false,\"useMargins\":true}", 11 | "version": 1, 12 | "timeRestore": false, 13 | "kibanaSavedObjectMeta": { 14 | "searchSourceJSON": "{\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filter\":[{\"$state\":{\"store\":\"appState\"},\"meta\":{\"alias\":null,\"disabled\":false,\"key\":\"agent.name\",\"negate\":false,\"params\":{\"query\":\"go\"},\"type\":\"phrase\",\"value\":\"go\",\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index\"},\"query\":{\"match\":{\"agent.name\":{\"query\":\"go\",\"type\":\"phrase\"}}}}]}" 15 | } 16 | }, 17 | "_migrationVersion": { 18 | "dashboard": "7.0.0" 19 | }, 20 | "_references": [ 21 | { 22 | "name": "kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index", 23 | "type": "index-pattern", 24 | "id": "apm-*" 25 | }, 26 | { 27 | "name": "panel_0", 28 | "type": "visualization", 29 | "id": "df93a9a0-2fa0-11e9-bf11-ede9e2ea677b" 30 | }, 31 | { 32 | "name": "panel_1", 33 | "type": "visualization", 34 | "id": "a19beed0-6be3-11e9-9648-cb8c116f841a" 35 | }, 36 | { 37 | "name": "panel_2", 38 | "type": "visualization", 39 | "id": "07b860e0-6c9d-11e9-9a58-07a2eed03b22" 40 | }, 41 | { 42 | "name": "panel_3", 43 | "type": "visualization", 44 | "id": "a3782180-6be6-11e9-9648-cb8c116f841a" 45 | }, 46 | { 47 | "name": "panel_4", 48 | "type": "visualization", 49 | "id": "311e3390-6ca4-11e9-9a58-07a2eed03b22" 50 | } 51 | ] 52 | }, 53 | { 54 | "_id": "df93a9a0-2fa0-11e9-bf11-ede9e2ea677b", 55 | "_type": "visualization", 56 | "_source": { 57 | "title": "Service Host Environment Controls", 58 | "visState": "{\"title\":\"Service Host Environment Controls\",\"type\":\"input_control_vis\",\"params\":{\"controls\":[{\"id\":\"1550070167115\",\"fieldName\":\"service.name\",\"parent\":\"\",\"label\":\"Services\",\"type\":\"list\",\"options\":{\"type\":\"terms\",\"multiselect\":true,\"dynamicOptions\":true,\"size\":5,\"order\":\"desc\"},\"indexPatternRefName\":\"control_0_index_pattern\"},{\"id\":\"1550070196624\",\"fieldName\":\"host.name\",\"parent\":\"\",\"label\":\"Host\",\"type\":\"list\",\"options\":{\"type\":\"terms\",\"multiselect\":true,\"dynamicOptions\":true,\"size\":5,\"order\":\"desc\"},\"indexPatternRefName\":\"control_1_index_pattern\"},{\"id\":\"1550070239914\",\"fieldName\":\"service.environment\",\"parent\":\"\",\"label\":\"Environment\",\"type\":\"list\",\"options\":{\"type\":\"terms\",\"multiselect\":true,\"dynamicOptions\":true,\"size\":5,\"order\":\"desc\"},\"indexPatternRefName\":\"control_2_index_pattern\"}],\"updateFiltersOnChange\":false,\"useTimeFilter\":false,\"pinFilters\":false},\"aggs\":[]}", 59 | "uiStateJSON": "{}", 60 | "description": "", 61 | "version": 1, 62 | "kibanaSavedObjectMeta": { 63 | "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}" 64 | } 65 | }, 66 | "_migrationVersion": { 67 | "visualization": "7.0.0" 68 | }, 69 | "_references": [ 70 | { 71 | "name": "control_0_index_pattern", 72 | "type": "index-pattern", 73 | "id": "apm-*" 74 | }, 75 | { 76 | "name": "control_1_index_pattern", 77 | "type": "index-pattern", 78 | "id": "apm-*" 79 | }, 80 | { 81 | "name": "control_2_index_pattern", 82 | "type": "index-pattern", 83 | "id": "apm-*" 84 | } 85 | ] 86 | }, 87 | { 88 | "_id": "a19beed0-6be3-11e9-9648-cb8c116f841a", 89 | "_type": "visualization", 90 | "_source": { 91 | "title": "[Go] Goroutines", 92 | "visState": "{\"title\":\"[Go] Goroutines\",\"type\":\"metrics\",\"params\":{\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"type\":\"timeseries\",\"series\":[{\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"color\":\"rgba(104,188,0,1)\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"type\":\"avg\",\"field\":\"golang.goroutines\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"label\":\"Goroutines\",\"steps\":0,\"series_drop_last_bucket\":1,\"terms_field\":\"service.name\",\"hidden\":false,\"filter\":\"processor.event: metric\"}],\"time_field\":\"@timestamp\",\"index_pattern\":\"\",\"interval\":\"auto\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"axis_scale\":\"normal\",\"show_legend\":1,\"show_grid\":1,\"default_index_pattern\":\"apm-*\",\"background_color_rules\":[{\"id\":\"69262800-6be2-11e9-ad48-7f28e717ed4c\"}],\"gauge_color_rules\":[{\"id\":\"6b5fc450-6be2-11e9-ad48-7f28e717ed4c\"}],\"gauge_width\":10,\"gauge_inner_width\":10,\"gauge_style\":\"half\",\"bar_color_rules\":[{\"id\":\"6d1c6870-6be2-11e9-ad48-7f28e717ed4c\"}],\"filter\":\"processor.event : \\\"metric\\\"\"},\"aggs\":[]}", 93 | "uiStateJSON": "{}", 94 | "description": "", 95 | "version": 1, 96 | "kibanaSavedObjectMeta": { 97 | "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}" 98 | } 99 | }, 100 | "_migrationVersion": { 101 | "visualization": "7.0.0" 102 | }, 103 | "_references": [] 104 | }, 105 | { 106 | "_id": "a3782180-6be6-11e9-9648-cb8c116f841a", 107 | "_type": "visualization", 108 | "_source": { 109 | "title": "[Go] Allocations", 110 | "visState": "{\"title\":\"[Go] Allocations\",\"type\":\"metrics\",\"params\":{\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"type\":\"timeseries\",\"series\":[{\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"color\":\"rgba(104,188,0,1)\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"type\":\"avg\",\"field\":\"golang.heap.allocations.objects\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"label\":\"Objects\",\"terms_field\":\"service.name\",\"filter\":\"processor.event: metric\"},{\"id\":\"6740e6d0-6c9e-11e9-8a45-e13a52c6b66c\",\"color\":\"rgba(0,156,224,1)\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"6740e6d1-6c9e-11e9-8a45-e13a52c6b66c\",\"type\":\"avg\",\"field\":\"golang.heap.allocations.mallocs\"},{\"unit\":\"1s\",\"id\":\"ab2c4ab0-6c9e-11e9-8a45-e13a52c6b66c\",\"type\":\"derivative\",\"field\":\"6740e6d1-6c9e-11e9-8a45-e13a52c6b66c\"},{\"unit\":\"\",\"id\":\"e6d21130-6c9e-11e9-8a45-e13a52c6b66c\",\"type\":\"positive_only\",\"field\":\"ab2c4ab0-6c9e-11e9-8a45-e13a52c6b66c\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"label\":\"Mallocs\",\"value_template\":\"{{value}}/s\",\"filter\":\"processor.event: metric\",\"split_color_mode\":\"gradient\",\"steps\":0},{\"id\":\"087e0ff0-6c9f-11e9-8a45-e13a52c6b66c\",\"color\":\"rgba(0,156,224,1)\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"087e0ff1-6c9f-11e9-8a45-e13a52c6b66c\",\"type\":\"avg\",\"field\":\"golang.heap.allocations.frees\"},{\"unit\":\"1s\",\"id\":\"087e0ff2-6c9f-11e9-8a45-e13a52c6b66c\",\"type\":\"derivative\",\"field\":\"087e0ff1-6c9f-11e9-8a45-e13a52c6b66c\"},{\"unit\":\"\",\"id\":\"087e0ff3-6c9f-11e9-8a45-e13a52c6b66c\",\"type\":\"positive_only\",\"field\":\"087e0ff2-6c9f-11e9-8a45-e13a52c6b66c\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"label\":\"Frees\",\"value_template\":\"{{value}}/s\",\"hidden\":false,\"filter\":\"processor.event: metric\"}],\"time_field\":\"@timestamp\",\"index_pattern\":\"\",\"interval\":\"auto\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"axis_scale\":\"normal\",\"show_legend\":1,\"show_grid\":1,\"default_index_pattern\":\"apm-*\"},\"aggs\":[]}", 111 | "uiStateJSON": "{}", 112 | "description": "", 113 | "version": 1, 114 | "kibanaSavedObjectMeta": { 115 | "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}" 116 | } 117 | }, 118 | "_migrationVersion": { 119 | "visualization": "7.0.0" 120 | }, 121 | "_references": [] 122 | }, 123 | { 124 | "_id": "07b860e0-6c9d-11e9-9a58-07a2eed03b22", 125 | "_type": "visualization", 126 | "_source": { 127 | "title": "[Go] Heap", 128 | "visState": "{\"title\":\"[Go] Heap\",\"type\":\"metrics\",\"params\":{\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"type\":\"timeseries\",\"series\":[{\"id\":\"56b7eb70-6c9d-11e9-8a45-e13a52c6b66c\",\"color\":\"rgba(104,188,0,1)\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"56b7eb71-6c9d-11e9-8a45-e13a52c6b66c\",\"type\":\"avg\",\"field\":\"golang.heap.allocations.allocated\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"bytes\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"label\":\"Allocated\",\"filter\":\"processor.event: metric\"},{\"id\":\"f23808c0-6c9b-11e9-8a45-e13a52c6b66c\",\"color\":\"rgba(104,188,0,1)\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"f23808c1-6c9b-11e9-8a45-e13a52c6b66c\",\"type\":\"avg\",\"field\":\"golang.heap.system.obtained\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"bytes\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"label\":\"System obtained\",\"hidden\":false,\"filter\":\"processor.event: metric\"}],\"time_field\":\"@timestamp\",\"index_pattern\":\"\",\"interval\":\"auto\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"axis_scale\":\"normal\",\"show_legend\":1,\"show_grid\":1,\"default_index_pattern\":\"apm-*\"},\"aggs\":[]}", 129 | "uiStateJSON": "{}", 130 | "description": "", 131 | "version": 1, 132 | "kibanaSavedObjectMeta": { 133 | "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}" 134 | } 135 | }, 136 | "_migrationVersion": { 137 | "visualization": "7.0.0" 138 | }, 139 | "_references": [] 140 | }, 141 | { 142 | "_id": "311e3390-6ca4-11e9-9a58-07a2eed03b22", 143 | "_type": "visualization", 144 | "_source": { 145 | "title": "[Go] Garbage Collection", 146 | "visState": "{\"title\":\"[Go] Garbage Collection\",\"type\":\"metrics\",\"params\":{\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"type\":\"timeseries\",\"series\":[{\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"color\":\"rgba(0,156,224,1)\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"type\":\"avg\",\"field\":\"golang.heap.gc.total_count\"},{\"unit\":\"1s\",\"id\":\"6a255730-6ca0-11e9-8a45-e13a52c6b66c\",\"type\":\"derivative\",\"field\":\"61ca57f2-469d-11e7-af02-69e470af7417\"},{\"unit\":\"\",\"id\":\"7764e960-6ca0-11e9-8a45-e13a52c6b66c\",\"type\":\"positive_only\",\"field\":\"6a255730-6ca0-11e9-8a45-e13a52c6b66c\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":\"0.5\",\"stacked\":\"none\",\"value_template\":\"{{value}}/s\",\"label\":\"GC count\",\"filter\":\"processor.event: metric\"},{\"id\":\"d7e75520-6ca0-11e9-8a45-e13a52c6b66c\",\"color\":\"rgba(104,188,0,1)\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"d7e75521-6ca0-11e9-8a45-e13a52c6b66c\",\"type\":\"avg\",\"field\":\"golang.heap.gc.total_pause.ns\"},{\"unit\":\"1s\",\"id\":\"f4d7c7a0-6ca0-11e9-8a45-e13a52c6b66c\",\"type\":\"derivative\",\"field\":\"d7e75521-6ca0-11e9-8a45-e13a52c6b66c\"},{\"unit\":\"\",\"id\":\"feda0920-6ca0-11e9-8a45-e13a52c6b66c\",\"type\":\"positive_only\",\"field\":\"f4d7c7a0-6ca0-11e9-8a45-e13a52c6b66c\"},{\"script\":\"params.total_pause_ns / 1000000\",\"id\":\"e898ff70-6ca7-11e9-93b1-f5139aaf79ba\",\"type\":\"math\",\"variables\":[{\"id\":\"eb6ba770-6ca7-11e9-93b1-f5139aaf79ba\",\"field\":\"feda0920-6ca0-11e9-8a45-e13a52c6b66c\",\"name\":\"total_pause_ns\"}]}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"ms,ms,2\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":\"0.5\",\"stacked\":\"none\",\"label\":\"Pause time\",\"value_template\":\"{{value}} ms/s\",\"split_color_mode\":\"gradient\",\"filter\":\"processor.event: metric\"},{\"id\":\"38dee980-6ca4-11e9-8a45-e13a52c6b66c\",\"color\":\"rgba(25,77,51,1)\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"38dee981-6ca4-11e9-8a45-e13a52c6b66c\",\"type\":\"avg\",\"field\":\"golang.heap.gc.cpu_fraction\"},{\"script\":\"params.cpu_fraction * 100\",\"id\":\"4479a550-6ca4-11e9-8a45-e13a52c6b66c\",\"type\":\"math\",\"variables\":[{\"id\":\"48915070-6ca4-11e9-8a45-e13a52c6b66c\",\"field\":\"38dee981-6ca4-11e9-8a45-e13a52c6b66c\",\"name\":\"cpu_fraction\"}]}],\"separate_axis\":1,\"axis_position\":\"right\",\"formatter\":\"percent\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":\"0.5\",\"stacked\":\"none\",\"label\":\"CPU Usage\",\"filter\":\"processor.event: metric\",\"axis_min\":\"0\",\"axis_max\":\"1\"}],\"time_field\":\"@timestamp\",\"index_pattern\":\"\",\"interval\":\"auto\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"axis_scale\":\"normal\",\"show_legend\":1,\"show_grid\":1,\"default_index_pattern\":\"apm-*\"},\"aggs\":[]}", 147 | "uiStateJSON": "{}", 148 | "description": "", 149 | "version": 1, 150 | "kibanaSavedObjectMeta": { 151 | "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}" 152 | } 153 | }, 154 | "_migrationVersion": { 155 | "visualization": "7.0.0" 156 | }, 157 | "_references": [] 158 | } 159 | ] -------------------------------------------------------------------------------- /apm-agent-ios/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/apm-contrib/262d2704e2a7a2886795c82dea5385c9875ad022/apm-agent-ios/.keep -------------------------------------------------------------------------------- /apm-agent-java/configuration/jmx.md: -------------------------------------------------------------------------------- 1 | 2 | ## Tomcat 3 | 4 | ### All-In-One copy & paste configuration 5 | 6 | Agent `capture_jmx_metrics` value to use: 7 | ``` 8 | object_name[Catalina:type=ThreadPool,name=*] attribute[connectionCount] attribute[currentThreadCount] attribute[currentThreadsBusy] attribute[maxConnections] attribute[maxThreads] attribute[poolSize], object_name[Catalina:type=Executor,name=*] attribute[activeCount] attribute[maxThreads] attribute[poolSize], object_name[Catalina:type=GlobalRequestProcessor,name=*] attribute[bytesSent] attribute[bytesReceived] attribute[errorCount] attribute[maxTime] attribute[requestCount] object_name[Catalina:type=Manager,context=*,host=*] attribute[activeSessions] attribute[sessionCounter] attribute[expiredSessions] 9 | ``` 10 | 11 | ### Thread pools 12 | 13 | `Executor` thread pools are only available when explicitly configured, they aren't enabled by default. 14 | 15 | Attributes availability depends on Tomcat version and configuration. 16 | 17 | ``` 18 | Catalina:type=ThreadPool,name=* 19 | - connectionCount 20 | - currentThreadCount 21 | - currentThreadsBusy 22 | - maxConnections 23 | - maxThreads 24 | - poolSize 25 | 26 | Catalina:type=Executor,name=* 27 | - activeCount 28 | - maxThreads 29 | - poolSize 30 | ``` 31 | 32 | Agent `capture_jmx_metrics` value to use: 33 | ``` 34 | object_name[Catalina:type=ThreadPool,name=*] attribute[connectionCount] attribute[currentThreadCount] attribute[currentThreadsBusy] attribute[maxConnections] attribute[maxThreads] attribute[poolSize], object_name[Catalina:type=Executor,name=*] attribute[activeCount] attribute[maxThreads] attribute[poolSize] 35 | ``` 36 | 37 | ### Request throughput 38 | 39 | ``` 40 | Catalina:type=GlobalRequestProcessor,name=* 41 | - bytesSent 42 | - bytesReceived 43 | - errorCount 44 | - maxTime 45 | - requestCount 46 | ``` 47 | 48 | Agent `capture_jmx_metrics` value to use: 49 | ``` 50 | object_name[Catalina:type=GlobalRequestProcessor,name=*] attribute[bytesSent] attribute[bytesReceived] attribute[errorCount] attribute[maxTime] attribute[requestCount] 51 | ``` 52 | 53 | ### Sessions 54 | 55 | ``` 56 | Catalina:type=Manager,context=*,host=* 57 | - activeSessions 58 | - sessionCounter 59 | - expiredSessions 60 | ``` 61 | 62 | Agent `capture_jmx_metrics` value to use: 63 | ``` 64 | object_name[Catalina:type=Manager,context=*,host=*] attribute[activeSessions] attribute[sessionCounter] attribute[expiredSessions] 65 | ``` 66 | 67 | ## IBM Websphere 68 | 69 | TODO 70 | 71 | ## Oracle Weblogic 72 | 73 | TODO 74 | -------------------------------------------------------------------------------- /apm-agent-java/configuration/trace_methods.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/apm-contrib/262d2704e2a7a2886795c82dea5385c9875ad022/apm-agent-java/configuration/trace_methods.md -------------------------------------------------------------------------------- /apm-agent-java/dashboards/java_metrics_dashboard_7.x.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_id": "3f4721f0-02c5-11e9-b9ca-e74cd528e466", 4 | "_type": "dashboard", 5 | "_source": { 6 | "title": "Java Metrics Dashboard", 7 | "hits": 0, 8 | "description": "", 9 | "panelsJSON": "[{\"embeddableConfig\":{},\"gridData\":{\"x\":0,\"y\":7,\"w\":24,\"h\":15,\"i\":\"1\"},\"panelIndex\":\"1\",\"version\":\"7.0.0-SNAPSHOT\",\"panelRefName\":\"panel_0\"},{\"embeddableConfig\":{},\"gridData\":{\"x\":24,\"y\":7,\"w\":24,\"h\":15,\"i\":\"2\"},\"panelIndex\":\"2\",\"version\":\"7.0.0-SNAPSHOT\",\"panelRefName\":\"panel_1\"},{\"embeddableConfig\":{},\"gridData\":{\"x\":0,\"y\":22,\"w\":24,\"h\":15,\"i\":\"3\"},\"panelIndex\":\"3\",\"version\":\"7.0.0-SNAPSHOT\",\"panelRefName\":\"panel_2\"},{\"embeddableConfig\":{},\"gridData\":{\"x\":24,\"y\":22,\"w\":24,\"h\":15,\"i\":\"4\"},\"panelIndex\":\"4\",\"version\":\"7.0.0-SNAPSHOT\",\"panelRefName\":\"panel_3\"},{\"embeddableConfig\":{},\"gridData\":{\"x\":0,\"y\":37,\"w\":24,\"h\":15,\"i\":\"5\"},\"panelIndex\":\"5\",\"version\":\"7.0.0-SNAPSHOT\",\"panelRefName\":\"panel_4\"},{\"embeddableConfig\":{},\"gridData\":{\"x\":24,\"y\":37,\"w\":24,\"h\":15,\"i\":\"6\"},\"panelIndex\":\"6\",\"version\":\"6.6.0\",\"panelRefName\":\"panel_5\"},{\"gridData\":{\"x\":0,\"y\":0,\"w\":48,\"h\":7,\"i\":\"7\"},\"version\":\"7.0.0\",\"panelIndex\":\"7\",\"embeddableConfig\":{},\"panelRefName\":\"panel_6\"}]", 10 | "optionsJSON": "{\"darkTheme\":false,\"hidePanelTitles\":false,\"useMargins\":true}", 11 | "version": 1, 12 | "timeRestore": false, 13 | "kibanaSavedObjectMeta": { 14 | "searchSourceJSON": "{\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filter\":[{\"$state\":{\"store\":\"appState\"},\"meta\":{\"alias\":null,\"disabled\":false,\"key\":\"agent.name\",\"negate\":false,\"params\":{\"query\":\"java\"},\"type\":\"phrase\",\"value\":\"java\",\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index\"},\"query\":{\"match\":{\"agent.name\":{\"query\":\"java\",\"type\":\"phrase\"}}}}]}" 15 | } 16 | }, 17 | "_migrationVersion": { 18 | "dashboard": "7.0.0" 19 | }, 20 | "_references": [ 21 | { 22 | "name": "kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index", 23 | "type": "index-pattern", 24 | "id": "apm-*" 25 | }, 26 | { 27 | "name": "panel_0", 28 | "type": "visualization", 29 | "id": "4108c030-02a6-11e9-b9ca-e74cd528e466" 30 | }, 31 | { 32 | "name": "panel_1", 33 | "type": "visualization", 34 | "id": "92f07af0-02c4-11e9-b9ca-e74cd528e466" 35 | }, 36 | { 37 | "name": "panel_2", 38 | "type": "visualization", 39 | "id": "9aa7e210-02c4-11e9-b9ca-e74cd528e466" 40 | }, 41 | { 42 | "name": "panel_3", 43 | "type": "visualization", 44 | "id": "b9401780-02cc-11e9-b9ca-e74cd528e466" 45 | }, 46 | { 47 | "name": "panel_4", 48 | "type": "visualization", 49 | "id": "43d40e00-02ce-11e9-b9ca-e74cd528e466" 50 | }, 51 | { 52 | "name": "panel_5", 53 | "type": "visualization", 54 | "id": "57bf6670-1e27-11e9-8bbb-ad563247230c" 55 | }, 56 | { 57 | "name": "panel_6", 58 | "type": "visualization", 59 | "id": "df93a9a0-2fa0-11e9-bf11-ede9e2ea677b" 60 | } 61 | ] 62 | }, 63 | { 64 | "_id": "92f07af0-02c4-11e9-b9ca-e74cd528e466", 65 | "_type": "visualization", 66 | "_source": { 67 | "title": "[Java] Heap", 68 | "visState": "{\"title\":\"[Java] Heap\",\"type\":\"metrics\",\"params\":{\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"type\":\"timeseries\",\"series\":[{\"id\":\"02a061d0-02a7-11e9-9672-8582a8f38730\",\"color\":\"#68BC00\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"02a088e0-02a7-11e9-9672-8582a8f38730\",\"type\":\"avg\",\"field\":\"jvm.memory.heap.used\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"bytes\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"label\":\"used\"},{\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"color\":\"#68BC00\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"type\":\"avg\",\"field\":\"jvm.memory.heap.committed\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"bytes\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":\"0\",\"stacked\":\"none\",\"label\":\"commited\"},{\"id\":\"eed36990-02a6-11e9-9672-8582a8f38730\",\"color\":\"#68BC00\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"eed36991-02a6-11e9-9672-8582a8f38730\",\"type\":\"avg\",\"field\":\"jvm.memory.heap.max\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"bytes\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":\"0\",\"stacked\":\"none\",\"label\":\"max\"}],\"time_field\":\"@timestamp\",\"index_pattern\":\"apm-*\",\"interval\":\"auto\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"axis_scale\":\"normal\",\"show_legend\":1,\"show_grid\":1,\"filter\":\"processor.event : \\\"metric\\\"\"},\"aggs\":[]}", 69 | "uiStateJSON": "{}", 70 | "description": "", 71 | "version": 1, 72 | "kibanaSavedObjectMeta": { 73 | "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}" 74 | } 75 | }, 76 | "_migrationVersion": { 77 | "visualization": "7.0.0" 78 | }, 79 | "_references": [] 80 | }, 81 | { 82 | "_id": "b9401780-02cc-11e9-b9ca-e74cd528e466", 83 | "_type": "visualization", 84 | "_source": { 85 | "title": "System Memory Usage", 86 | "visState": "{\"title\":\"System Memory Usage\",\"type\":\"metrics\",\"params\":{\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"type\":\"timeseries\",\"series\":[{\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"color\":\"#68BC00\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"type\":\"avg\",\"field\":\"system.memory.total\"},{\"id\":\"eea38020-02cb-11e9-9672-8582a8f38730\",\"type\":\"avg\",\"field\":\"system.memory.actual.free\"},{\"script\":\"(params.total - params.free)/params.total\",\"lag\":\"\",\"id\":\"fb67c7d0-02cb-11e9-9672-8582a8f38730\",\"type\":\"math\",\"field\":\"eea38020-02cb-11e9-9672-8582a8f38730\",\"variables\":[{\"id\":\"41128ef0-02cc-11e9-9672-8582a8f38730\",\"field\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"name\":\"total\"},{\"id\":\"46e49440-02cc-11e9-9672-8582a8f38730\",\"field\":\"eea38020-02cb-11e9-9672-8582a8f38730\",\"name\":\"free\"}]}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"percent\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"label\":\"Memory Usage\"}],\"time_field\":\"@timestamp\",\"index_pattern\":\"apm-*\",\"interval\":\"auto\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"axis_scale\":\"normal\",\"show_legend\":1,\"show_grid\":1,\"filter\":\"processor.event: \\\"metric\\\"\"},\"aggs\":[]}", 87 | "uiStateJSON": "{}", 88 | "description": "", 89 | "version": 1, 90 | "kibanaSavedObjectMeta": { 91 | "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}" 92 | } 93 | }, 94 | "_migrationVersion": { 95 | "visualization": "7.0.0" 96 | }, 97 | "_references": [] 98 | }, 99 | { 100 | "_id": "43d40e00-02ce-11e9-b9ca-e74cd528e466", 101 | "_type": "visualization", 102 | "_source": { 103 | "title": "Memory", 104 | "visState": "{\"title\":\"Memory\",\"type\":\"metrics\",\"params\":{\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"type\":\"timeseries\",\"series\":[{\"id\":\"a03e75f0-02cd-11e9-9672-8582a8f38730\",\"color\":\"#68BC00\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"a03e75f1-02cd-11e9-9672-8582a8f38730\",\"type\":\"avg\",\"field\":\"system.memory.total\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"bytes\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"label\":\"System total mem.\"},{\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"color\":\"#68BC00\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"type\":\"avg\",\"field\":\"system.memory.actual.free\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"bytes\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"label\":\"System avail. mem.\"},{\"id\":\"a64c4bc0-02cd-11e9-9672-8582a8f38730\",\"color\":\"#68BC00\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"a64c4bc1-02cd-11e9-9672-8582a8f38730\",\"type\":\"avg\",\"field\":\"system.process.memory.rss.bytes\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"bytes\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"label\":\"Process RSS\"},{\"id\":\"b144d420-02cd-11e9-9672-8582a8f38730\",\"color\":\"#68BC00\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"b144d421-02cd-11e9-9672-8582a8f38730\",\"type\":\"avg\",\"field\":\"system.process.memory.size\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"bytes\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"label\":\"Process virtual mem.\"}],\"time_field\":\"@timestamp\",\"index_pattern\":\"apm-*\",\"interval\":\"auto\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"axis_scale\":\"normal\",\"show_legend\":1,\"show_grid\":1,\"filter\":\"processor.event: \\\"metric\\\"\"},\"aggs\":[]}", 105 | "uiStateJSON": "{}", 106 | "description": "", 107 | "version": 1, 108 | "kibanaSavedObjectMeta": { 109 | "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}" 110 | } 111 | }, 112 | "_migrationVersion": { 113 | "visualization": "7.0.0" 114 | }, 115 | "_references": [] 116 | }, 117 | { 118 | "_id": "9aa7e210-02c4-11e9-b9ca-e74cd528e466", 119 | "_type": "visualization", 120 | "_source": { 121 | "title": "[Java] Non Heap", 122 | "visState": "{\"title\":\"[Java] Non Heap\",\"type\":\"metrics\",\"params\":{\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"type\":\"timeseries\",\"series\":[{\"id\":\"02a061d0-02a7-11e9-9672-8582a8f38730\",\"color\":\"#68BC00\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"02a088e0-02a7-11e9-9672-8582a8f38730\",\"type\":\"avg\",\"field\":\"jvm.memory.non_heap.used\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"bytes\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"label\":\"used\"},{\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"color\":\"#68BC00\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"type\":\"avg\",\"field\":\"jvm.memory.non_heap.committed\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"bytes\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":\"0\",\"stacked\":\"none\",\"label\":\"commited\"},{\"id\":\"eed36990-02a6-11e9-9672-8582a8f38730\",\"color\":\"#68BC00\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"eed36991-02a6-11e9-9672-8582a8f38730\",\"type\":\"avg\",\"field\":\"jvm.memory.non_heap.max\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"bytes\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":\"0\",\"stacked\":\"none\",\"label\":\"max\"}],\"time_field\":\"@timestamp\",\"index_pattern\":\"apm-*\",\"interval\":\"auto\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"axis_scale\":\"normal\",\"show_legend\":1,\"show_grid\":1,\"filter\":\"processor.event : \\\"metric\\\"\",\"axis_min\":\"0\"},\"aggs\":[]}", 123 | "uiStateJSON": "{}", 124 | "description": "", 125 | "version": 1, 126 | "kibanaSavedObjectMeta": { 127 | "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}" 128 | } 129 | }, 130 | "_migrationVersion": { 131 | "visualization": "7.0.0" 132 | }, 133 | "_references": [] 134 | }, 135 | { 136 | "_id": "4108c030-02a6-11e9-b9ca-e74cd528e466", 137 | "_type": "visualization", 138 | "_source": { 139 | "title": "[Java] Heap Allocations", 140 | "visState": "{\"title\":\"[Java] Heap Allocations\",\"type\":\"metrics\",\"params\":{\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"type\":\"timeseries\",\"series\":[{\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"color\":\"#68BC00\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"type\":\"avg\",\"field\":\"jvm.gc.alloc\"},{\"unit\":\"\",\"id\":\"af7683f0-02a5-11e9-9672-8582a8f38730\",\"type\":\"derivative\",\"field\":\"61ca57f2-469d-11e7-af02-69e470af7417\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"bytes\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"filter\":\"\",\"label\":\"allocations\"}],\"time_field\":\"@timestamp\",\"index_pattern\":\"apm-*\",\"interval\":\"auto\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"axis_scale\":\"normal\",\"show_legend\":1,\"show_grid\":1,\"filter\":\"processor.event : \\\"metric\\\"\",\"axis_min\":\"0\"},\"aggs\":[]}", 141 | "uiStateJSON": "{}", 142 | "description": "", 143 | "version": 1, 144 | "kibanaSavedObjectMeta": { 145 | "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}" 146 | } 147 | }, 148 | "_migrationVersion": { 149 | "visualization": "7.0.0" 150 | }, 151 | "_references": [] 152 | }, 153 | { 154 | "_id": "57bf6670-1e27-11e9-8bbb-ad563247230c", 155 | "_type": "visualization", 156 | "_source": { 157 | "title": "[Java] GC", 158 | "visState": "{\"title\":\"[Java] GC\",\"type\":\"metrics\",\"params\":{\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"type\":\"timeseries\",\"series\":[{\"id\":\"02a061d0-02a7-11e9-9672-8582a8f38730\",\"color\":\"#68BC00\",\"split_mode\":\"terms\",\"metrics\":[{\"id\":\"02a088e0-02a7-11e9-9672-8582a8f38730\",\"type\":\"avg\",\"field\":\"jvm.gc.time\"},{\"unit\":\"\",\"id\":\"047b5460-1e27-11e9-8085-1bafc9077169\",\"type\":\"derivative\",\"field\":\"02a088e0-02a7-11e9-9672-8582a8f38730\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"ms,ms,2\",\"chart_type\":\"bar\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"label\":\"GC Time\",\"terms_field\":\"labels.name\",\"value_template\":\"{{value}} ms\"}],\"time_field\":\"@timestamp\",\"index_pattern\":\"apm-*\",\"interval\":\"auto\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"axis_scale\":\"normal\",\"show_legend\":1,\"show_grid\":1,\"filter\":\"processor.event : \\\"metric\\\"\",\"axis_min\":\"0\"},\"aggs\":[]}", 159 | "uiStateJSON": "{}", 160 | "description": "", 161 | "version": 1, 162 | "kibanaSavedObjectMeta": { 163 | "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}" 164 | } 165 | }, 166 | "_migrationVersion": { 167 | "visualization": "7.0.0" 168 | }, 169 | "_references": [] 170 | }, 171 | { 172 | "_id": "df93a9a0-2fa0-11e9-bf11-ede9e2ea677b", 173 | "_type": "visualization", 174 | "_source": { 175 | "title": "Service Host Environment Controls", 176 | "visState": "{\"title\":\"Service Host Environment Controls\",\"type\":\"input_control_vis\",\"params\":{\"controls\":[{\"id\":\"1550070167115\",\"indexPattern\":\"apm-*\",\"fieldName\":\"service.name\",\"parent\":\"\",\"label\":\"Services\",\"type\":\"list\",\"options\":{\"type\":\"terms\",\"multiselect\":true,\"dynamicOptions\":true,\"size\":5,\"order\":\"desc\"}},{\"id\":\"1550070196624\",\"indexPattern\":\"apm-*\",\"fieldName\":\"host.name\",\"parent\":\"\",\"label\":\"Host\",\"type\":\"list\",\"options\":{\"type\":\"terms\",\"multiselect\":true,\"dynamicOptions\":true,\"size\":5,\"order\":\"desc\"}},{\"id\":\"1550070239914\",\"indexPattern\":\"apm-*\",\"fieldName\":\"service.environment\",\"parent\":\"\",\"label\":\"Environment\",\"type\":\"list\",\"options\":{\"type\":\"terms\",\"multiselect\":true,\"dynamicOptions\":true,\"size\":5,\"order\":\"desc\"}}],\"updateFiltersOnChange\":false,\"useTimeFilter\":false,\"pinFilters\":false},\"aggs\":[]}", 177 | "uiStateJSON": "{}", 178 | "description": "", 179 | "version": 1, 180 | "kibanaSavedObjectMeta": { 181 | "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filter\":[]}" 182 | } 183 | }, 184 | "_migrationVersion": { 185 | "visualization": "7.0.0" 186 | }, 187 | "_references": [] 188 | } 189 | ] -------------------------------------------------------------------------------- /apm-agent-java/dashboards/readme.md: -------------------------------------------------------------------------------- 1 | ## Java Dashboards and Visualizations 2 | 3 | A Kibana dashboard displays a collection of visualizations and searches. 4 | This is a collection of dashboards, visualizations, and searches that you can use to organize and view your Elastic APM Java Agent data. 5 | 6 | ### Installation 7 | 8 | Dashboards are imported on the **Management > Saved objects** page. Full documentation on this process is available in [Kibana](https://www.elastic.co/guide/en/kibana/current/managing-saved-objects.html). 9 | 10 | After importing, visit the [Dashboard](https://www.elastic.co/guide/en/kibana/current/dashboard.html) tab to view and edit your imported dashboards. 11 | 12 | ### Dashboards 13 | 14 | [**java_metrics_dashboard_6.x.json**](java_metrics_dashboard_6.x.json) (when using APM Server 6.x) 15 | [**java_metrics_dashboard_7.x.json**](java_metrics_dashboard_7.x.json) (when using APM Server 7.x) 16 | 17 | * Heap Allocations 18 | * Heap (used, committed, max) 19 | * Non-Heap (used, committed, max) 20 | * System memory 21 | * GC 22 | 23 | ![java_dashboard](https://user-images.githubusercontent.com/2163464/52721458-00731a80-2faa-11e9-824c-89224b01f895.png) 24 | -------------------------------------------------------------------------------- /apm-agent-java/frameworks/grails3/README.md: -------------------------------------------------------------------------------- 1 | # Simple integration between Grails and Elastic APM 2 | 3 | ## Add dependency to apm-agent-api 4 | 5 | Replace `1.12.0` with the current/required agent version. 6 | ``` 7 | dependencies { 8 | compile "co.elastic.apm:apm-agent-api:1.12.0" 9 | } 10 | ``` 11 | 12 | ## Add Interceptor to application 13 | 14 | Create an interceptor in `grails-app/controllers`, for example `ApmInterceptor.groovy`. 15 | 16 | ``` 17 | import co.elastic.apm.api.ElasticApm 18 | 19 | class ApmInterceptor { 20 | 21 | ApmInterceptor() { 22 | matchAll() 23 | } 24 | 25 | boolean before() { 26 | ElasticApm.currentTransaction().setName(String.format("%s/%s", controllerName, actionName)) 27 | true 28 | } 29 | 30 | boolean after() { true } 31 | 32 | void afterView() { 33 | // no-op 34 | } 35 | } 36 | ``` 37 | 38 | ## Compile, package and run the application with agent 39 | 40 | For example, when running application with `./gradlew bootRun`, in `build.gradle`: 41 | Replace elastic agent jar path in `build.gradle`, and provide suitable Elastic APM server URL. 42 | ``` 43 | bootRun { 44 | jvmArgs = [ 45 | "-javaagent:/path/to/elastic/agent/elastic-apm-agent-1.12.0.jar", 46 | "-Delastic.apm.server_url=http://localhost:8200", 47 | "-Delastic.apm.service_name=grails-app" 48 | ] 49 | } 50 | ``` 51 | 52 | For other deployment options, refer to Elastic APM documentation. 53 | -------------------------------------------------------------------------------- /apm-agent-java/frameworks/servlet2/ApmServletFilter.java: -------------------------------------------------------------------------------- 1 | import co.elastic.apm.api.ElasticApm; 2 | import co.elastic.apm.api.HeaderExtractor; 3 | import co.elastic.apm.api.Scope; 4 | import co.elastic.apm.api.Transaction; 5 | 6 | import javax.servlet.Filter; 7 | import javax.servlet.FilterChain; 8 | import javax.servlet.FilterConfig; 9 | import javax.servlet.ServletException; 10 | import javax.servlet.ServletRequest; 11 | import javax.servlet.ServletResponse; 12 | import javax.servlet.http.HttpServletRequest; 13 | import java.io.IOException; 14 | 15 | /** 16 | * This filter allows to capture transactions with Servlet 2.x that aren't instrumented automatically. 17 | *
18 | * It needs to be set first in the filter chain to properly wrap all requests. 19 | */ 20 | public class ApmServletFilter implements Filter { 21 | 22 | private static class ServletHeaderExtractor implements HeaderExtractor { 23 | 24 | private final HttpServletRequest request; 25 | 26 | public ServletHeaderExtractor(HttpServletRequest request) { 27 | this.request = request; 28 | } 29 | 30 | @Override 31 | public String getFirstHeader(String headerName) { 32 | return request.getHeader(headerName); 33 | } 34 | } 35 | 36 | @Override 37 | public void init(FilterConfig filterConfig) throws ServletException { 38 | // nothing to do 39 | } 40 | 41 | @Override 42 | public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { 43 | 44 | HttpServletRequest httpRequest = (HttpServletRequest) servletRequest; 45 | 46 | // using the 'remote parent' will make transaction inherit upstream transaction, if any. 47 | Transaction transaction = ElasticApm.startTransactionWithRemoteParent(new ServletHeaderExtractor(httpRequest)); 48 | 49 | // use servlet path as transaction name 50 | String name = httpRequest.getServletPath(); 51 | transaction.setName(name); 52 | 53 | Scope scope = transaction.activate(); 54 | try { 55 | // execute the request as usual 56 | filterChain.doFilter(servletRequest, servletResponse); 57 | } finally { 58 | scope.close(); 59 | } 60 | 61 | } 62 | 63 | @Override 64 | public void destroy() { 65 | // nothing to do 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /apm-agent-java/frameworks/wicket/WicketAjaxAPMFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Elastic and contributors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package co.elastic.apm.contrib.wicket; 17 | 18 | import co.elastic.apm.api.ElasticApm; 19 | import org.slf4j.Logger; 20 | import org.slf4j.LoggerFactory; 21 | 22 | import javax.servlet.Filter; 23 | import javax.servlet.FilterChain; 24 | import javax.servlet.FilterConfig; 25 | import javax.servlet.ServletException; 26 | import javax.servlet.ServletRequest; 27 | import javax.servlet.ServletResponse; 28 | import javax.servlet.http.HttpServletRequest; 29 | import java.io.IOException; 30 | import java.util.regex.Pattern; 31 | 32 | /** 33 | * A servlet filter that intercepts Wicket AJAX requests to set valid names of Elastic APM transactions. 34 | * The transaction name consists of a resource path without resource ID, Wicket Ajax listener ID 35 | * and the associated Wicket component ID. E.g.: example/path/to/resource:IBehaviorListener.0-example_component_id 36 | * 37 | * @author Martin Dindoffer 38 | */ 39 | public class WicketAjaxAPMFilter implements Filter { 40 | 41 | private static final Logger LOG = LoggerFactory.getLogger(WicketAjaxAPMFilter.class); 42 | private static final Pattern RESOURCE_ID_PATTERN = Pattern.compile("/\\d+"); 43 | private static final char APM_PATH_DELIMITER = ':'; 44 | private static final char WICKET_COMPONENT_DELIMITER = '-'; 45 | private static final char QUERY_PARAM_DELIMITER = '&'; 46 | private static final char WICKET_INTERFACE_PREFIX = 'I'; 47 | private static final char TILDE_CHAR = '~'; 48 | private static final char UNDERSCORE_CHAR = '_'; 49 | 50 | @Override 51 | public void init(FilterConfig filterConfig) throws ServletException { 52 | } 53 | 54 | @Override 55 | public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) 56 | throws IOException, ServletException { 57 | HttpServletRequest httpRequest = (HttpServletRequest) request; 58 | String query = httpRequest.getQueryString(); 59 | if ((query != null) && containsWicketListener(query)) { 60 | String resourcePath = removeFirstChar(stripResourceIDs(extractResourcePath(httpRequest))); 61 | String wicketIdentifier = encodeTildesForKibanaWorkaround(stripParentComponents(extractWicketComponentPath(query))); 62 | 63 | String transactionName = resourcePath + APM_PATH_DELIMITER + wicketIdentifier; 64 | LOG.trace("AJAX transaction name: {}", transactionName); 65 | ElasticApm.currentTransaction().setName(transactionName); 66 | } 67 | chain.doFilter(request, response); 68 | } 69 | 70 | /** 71 | * Checks whether the query string mentions one of Wicket AJAX listeners. 72 | * 73 | * @param queryString a query string 74 | * @return true if the string contains an AJAX listener, false otherwise 75 | */ 76 | private static boolean containsWicketListener(String queryString) { 77 | return queryString.contains("IResourceListener") 78 | || queryString.contains("IBehaviorListener") 79 | || queryString.contains("ILinkListener") 80 | || queryString.contains("IOnChangeListener") 81 | || queryString.contains("IFormSubmitListener"); 82 | } 83 | 84 | /** 85 | * Extracts a "Resource" path from an http request. Resource path consists of servletPath and pathInfo, 86 | * i.e. omits the contextPath, since that would not provide much relevance. 87 | * 88 | * @param httpRequest HTTP request to process 89 | * @return extracted resource path 90 | */ 91 | private static String extractResourcePath(HttpServletRequest httpRequest) { 92 | String pathInfo = httpRequest.getPathInfo(); 93 | return (pathInfo == null) ? httpRequest.getServletPath() : (httpRequest.getServletPath() + pathInfo); 94 | } 95 | 96 | /** 97 | * Removes numeric resource identifiers from a resource path / URL. 98 | * 99 | * @param resourcePath a resource path to process 100 | * @return a resource path without resource identifiers 101 | */ 102 | private static String stripResourceIDs(String resourcePath) { 103 | return RESOURCE_ID_PATTERN.matcher(resourcePath).replaceAll(""); 104 | } 105 | 106 | /** 107 | * Removes a first char from a string. 108 | * 109 | * @param request string to remove from 110 | * @return string without a first char 111 | */ 112 | private static String removeFirstChar(String request) { 113 | return request.substring(1); 114 | } 115 | 116 | /** 117 | * Extracts a wicket component path parameter pointing to target AJAX component from the HTTP query. 118 | * 119 | * @param query query string to process 120 | * @return component path parameter 121 | */ 122 | private static String extractWicketComponentPath(String query) { 123 | int firstAmpIndex = query.indexOf(QUERY_PARAM_DELIMITER); 124 | int firstIIndex = query.indexOf(WICKET_INTERFACE_PREFIX); 125 | return (firstAmpIndex > 0) ? query.substring(firstIIndex, firstAmpIndex) : query.substring(firstIIndex); 126 | } 127 | 128 | /** 129 | * Removes Wicket parent hierarchy from a component path and leaves only the listener and target component ID. 130 | * 131 | * @param componentPath Wicket component path to process 132 | * @return Wicket AJAX listener identifier without parent hierarchy 133 | */ 134 | private static String stripParentComponents(String componentPath) { 135 | int firstDashIndex = componentPath.indexOf(WICKET_COMPONENT_DELIMITER); 136 | int lastDashIndex = componentPath.lastIndexOf(WICKET_COMPONENT_DELIMITER); 137 | return componentPath.substring(0, firstDashIndex) + componentPath.substring(lastDashIndex); 138 | } 139 | 140 | /** 141 | * Replace all tildes in wicket component identifier with underscores. This is a workaround for Kibana's special 142 | * handling of the tilde character, that gets replaced by the '%' sign in javascript, resulting in an invalid URI. 143 | * 144 | * @param wicketIdentifier wicket component identifier 145 | * @return encoded component identifier 146 | * @see https://github.com/elastic/kibana/issues/24892 147 | */ 148 | private static String encodeTildesForKibanaWorkaround(String wicketIdentifier) { 149 | return wicketIdentifier.replace(TILDE_CHAR, UNDERSCORE_CHAR); 150 | } 151 | 152 | @Override 153 | public void destroy() { 154 | } 155 | } 156 | -------------------------------------------------------------------------------- /apm-agent-java/log-ingest/.env: -------------------------------------------------------------------------------- 1 | # APM agent 2 | apm_server_url= 3 | apm_secret_token= 4 | 5 | # filebeat 6 | elasticsearch_host= 7 | cloud_id= 8 | cloud_auth= 9 | -------------------------------------------------------------------------------- /apm-agent-java/log-ingest/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | *.iml 3 | .env 4 | -------------------------------------------------------------------------------- /apm-agent-java/log-ingest/00-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.9' 2 | 3 | services: 4 | 5 | app: 6 | container_name: logs-app-00 7 | build: ./app 8 | ports: 9 | - '8080:8080' 10 | 11 | client: 12 | container_name: logs-client-00 13 | build: ./client 14 | environment: 15 | BASE_URL: 'http://logs-app-00:8080' 16 | 17 | -------------------------------------------------------------------------------- /apm-agent-java/log-ingest/01-app-logging.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /apm-agent-java/log-ingest/01-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.9' 2 | 3 | services: 4 | 5 | app: 6 | container_name: logs-app-01 7 | build: ./app 8 | ports: 9 | - '8081:8080' 10 | volumes: 11 | - shared-volume-01:/var/log/app/ 12 | - ./01-app-logging.xml:/app-logging.xml 13 | environment: 14 | # Application: use custom log config + log to file 15 | LOGGING_CONFIG: /app-logging.xml 16 | LOGGING_FILE_NAME: /var/log/app/app.log 17 | # APM agent configuration & credentials provided from .env file 18 | ELASTIC_APM_SERVER_URL: "${apm_server_url}" 19 | ELASTIC_APM_SECRET_TOKEN: "${apm_secret_token}" 20 | # APM agent static configuration 21 | ELASTIC_APM_SERVICE_NAME: app-01 22 | ELASTIC_APM_ENVIRONMENT: dev 23 | ELASTIC_APM_CLOUD_PROVIDER: none 24 | 25 | client: 26 | container_name: logs-client-01 27 | build: ./client 28 | environment: 29 | BASE_URL: 'http://logs-app-01:8080' 30 | 31 | filebeat: 32 | container_name: logs-filebeat-01 33 | build: 34 | context: ./filebeat 35 | args: 36 | ELASTIC_STACK_VERSION: '8.6.2' 37 | volumes: 38 | - shared-volume-01:/var/log/app/ 39 | - ./01-filebeat.yml:/usr/share/filebeat/filebeat.yml 40 | environment: 41 | # authentication, values provided through .env file 42 | elasticsearch_host: "${elasticsearch_host}" 43 | cloud_id: "${cloud_id}" 44 | cloud_auth: "${cloud_auth}" 45 | # path to log file 46 | app_log: /var/log/app/app.log 47 | # name of the service, should be equal to ELASTIC_APM_SERVICE_NAME 48 | service_name: app-01 49 | # environment of the service, should be equal to ELASTIC_APM_ENVIRONMENT 50 | service_environment: dev 51 | 52 | volumes: 53 | shared-volume-01: 54 | 55 | networks: 56 | network-01: 57 | -------------------------------------------------------------------------------- /apm-agent-java/log-ingest/01-filebeat.yml: -------------------------------------------------------------------------------- 1 | 2 | # ============================== Filebeat inputs =============================== 3 | 4 | filebeat.inputs: 5 | 6 | - type: filestream 7 | id: 01-plaintext-filestream 8 | enabled: true 9 | paths: 10 | - ${app_log} 11 | parsers: 12 | - multiline: 13 | type: pattern 14 | pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}' 15 | negate: true 16 | match: after 17 | # add service fields 18 | fields_under_root: true 19 | fields: 20 | service.name: ${service_name} 21 | service.environment: ${service_environment} 22 | event.dataset: ${service_name} 23 | 24 | # =============================== Elastic Cloud ================================ 25 | 26 | cloud.id: "${cloud_id:CHANGEME}" 27 | cloud.auth: "${cloud_auth:CHANGEME}" 28 | 29 | # ================================== Outputs =================================== 30 | 31 | output.elasticsearch: 32 | hosts: [ "https://${elasticsearch_host:CHANGEME}" ] 33 | pipeline: log-ingest-plaintext 34 | 35 | # ================================= Processors ================================= 36 | processors: 37 | - add_host_metadata: 38 | when.not.contains.tags: forwarded 39 | - add_cloud_metadata: ~ 40 | - add_docker_metadata: ~ 41 | - add_kubernetes_metadata: ~ 42 | -------------------------------------------------------------------------------- /apm-agent-java/log-ingest/02-app-logging.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /apm-agent-java/log-ingest/02-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.9' 2 | 3 | services: 4 | 5 | app: 6 | container_name: logs-app-02 7 | build: ./app 8 | ports: 9 | - '8082:8080' 10 | volumes: 11 | - shared-volume-02:/var/log/app/ 12 | - ./02-app-logging.xml:/app-logging.xml 13 | environment: 14 | # Application: use custom log config 15 | LOGGING_CONFIG: /app-logging.xml 16 | # Application ECS logging configuration (the .json suffix is added by ECS_JSON_APPENDER) 17 | # the service name defaults to 'spring-boot-application' if not explicitly set 18 | LOG_FILE: /var/log/app/app.ecs 19 | SERVICE_NAME: app-02 20 | # APM agent configuration & credentials provided from .env file 21 | ELASTIC_APM_SERVER_URL: "${apm_server_url}" 22 | ELASTIC_APM_SECRET_TOKEN: "${apm_secret_token}" 23 | # APM agent static configuration 24 | ELASTIC_APM_SERVICE_NAME: app-02 25 | ELASTIC_APM_ENVIRONMENT: dev 26 | ELASTIC_APM_CLOUD_PROVIDER: none 27 | 28 | client: 29 | container_name: logs-client-02 30 | build: ./client 31 | environment: 32 | BASE_URL: 'http://logs-app-02:8080' 33 | 34 | filebeat: 35 | container_name: logs-filebeat-02 36 | build: 37 | context: ./filebeat 38 | args: 39 | ELASTIC_STACK_VERSION: '8.6.2' 40 | volumes: 41 | - shared-volume-02:/var/log/app/ 42 | - ./02-filebeat.yml:/usr/share/filebeat/filebeat.yml 43 | environment: 44 | # authentication, values provided through .env file 45 | elasticsearch_host: "${elasticsearch_host}" 46 | cloud_id: "${cloud_id}" 47 | cloud_auth: "${cloud_auth}" 48 | # path to log file 49 | app_log: /var/log/app/app.ecs.json 50 | 51 | volumes: 52 | shared-volume-02: 53 | -------------------------------------------------------------------------------- /apm-agent-java/log-ingest/02-filebeat.yml: -------------------------------------------------------------------------------- 1 | 2 | # ============================== Filebeat inputs =============================== 3 | 4 | filebeat.inputs: 5 | 6 | - type: filestream 7 | id: 02-ecs-filestream 8 | enabled: true 9 | paths: 10 | - ${app_log} 11 | parsers: 12 | - ndjson: 13 | overwrite_keys: true 14 | add_error_key: true 15 | expand_keys: true 16 | 17 | # =============================== Elastic Cloud ================================ 18 | 19 | cloud.id: "${cloud_id:CHANGEME}" 20 | cloud.auth: "${cloud_auth:CHANGEME}" 21 | 22 | # ================================== Outputs =================================== 23 | 24 | output.elasticsearch: 25 | hosts: [ "https://${elasticsearch_host:CHANGEME}" ] 26 | 27 | # ================================= Processors ================================= 28 | processors: 29 | - add_host_metadata: 30 | when.not.contains.tags: forwarded 31 | - add_cloud_metadata: ~ 32 | - add_docker_metadata: ~ 33 | - add_kubernetes_metadata: ~ 34 | -------------------------------------------------------------------------------- /apm-agent-java/log-ingest/03-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.9' 2 | 3 | services: 4 | 5 | app: 6 | container_name: logs-app-03 7 | build: ./app 8 | ports: 9 | - '8083:8080' 10 | volumes: 11 | - shared-volume-03:/var/log/app/ 12 | environment: 13 | # Application: log to file 14 | LOGGING_FILE_NAME: /var/log/app/app.log 15 | # APM agent configuration & credentials provided from .env file 16 | ELASTIC_APM_SERVER_URL: "${apm_server_url}" 17 | ELASTIC_APM_SECRET_TOKEN: "${apm_secret_token}" 18 | # APM agent static configuration 19 | ELASTIC_APM_SERVICE_NAME: app-03 20 | ELASTIC_APM_ENVIRONMENT: dev 21 | ELASTIC_APM_CLOUD_PROVIDER: none 22 | # enable agent ECS reformatting: app.log will be shaded into app.ecs.json 23 | ELASTIC_APM_LOG_ECS_REFORMATTING: shade 24 | ELASTIC_APM_LOG_ECS_REFORMATTING_DIR: /var/log/app 25 | 26 | client: 27 | container_name: logs-client-03 28 | build: ./client 29 | environment: 30 | BASE_URL: 'http://logs-app-03:8080' 31 | 32 | filebeat: 33 | container_name: logs-filebeat-03 34 | build: 35 | context: ./filebeat 36 | args: 37 | ELASTIC_STACK_VERSION: '8.6.2' 38 | volumes: 39 | - shared-volume-03:/var/log/app/ 40 | - ./03-filebeat.yml:/usr/share/filebeat/filebeat.yml 41 | environment: 42 | # authentication, values provided through .env file 43 | elasticsearch_host: "${elasticsearch_host}" 44 | cloud_id: "${cloud_id}" 45 | cloud_auth: "${cloud_auth}" 46 | # path to log file 47 | app_log: /var/log/app/app.ecs.json 48 | 49 | volumes: 50 | shared-volume-03: 51 | -------------------------------------------------------------------------------- /apm-agent-java/log-ingest/03-filebeat.yml: -------------------------------------------------------------------------------- 1 | 2 | # ============================== Filebeat inputs =============================== 3 | 4 | filebeat.inputs: 5 | 6 | - type: filestream 7 | id: 03-ecs-filestream 8 | enabled: true 9 | paths: 10 | - ${app_log} 11 | parsers: 12 | - ndjson: 13 | overwrite_keys: true 14 | add_error_key: true 15 | expand_keys: true 16 | 17 | # =============================== Elastic Cloud ================================ 18 | 19 | cloud.id: "${cloud_id:CHANGEME}" 20 | cloud.auth: "${cloud_auth:CHANGEME}" 21 | 22 | # ================================== Outputs =================================== 23 | 24 | output.elasticsearch: 25 | hosts: [ "https://${elasticsearch_host:CHANGEME}" ] 26 | 27 | # ================================= Processors ================================= 28 | processors: 29 | - add_host_metadata: 30 | when.not.contains.tags: forwarded 31 | - add_cloud_metadata: ~ 32 | - add_docker_metadata: ~ 33 | - add_kubernetes_metadata: ~ 34 | -------------------------------------------------------------------------------- /apm-agent-java/log-ingest/04-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.9' 2 | 3 | services: 4 | 5 | app: 6 | container_name: logs-app-04 7 | build: ./app 8 | ports: 9 | - '8084:8080' 10 | environment: 11 | # APM agent configuration & credentials provided from .env file 12 | ELASTIC_APM_SERVER_URL: "${apm_server_url}" 13 | ELASTIC_APM_SECRET_TOKEN: "${apm_secret_token}" 14 | # APM agent static configuration 15 | ELASTIC_APM_SERVICE_NAME: app-04 16 | ELASTIC_APM_ENVIRONMENT: dev 17 | ELASTIC_APM_CLOUD_PROVIDER: none 18 | # just send the logs 19 | ELASTIC_APM_LOG_SENDING: 'true' 20 | 21 | client: 22 | container_name: logs-client-04 23 | build: ./client 24 | environment: 25 | BASE_URL: 'http://logs-app-04:8080' 26 | -------------------------------------------------------------------------------- /apm-agent-java/log-ingest/05-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.9' 2 | 3 | services: 4 | 5 | app: 6 | container_name: logs-app-05 7 | build: ./app 8 | ports: 9 | - '8085:8080' 10 | environment: 11 | OTEL_RESOURCE_ATTRIBUTES: "service.name=app-05,service.version=1.0,deployment.environment=dev" 12 | OTEL_EXPORTER_OTLP_ENDPOINT: "${apm_server_url}" 13 | OTEL_EXPORTER_OTLP_HEADERS: "Authorization=Bearer ${apm_secret_token}" 14 | OTEL_TRACES_EXPORTER: "otlp" 15 | OTEL_METRICS_EXPORTER: "otlp" 16 | OTEL_LOGS_EXPORTER: "otlp" 17 | 18 | client: 19 | container_name: logs-client-05 20 | build: ./client 21 | environment: 22 | BASE_URL: 'http://logs-app-05:8080' 23 | -------------------------------------------------------------------------------- /apm-agent-java/log-ingest/README.md: -------------------------------------------------------------------------------- 1 | The goal of this subfolder is to provide end-to-end examples for java application logs ingestion. 2 | 3 | ## Requirements 4 | - docker 5 | - docker-compose 6 | - an Elastic stack deployment with APM, examples are provided assuming an Elastic Cloud for simplicity. 7 | 8 | ## Configuration 9 | 10 | The following configuration has to be provided through `.env` file in the current directory. 11 | It will also be used with `curl` to configure ingest pipelines if needed. 12 | 13 | ``` 14 | # Filebeat configuration 15 | # 'outpout.elasticsearch.hosts' 16 | export elasticsearch_host=xxxxxxxx.es.yyyyyyyyyyyy.zzz.cloud.es.io 17 | # 'cloud.id' 18 | export cloud_id= 19 | # 'cloud.auth' 20 | export cloud_auth=elastic:XXXXXXXXXXXXXXXXXXXXXXXX 21 | 22 | # APM agent configuration 23 | export apm_server_url= 24 | 25 | ELASTIC_APM_SECRET_TOKEN=DmuzZ2SoDz3Bx5snv6 26 | ELASTIC_APM_SERVER_URL=https://blindpotatoes.apm.europe-west1.gcp.cloud.es.io 27 | export apm_secret_token= 28 | ``` 29 | 30 | ## Components 31 | 32 | In addition to the Elastic stack, there are 3 main components: 33 | - `app` : a Spring Boot application that produces some logs 34 | - `client` : a shell script that simulates some traffic on the application 35 | - `filebeat` : filebeat + setup ingest pipelines if needed 36 | 37 | All of the above are deployed in separate containers, but it is not a requirement. 38 | The `filebeat` and `app` containers use a shared volume to respectively read and write the application logs. 39 | 40 | The ingestion strategy used here is file-based in order to make it easier to understand and debug. 41 | That means the application writes to log files and Filebeat reads and ingest those into Elasticsearch, those log files 42 | can thus be easily open for inspection. 43 | 44 | In general, when using Docker or Kubernetes deployments the recommended approach is to make applications write their 45 | logs to the standard output and use Filebeat [autodiscover](https://www.elastic.co/guide/en/beats/filebeat/current/configuration-autodiscover.html) feature to ingest this standard output into Elasticsearch, which removes the need to write to files. 46 | 47 | The application image already contains the following to allow reusing the same image on all scenarios: 48 | - `ecs-logging-java` as an application dependency: not used by default, allows to configure ECS logging at deployment time through re-configuration. 49 | - Elastic Java APM Agent, the `/agent.jar` in image contains a copy of the Java agent. In the application entrypoint script, the `-javaagent:/agent.jar` parameter is added when `ELASTIC_APM_SERVICE_NAME` environment variable is set. 50 | 51 | ## Scenarios 52 | 53 | ### Base (00) 54 | 55 | This is the base application deployment before trying to ingest logs. 56 | Only the `app` and `client` containers are used, Filebeat and the Elastic stack is not used. 57 | The Java APM agent is not enabled. 58 | 59 | ``` 60 | ./build-and-run.sh 00 61 | ``` 62 | 63 | ### Plain-text logs (01) 64 | 65 | Application plaintext logging format is modified to include the correlation IDs. 66 | Logging is configured by `01-app-logging.xml`. 67 | 68 | APM agent injects the log correlation IDs at runtime. 69 | 70 | Filebeat is configured to send the plaintext log file (see `01-filebeat.yml` for details). 71 | 72 | ``` 73 | ./build-and-run.sh 01 74 | ``` 75 | 76 | ### ECS Logging (02) 77 | 78 | Application logging format is modified to use the ECS logging library. 79 | The ECS logging library had been previously added into the application, but wasn't used. 80 | Logging is configured by `02-app-logging.xml`. 81 | 82 | APM agent injects the log correlation IDs at runtime (and also the `service.name` and `service.version` if they aren't provided). 83 | 84 | Filebeat is configured to send the ECS-JSON log file (see `02-filebeat.yml` for details). 85 | 86 | ``` 87 | ./build-and-run.sh 02 88 | ``` 89 | 90 | ### ECS Reformatting (03) 91 | 92 | Application logging configuration is not modified. 93 | 94 | APM agent re-formats the log output to ECS-JSON format and injects the log correlation IDs at runtime. 95 | 96 | Filebeat is configured to send the ECS-JSON log file (see `03-filebeat.yml` for details). 97 | 98 | ``` 99 | ./build-and-run.sh 03 100 | ``` 101 | 102 | ### Log sending (04) 103 | 104 | Application and its configuration are not modified (besides the extra `-javaagent:` JVM argument and environment variables. 105 | 106 | APM agent sends the logs directly to APM server (without filebeat) and injects the log correlation IDs at runtime. 107 | 108 | ``` 109 | ./build-and-run.sh 04 110 | ``` 111 | 112 | ### Otel agent (05) 113 | 114 | Application and its configuration are not modified (besides the extra `-javaagent:` JVM argument and environment variables. 115 | 116 | Same as 04, but with the OpenTelemetry Java agent. 117 | 118 | ``` 119 | ./build-and-run.sh 05 120 | ``` 121 | -------------------------------------------------------------------------------- /apm-agent-java/log-ingest/app/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/apm-contrib/262d2704e2a7a2886795c82dea5385c9875ad022/apm-agent-java/log-ingest/app/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /apm-agent-java/log-ingest/app/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar 3 | -------------------------------------------------------------------------------- /apm-agent-java/log-ingest/app/Dockerfile: -------------------------------------------------------------------------------- 1 | # app build 2 | FROM maven:3.8.5-openjdk-17-slim AS build 3 | COPY src /home/app/src 4 | COPY pom.xml /home/app 5 | RUN mvn -q -f /home/app/pom.xml clean package 6 | 7 | 8 | # package 9 | FROM openjdk:17-ea-jdk 10 | COPY --from=build /home/app/target/app.jar /app.jar 11 | COPY --from=docker.elastic.co/observability/apm-agent-java:latest /usr/agent/elastic-apm-agent.jar /agent.jar 12 | RUN curl -L -o /otel-agent.jar https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.27.0/opentelemetry-javaagent.jar 13 | COPY ./run.sh /run.sh 14 | RUN chmod +x /run.sh 15 | 16 | EXPOSE 8080 17 | ENTRYPOINT ["/run.sh"] 18 | -------------------------------------------------------------------------------- /apm-agent-java/log-ingest/app/mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # https://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ] ; then 38 | 39 | if [ -f /usr/local/etc/mavenrc ] ; then 40 | . /usr/local/etc/mavenrc 41 | fi 42 | 43 | if [ -f /etc/mavenrc ] ; then 44 | . /etc/mavenrc 45 | fi 46 | 47 | if [ -f "$HOME/.mavenrc" ] ; then 48 | . "$HOME/.mavenrc" 49 | fi 50 | 51 | fi 52 | 53 | # OS specific support. $var _must_ be set to either true or false. 54 | cygwin=false; 55 | darwin=false; 56 | mingw=false 57 | case "`uname`" in 58 | CYGWIN*) cygwin=true ;; 59 | MINGW*) mingw=true;; 60 | Darwin*) darwin=true 61 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 62 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 63 | if [ -z "$JAVA_HOME" ]; then 64 | if [ -x "/usr/libexec/java_home" ]; then 65 | export JAVA_HOME="`/usr/libexec/java_home`" 66 | else 67 | export JAVA_HOME="/Library/Java/Home" 68 | fi 69 | fi 70 | ;; 71 | esac 72 | 73 | if [ -z "$JAVA_HOME" ] ; then 74 | if [ -r /etc/gentoo-release ] ; then 75 | JAVA_HOME=`java-config --jre-home` 76 | fi 77 | fi 78 | 79 | if [ -z "$M2_HOME" ] ; then 80 | ## resolve links - $0 may be a link to maven's home 81 | PRG="$0" 82 | 83 | # need this for relative symlinks 84 | while [ -h "$PRG" ] ; do 85 | ls=`ls -ld "$PRG"` 86 | link=`expr "$ls" : '.*-> \(.*\)$'` 87 | if expr "$link" : '/.*' > /dev/null; then 88 | PRG="$link" 89 | else 90 | PRG="`dirname "$PRG"`/$link" 91 | fi 92 | done 93 | 94 | saveddir=`pwd` 95 | 96 | M2_HOME=`dirname "$PRG"`/.. 97 | 98 | # make it fully qualified 99 | M2_HOME=`cd "$M2_HOME" && pwd` 100 | 101 | cd "$saveddir" 102 | # echo Using m2 at $M2_HOME 103 | fi 104 | 105 | # For Cygwin, ensure paths are in UNIX format before anything is touched 106 | if $cygwin ; then 107 | [ -n "$M2_HOME" ] && 108 | M2_HOME=`cygpath --unix "$M2_HOME"` 109 | [ -n "$JAVA_HOME" ] && 110 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 111 | [ -n "$CLASSPATH" ] && 112 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 113 | fi 114 | 115 | # For Mingw, ensure paths are in UNIX format before anything is touched 116 | if $mingw ; then 117 | [ -n "$M2_HOME" ] && 118 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 119 | [ -n "$JAVA_HOME" ] && 120 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 121 | fi 122 | 123 | if [ -z "$JAVA_HOME" ]; then 124 | javaExecutable="`which javac`" 125 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 126 | # readlink(1) is not available as standard on Solaris 10. 127 | readLink=`which readlink` 128 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 129 | if $darwin ; then 130 | javaHome="`dirname \"$javaExecutable\"`" 131 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 132 | else 133 | javaExecutable="`readlink -f \"$javaExecutable\"`" 134 | fi 135 | javaHome="`dirname \"$javaExecutable\"`" 136 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 137 | JAVA_HOME="$javaHome" 138 | export JAVA_HOME 139 | fi 140 | fi 141 | fi 142 | 143 | if [ -z "$JAVACMD" ] ; then 144 | if [ -n "$JAVA_HOME" ] ; then 145 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 146 | # IBM's JDK on AIX uses strange locations for the executables 147 | JAVACMD="$JAVA_HOME/jre/sh/java" 148 | else 149 | JAVACMD="$JAVA_HOME/bin/java" 150 | fi 151 | else 152 | JAVACMD="`\\unset -f command; \\command -v java`" 153 | fi 154 | fi 155 | 156 | if [ ! -x "$JAVACMD" ] ; then 157 | echo "Error: JAVA_HOME is not defined correctly." >&2 158 | echo " We cannot execute $JAVACMD" >&2 159 | exit 1 160 | fi 161 | 162 | if [ -z "$JAVA_HOME" ] ; then 163 | echo "Warning: JAVA_HOME environment variable is not set." 164 | fi 165 | 166 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 167 | 168 | # traverses directory structure from process work directory to filesystem root 169 | # first directory with .mvn subdirectory is considered project base directory 170 | find_maven_basedir() { 171 | 172 | if [ -z "$1" ] 173 | then 174 | echo "Path not specified to find_maven_basedir" 175 | return 1 176 | fi 177 | 178 | basedir="$1" 179 | wdir="$1" 180 | while [ "$wdir" != '/' ] ; do 181 | if [ -d "$wdir"/.mvn ] ; then 182 | basedir=$wdir 183 | break 184 | fi 185 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 186 | if [ -d "${wdir}" ]; then 187 | wdir=`cd "$wdir/.."; pwd` 188 | fi 189 | # end of workaround 190 | done 191 | echo "${basedir}" 192 | } 193 | 194 | # concatenates all lines of a file 195 | concat_lines() { 196 | if [ -f "$1" ]; then 197 | echo "$(tr -s '\n' ' ' < "$1")" 198 | fi 199 | } 200 | 201 | BASE_DIR=`find_maven_basedir "$(pwd)"` 202 | if [ -z "$BASE_DIR" ]; then 203 | exit 1; 204 | fi 205 | 206 | ########################################################################################## 207 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 208 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 209 | ########################################################################################## 210 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then 211 | if [ "$MVNW_VERBOSE" = true ]; then 212 | echo "Found .mvn/wrapper/maven-wrapper.jar" 213 | fi 214 | else 215 | if [ "$MVNW_VERBOSE" = true ]; then 216 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." 217 | fi 218 | if [ -n "$MVNW_REPOURL" ]; then 219 | jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 220 | else 221 | jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 222 | fi 223 | while IFS="=" read key value; do 224 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;; 225 | esac 226 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" 227 | if [ "$MVNW_VERBOSE" = true ]; then 228 | echo "Downloading from: $jarUrl" 229 | fi 230 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" 231 | if $cygwin; then 232 | wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` 233 | fi 234 | 235 | if command -v wget > /dev/null; then 236 | if [ "$MVNW_VERBOSE" = true ]; then 237 | echo "Found wget ... using wget" 238 | fi 239 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 240 | wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" 241 | else 242 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" 243 | fi 244 | elif command -v curl > /dev/null; then 245 | if [ "$MVNW_VERBOSE" = true ]; then 246 | echo "Found curl ... using curl" 247 | fi 248 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 249 | curl -o "$wrapperJarPath" "$jarUrl" -f 250 | else 251 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f 252 | fi 253 | 254 | else 255 | if [ "$MVNW_VERBOSE" = true ]; then 256 | echo "Falling back to using Java to download" 257 | fi 258 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" 259 | # For Cygwin, switch paths to Windows format before running javac 260 | if $cygwin; then 261 | javaClass=`cygpath --path --windows "$javaClass"` 262 | fi 263 | if [ -e "$javaClass" ]; then 264 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 265 | if [ "$MVNW_VERBOSE" = true ]; then 266 | echo " - Compiling MavenWrapperDownloader.java ..." 267 | fi 268 | # Compiling the Java class 269 | ("$JAVA_HOME/bin/javac" "$javaClass") 270 | fi 271 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 272 | # Running the downloader 273 | if [ "$MVNW_VERBOSE" = true ]; then 274 | echo " - Running MavenWrapperDownloader.java ..." 275 | fi 276 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") 277 | fi 278 | fi 279 | fi 280 | fi 281 | ########################################################################################## 282 | # End of extension 283 | ########################################################################################## 284 | 285 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 286 | if [ "$MVNW_VERBOSE" = true ]; then 287 | echo $MAVEN_PROJECTBASEDIR 288 | fi 289 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 290 | 291 | # For Cygwin, switch paths to Windows format before running java 292 | if $cygwin; then 293 | [ -n "$M2_HOME" ] && 294 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 295 | [ -n "$JAVA_HOME" ] && 296 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 297 | [ -n "$CLASSPATH" ] && 298 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 299 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 300 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 301 | fi 302 | 303 | # Provide a "standardized" way to retrieve the CLI args that will 304 | # work with both Windows and non-Windows executions. 305 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" 306 | export MAVEN_CMD_LINE_ARGS 307 | 308 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 309 | 310 | exec "$JAVACMD" \ 311 | $MAVEN_OPTS \ 312 | $MAVEN_DEBUG_OPTS \ 313 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 314 | "-Dmaven.home=${M2_HOME}" \ 315 | "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 316 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 317 | -------------------------------------------------------------------------------- /apm-agent-java/log-ingest/app/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM https://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* 50 | if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 124 | 125 | FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 127 | ) 128 | 129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 131 | if exist %WRAPPER_JAR% ( 132 | if "%MVNW_VERBOSE%" == "true" ( 133 | echo Found %WRAPPER_JAR% 134 | ) 135 | ) else ( 136 | if not "%MVNW_REPOURL%" == "" ( 137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 138 | ) 139 | if "%MVNW_VERBOSE%" == "true" ( 140 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 141 | echo Downloading from: %DOWNLOAD_URL% 142 | ) 143 | 144 | powershell -Command "&{"^ 145 | "$webclient = new-object System.Net.WebClient;"^ 146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 148 | "}"^ 149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ 150 | "}" 151 | if "%MVNW_VERBOSE%" == "true" ( 152 | echo Finished downloading %WRAPPER_JAR% 153 | ) 154 | ) 155 | @REM End of extension 156 | 157 | @REM Provide a "standardized" way to retrieve the CLI args that will 158 | @REM work with both Windows and non-Windows executions. 159 | set MAVEN_CMD_LINE_ARGS=%* 160 | 161 | %MAVEN_JAVA_EXE% ^ 162 | %JVM_CONFIG_MAVEN_PROPS% ^ 163 | %MAVEN_OPTS% ^ 164 | %MAVEN_DEBUG_OPTS% ^ 165 | -classpath %WRAPPER_JAR% ^ 166 | "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ 167 | %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 168 | if ERRORLEVEL 1 goto error 169 | goto end 170 | 171 | :error 172 | set ERROR_CODE=1 173 | 174 | :end 175 | @endlocal & set ERROR_CODE=%ERROR_CODE% 176 | 177 | if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost 178 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 179 | if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" 180 | if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" 181 | :skipRcPost 182 | 183 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 184 | if "%MAVEN_BATCH_PAUSE%"=="on" pause 185 | 186 | if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% 187 | 188 | cmd /C exit /B %ERROR_CODE% 189 | -------------------------------------------------------------------------------- /apm-agent-java/log-ingest/app/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 3.0.1 9 | 10 | 11 | 12 | com.example 13 | app 14 | 1.0-SNAPSHOT 15 | 16 | 17 | 17 18 | 1.5.0 19 | 20 | 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter-web 25 | 26 | 27 | 31 | 32 | co.elastic.logging 33 | logback-ecs-encoder 34 | ${ecs-logging-java.version} 35 | true 36 | 37 | 38 | 39 | org.springframework.boot 40 | spring-boot-starter-test 41 | test 42 | 43 | 44 | 45 | 46 | app 47 | 48 | 49 | org.springframework.boot 50 | spring-boot-maven-plugin 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /apm-agent-java/log-ingest/app/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/env bash 2 | 3 | javaagent_opt='' 4 | if [[ '' != "${OTEL_EXPORTER_OTLP_ENDPOINT}" ]]; then 5 | # using opentelemetry java agent 6 | javaagent_opt='-javaagent:/otel-agent.jar' 7 | else 8 | if [[ '' != "${ELASTIC_APM_SERVICE_NAME}" ]]; then 9 | # using elastic java agent 10 | javaagent_opt='-javaagent:/agent.jar' 11 | fi 12 | fi 13 | 14 | cmd="java ${javaagent_opt:-} -jar /app.jar" 15 | echo "starting app with command: '${cmd}'" 16 | 17 | ${cmd} 18 | -------------------------------------------------------------------------------- /apm-agent-java/log-ingest/app/src/main/java/com/example/demo/DemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class DemoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(DemoApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /apm-agent-java/log-ingest/app/src/main/java/com/example/demo/DemoController.java: -------------------------------------------------------------------------------- 1 | package com.example.demo; 2 | 3 | import jakarta.annotation.PostConstruct; 4 | import jakarta.annotation.PreDestroy; 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | import org.springframework.http.MediaType; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.web.bind.annotation.GetMapping; 10 | import org.springframework.web.bind.annotation.ResponseBody; 11 | 12 | import java.util.concurrent.Executors; 13 | import java.util.concurrent.ScheduledExecutorService; 14 | import java.util.concurrent.TimeUnit; 15 | import java.util.concurrent.atomic.AtomicInteger; 16 | 17 | @Controller 18 | public class DemoController { 19 | 20 | private static final Logger log = LoggerFactory.getLogger(DemoController.class); 21 | 22 | private final ScheduledExecutorService executorPool; 23 | private final AtomicInteger counter; 24 | 25 | public DemoController() { 26 | executorPool = Executors.newScheduledThreadPool(1); 27 | counter = new AtomicInteger(0); 28 | } 29 | 30 | @PostConstruct 31 | public void start(){ 32 | executorPool.scheduleAtFixedRate(() -> { 33 | log.info("log something count = {}", counter.incrementAndGet()); 34 | 35 | }, 5, 10, TimeUnit.SECONDS); 36 | } 37 | 38 | @PreDestroy 39 | public void stop() { 40 | executorPool.shutdown(); 41 | executorPool.shutdownNow(); 42 | } 43 | 44 | @GetMapping(value = "/hello", produces = MediaType.TEXT_PLAIN_VALUE) 45 | @ResponseBody 46 | public String hello() { 47 | String msg = "Hello world"; 48 | log.info(msg); 49 | return msg; 50 | } 51 | 52 | @GetMapping(value = "/errorLog", produces = MediaType.TEXT_PLAIN_VALUE) 53 | @ResponseBody 54 | public String logError() { 55 | log.error("this is an error", new RuntimeException("oops, there is a bug in the app !")); 56 | return "error has been logged"; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /apm-agent-java/log-ingest/app/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/apm-contrib/262d2704e2a7a2886795c82dea5385c9875ad022/apm-agent-java/log-ingest/app/src/main/resources/application.properties -------------------------------------------------------------------------------- /apm-agent-java/log-ingest/build-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | id=${1:-00} 3 | 4 | # set compose project name to allow running them at the same time 5 | # otherwise defauts to current working directory and only one can run at a time 6 | export COMPOSE_PROJECT_NAME="log-ingest-${id}" 7 | 8 | docker volume rm log-ingest_shared-volume-${id} 2>/dev/null 9 | docker-compose -f ./${id}-compose.yml build 10 | docker-compose -f ./${id}-compose.yml up 11 | docker-compose -f ./${id}-compose.yml down 12 | -------------------------------------------------------------------------------- /apm-agent-java/log-ingest/client/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:22.04 2 | RUN apt-get update \ 3 | && apt-get install -y curl watch 4 | 5 | COPY run.sh /run.sh 6 | RUN chmod +x /run.sh 7 | 8 | ENV BASE_URL="http://localhost:8080" 9 | 10 | ENTRYPOINT ["/run.sh"] -------------------------------------------------------------------------------- /apm-agent-java/log-ingest/client/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | base_url=${BASE_URL:-http://localhost:8080} 4 | 5 | doGet(){ 6 | curl -s ${base_url}${1} 7 | } 8 | 9 | sleep 20 10 | 11 | while : 12 | do 13 | echo "Press [CTRL+C] to stop.." 14 | sleep 30 15 | echo "---" 16 | doGet /hello 17 | echo "---" 18 | doGet /errorLog 19 | done 20 | -------------------------------------------------------------------------------- /apm-agent-java/log-ingest/filebeat/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ELASTIC_STACK_VERSION=latest 2 | FROM elastic/filebeat:${ELASTIC_STACK_VERSION} 3 | 4 | USER root 5 | COPY run.sh /run.sh 6 | RUN chmod +x /run.sh 7 | 8 | USER filebeat 9 | ENTRYPOINT ["/run.sh"] 10 | -------------------------------------------------------------------------------- /apm-agent-java/log-ingest/filebeat/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -euo pipefail 4 | 5 | # create/update our ingest pipeline 6 | curl \ 7 | -s \ 8 | -u "${cloud_auth}" \ 9 | -XPUT \ 10 | "https://${elasticsearch_host}/_ingest/pipeline/log-ingest-plaintext" \ 11 | -H "Content-Type: application/json" \ 12 | -d' 13 | { 14 | "processors": [ 15 | { 16 | "grok": { 17 | "field": "message", 18 | "patterns": [ 19 | "%{TIMESTAMP_ISO8601:@timestamp}\\s+%{LOGLEVEL:log.level}\\s+%{NUMBER:pid} ---.* : %{GREEDYDATA:message} --- (%{WORD:trace.id})?,(%{WORD:transaction.id})?,(%{WORD:error.id})?\n\n(?m)%{GREEDYDATA:error.stack_trace}", 20 | "%{TIMESTAMP_ISO8601:@timestamp}\\s+%{LOGLEVEL:log.level}\\s+%{NUMBER:pid} ---.* : %{GREEDYDATA:message} --- (%{WORD:trace.id})?,(%{WORD:transaction.id})?,(%{WORD:error.id})?", 21 | "%{TIMESTAMP_ISO8601:@timestamp}\\s+%{LOGLEVEL:log.level}\\s+%{NUMBER:pid} ---.* : %{GREEDYDATA:message}\\n\\n(?m)%{GREEDYDATA:error.stack_trace}", 22 | "%{TIMESTAMP_ISO8601:@timestamp}\\s+%{LOGLEVEL:log.level}\\s+%{NUMBER:pid} ---.* : %{GREEDYDATA:message}" 23 | ] 24 | } 25 | } 26 | ] 27 | }' 28 | 29 | # 'strict.perms' is required in docker as config will be mounted and won't have the expected permissions 30 | 31 | # check configuration 32 | filebeat \ 33 | -c filebeat.yml \ 34 | -strict.perms=false \ 35 | test output 36 | 37 | 38 | # run filebeat 39 | filebeat \ 40 | -c filebeat.yml \ 41 | -strict.perms=false 42 | -------------------------------------------------------------------------------- /apm-agent-java/readme.md: -------------------------------------------------------------------------------- 1 | # Elastic APM Java agent contibutions 2 | 3 | ## Community projects 4 | | Project | Repo | Docs 5 | | :- | :- | :- 6 | | Clojure wrapper for Elastic APM | [yleisradio/clojure-elastic-apm][clojure-wrapper] | [📘 README][clojure-wrapper-docs] 7 | 8 | [clojure-wrapper]: https://github.com/Yleisradio/clojure-elastic-apm 9 | [clojure-wrapper-docs]: https://github.com/Yleisradio/clojure-elastic-apm#readme 10 | 11 | ## Sample integrations 12 | 13 | - [Grails3](./frameworks/grails3/README.md) 14 | - [Servlet2](./frameworks/servlet2/ApmServletFilter.java) 15 | 16 | ## Sample configurations 17 | 18 | - [Capture metrics through JMX](./configuration/jmx.md) 19 | - [Tracing methods](./configuration/trace_methods.md) 20 | 21 | ## Sample dashboards 22 | 23 | - [Sample Kibana dashboards](./dashboards/readme.md) 24 | -------------------------------------------------------------------------------- /apm-agent-nodejs/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/apm-contrib/262d2704e2a7a2886795c82dea5385c9875ad022/apm-agent-nodejs/.keep -------------------------------------------------------------------------------- /apm-agent-nodejs/dashboards/nodejs-runtime-metrics-7.x.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_id": "e053c820-825c-11e9-b6c5-07b7c21e0d7c", 4 | "_type": "dashboard", 5 | "_source": { 6 | "title": "Node.js Metrics Dashboard", 7 | "hits": 0, 8 | "description": "", 9 | "panelsJSON": "[{\"embeddableConfig\":{},\"gridData\":{\"x\":0,\"y\":15,\"w\":24,\"h\":15,\"i\":\"1\"},\"panelIndex\":\"1\",\"version\":\"6.7.1\",\"panelRefName\":\"panel_0\"},{\"embeddableConfig\":{},\"gridData\":{\"x\":24,\"y\":15,\"w\":24,\"h\":15,\"i\":\"2\"},\"panelIndex\":\"2\",\"version\":\"6.7.1\",\"panelRefName\":\"panel_1\"},{\"embeddableConfig\":{},\"gridData\":{\"x\":24,\"y\":0,\"w\":24,\"h\":15,\"i\":\"3\"},\"panelIndex\":\"3\",\"version\":\"6.7.1\",\"panelRefName\":\"panel_2\"},{\"embeddableConfig\":{},\"gridData\":{\"x\":0,\"y\":0,\"w\":24,\"h\":15,\"i\":\"4\"},\"panelIndex\":\"4\",\"version\":\"6.7.1\",\"panelRefName\":\"panel_3\"}]", 10 | "optionsJSON": "{\"darkTheme\":false,\"hidePanelTitles\":false,\"useMargins\":true}", 11 | "version": 1, 12 | "timeRestore": false, 13 | "kibanaSavedObjectMeta": { 14 | "searchSourceJSON": "{\"query\":{\"language\":\"lucene\",\"query\":\"\"},\"filter\":[]}" 15 | } 16 | }, 17 | "_migrationVersion": { 18 | "dashboard": "7.0.0" 19 | }, 20 | "_references": [ 21 | { 22 | "name": "panel_0", 23 | "type": "visualization", 24 | "id": "22ecd7e0-825c-11e9-b6c5-07b7c21e0d7c" 25 | }, 26 | { 27 | "name": "panel_1", 28 | "type": "visualization", 29 | "id": "582c9670-825c-11e9-b6c5-07b7c21e0d7c" 30 | }, 31 | { 32 | "name": "panel_2", 33 | "type": "visualization", 34 | "id": "8ddb6a80-825c-11e9-b6c5-07b7c21e0d7c" 35 | }, 36 | { 37 | "name": "panel_3", 38 | "type": "visualization", 39 | "id": "cf361160-825c-11e9-b6c5-07b7c21e0d7c" 40 | } 41 | ] 42 | }, 43 | { 44 | "_id": "22ecd7e0-825c-11e9-b6c5-07b7c21e0d7c", 45 | "_type": "visualization", 46 | "_source": { 47 | "title": "[nodejs] Active Handles and Requests", 48 | "visState": "{\"title\":\"[nodejs] Active Handles and Requests\",\"type\":\"metrics\",\"params\":{\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"type\":\"timeseries\",\"series\":[{\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"color\":\"#BC6800\",\"split_mode\":\"everything\",\"metrics\":[{\"sigma\":\"\",\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"type\":\"avg\",\"field\":\"nodejs.handles.active\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"label\":\"Active Handles\",\"steps\":0},{\"id\":\"cdcfc010-825b-11e9-adb7-c7200b7018fc\",\"color\":\"#68BC00\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"cdcfe720-825b-11e9-adb7-c7200b7018fc\",\"type\":\"avg\",\"field\":\"nodejs.requests.active\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"number\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"label\":\"Active Requests\"}],\"time_field\":\"@timestamp\",\"index_pattern\":\"apm-*\",\"interval\":\"1m\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"axis_scale\":\"normal\",\"show_legend\":1,\"show_grid\":1,\"default_index_pattern\":\"apm-*\",\"filter\":\"processor.event: \\\"metric\\\", context.service.agent.name: \\\"nodejs\\\"\"},\"aggs\":[]}", 49 | "uiStateJSON": "{}", 50 | "description": "", 51 | "version": 1, 52 | "kibanaSavedObjectMeta": { 53 | "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"filter\":[]}" 54 | } 55 | }, 56 | "_migrationVersion": { 57 | "visualization": "7.0.1" 58 | }, 59 | "_references": [] 60 | }, 61 | { 62 | "_id": "cf361160-825c-11e9-b6c5-07b7c21e0d7c", 63 | "_type": "visualization", 64 | "_source": { 65 | "title": "[nodejs] CPU Usage", 66 | "visState": "{\"title\":\"[nodejs] CPU Usage\",\"type\":\"metrics\",\"params\":{\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"type\":\"timeseries\",\"series\":[{\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"color\":\"#68BC00\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"type\":\"avg\",\"field\":\"system.process.cpu.system.norm.pct\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"percent\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"label\":\"System\",\"value_template\":\"{{value}}\"},{\"id\":\"ba9e7620-825c-11e9-adb7-c7200b7018fc\",\"color\":\"#68BC00\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"ba9e7621-825c-11e9-adb7-c7200b7018fc\",\"type\":\"avg\",\"field\":\"system.process.cpu.user.norm.pct\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"percent\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"label\":\"User\",\"value_template\":\"{{value}}\"}],\"time_field\":\"@timestamp\",\"index_pattern\":\"apm-*\",\"interval\":\"1m\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"axis_scale\":\"normal\",\"show_legend\":1,\"show_grid\":1,\"default_index_pattern\":\"apm-*\",\"filter\":\"processor.event: \\\"metric\\\", context.service.agent.name: \\\"nodejs\\\"\"},\"aggs\":[]}", 67 | "uiStateJSON": "{}", 68 | "description": "", 69 | "version": 1, 70 | "kibanaSavedObjectMeta": { 71 | "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"filter\":[]}" 72 | } 73 | }, 74 | "_migrationVersion": { 75 | "visualization": "7.0.1" 76 | }, 77 | "_references": [] 78 | }, 79 | { 80 | "_id": "8ddb6a80-825c-11e9-b6c5-07b7c21e0d7c", 81 | "_type": "visualization", 82 | "_source": { 83 | "title": "[nodejs] Heap Usage", 84 | "visState": "{\"title\":\"[nodejs] Heap Usage\",\"type\":\"metrics\",\"params\":{\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"type\":\"timeseries\",\"series\":[{\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"color\":\"#68BC00\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"type\":\"avg\",\"field\":\"nodejs.memory.heap.allocated.bytes\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"bytes\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"label\":\"Allocated\"},{\"id\":\"6b48b540-825c-11e9-adb7-c7200b7018fc\",\"color\":\"#68BC00\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"6b48b541-825c-11e9-adb7-c7200b7018fc\",\"type\":\"avg\",\"field\":\"nodejs.memory.heap.used.bytes\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"bytes\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"label\":\"Used\"}],\"time_field\":\"@timestamp\",\"index_pattern\":\"apm-*\",\"interval\":\"1m\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"axis_scale\":\"normal\",\"show_legend\":1,\"show_grid\":1,\"default_index_pattern\":\"apm-*\",\"filter\":\"processor.event: \\\"metric\\\", context.service.agent.name: \\\"nodejs\\\"\"},\"aggs\":[]}", 85 | "uiStateJSON": "{}", 86 | "description": "", 87 | "version": 1, 88 | "kibanaSavedObjectMeta": { 89 | "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"filter\":[]}" 90 | } 91 | }, 92 | "_migrationVersion": { 93 | "visualization": "7.0.1" 94 | }, 95 | "_references": [] 96 | }, 97 | { 98 | "_id": "582c9670-825c-11e9-b6c5-07b7c21e0d7c", 99 | "_type": "visualization", 100 | "_source": { 101 | "title": "[nodejs] Event Loop Delay", 102 | "visState": "{\"title\":\"[nodejs] Event Loop Delay\",\"type\":\"metrics\",\"params\":{\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\",\"type\":\"timeseries\",\"series\":[{\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"color\":\"#68BC00\",\"split_mode\":\"everything\",\"metrics\":[{\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"type\":\"avg\",\"field\":\"nodejs.eventloop.delay.avg.ms\"}],\"separate_axis\":0,\"axis_position\":\"right\",\"formatter\":\"ms,ms,0\",\"chart_type\":\"line\",\"line_width\":1,\"point_size\":1,\"fill\":0.5,\"stacked\":\"none\",\"label\":\"Event Loop Delay\",\"value_template\":\"{{value}}ms\"}],\"time_field\":\"@timestamp\",\"index_pattern\":\"apm-*\",\"interval\":\"1m\",\"axis_position\":\"left\",\"axis_formatter\":\"number\",\"axis_scale\":\"normal\",\"show_legend\":1,\"show_grid\":1,\"default_index_pattern\":\"apm-*\",\"filter\":\"processor.event: \\\"metric\\\", context.service.agent.name: \\\"nodejs\\\"\"},\"aggs\":[]}", 103 | "uiStateJSON": "{}", 104 | "description": "", 105 | "version": 1, 106 | "kibanaSavedObjectMeta": { 107 | "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"filter\":[]}" 108 | } 109 | }, 110 | "_migrationVersion": { 111 | "visualization": "7.0.1" 112 | }, 113 | "_references": [] 114 | } 115 | ] 116 | -------------------------------------------------------------------------------- /apm-agent-nodejs/dashboards/readme.md: -------------------------------------------------------------------------------- 1 | ## Node.js Dashboards and Visualizations 2 | 3 | A Kibana dashboard displays a collection of visualizations and searches. 4 | This is a collection of dashboards, visualizations, and searches that you can use to organize and view your Elastic APM Node.js Agent data. 5 | 6 | ### Installation 7 | 8 | Dashboards are imported on the **Stack Management > Saved Objects** page. 9 | Full documentation on this process is available in [Kibana](https://www.elastic.co/guide/en/kibana/current/managing-saved-objects.html). 10 | 11 | After importing, visit the [Dashboard](https://www.elastic.co/guide/en/kibana/current/dashboard.html) tab to view and edit your imported dashboards. 12 | 13 | ### Dashboards 14 | 15 | - [**nodejs-runtime-metrics-6.x.json**](nodejs-runtime-metrics-6.x.json) (when using APM Server 6.x) 16 | - [**nodejs-runtime-metrics-7.x.json**](nodejs-runtime-metrics-7.x.json) (when using APM Server 7.x) 17 | -------------------------------------------------------------------------------- /apm-agent-php/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/apm-contrib/262d2704e2a7a2886795c82dea5385c9875ad022/apm-agent-php/.keep -------------------------------------------------------------------------------- /apm-agent-python/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/apm-contrib/262d2704e2a7a2886795c82dea5385c9875ad022/apm-agent-python/.keep -------------------------------------------------------------------------------- /apm-agent-ruby/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/apm-contrib/262d2704e2a7a2886795c82dea5385c9875ad022/apm-agent-ruby/.keep -------------------------------------------------------------------------------- /apm-agent-ruby/dashboards/readme.md: -------------------------------------------------------------------------------- 1 | ## Ruby Dashboards and Visualizations 2 | 3 | A Kibana dashboard displays a collection of visualizations and searches. 4 | This is a collection of dashboards, visualizations, and searches that you can use to organize and view your Elastic APM Ruby Agent data. 5 | 6 | ### Installation 7 | 8 | Dashboards are imported on the **Management > Saved objects** page. 9 | Full documentation on this process is available in [Kibana](https://www.elastic.co/guide/en/kibana/current/managing-saved-objects.html). 10 | 11 | After importing, visit the [Dashboard](https://www.elastic.co/guide/en/kibana/current/dashboard.html) tab to view and edit your imported dashboards. 12 | 13 | ### Dashboards 14 | 15 | - [**ruby-runtime-metrics-7.3+.ndjson**](ruby-runtime-metrics-7.3+.ndjson) (for use with APM Server 7.3+) 16 | -------------------------------------------------------------------------------- /apm-agent-rum-js/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/apm-contrib/262d2704e2a7a2886795c82dea5385c9875ad022/apm-agent-rum-js/.keep -------------------------------------------------------------------------------- /apm-agent-rum-js/README.md: -------------------------------------------------------------------------------- 1 | # Elastic APM JavaScript Real User Monitoring (RUM) agent 2 | 3 | This is a collection of code and recipes to be used in conjunction with [Elastic APM JavaScript RUM agent](https://github.com/elastic/apm-agent-rum-js). The code here is not necessarily maintained by the core Elastic APM Team. 4 | 5 | ## Development tools 6 | * [ElasticAPMSourceMapPlugin](https://github.com/wuct/elastic-apm-sourcemap-webpack-plugin/) is a Webpack plugin that uploads sourcemaps generated by Webpack to a Elastic APM server. -------------------------------------------------------------------------------- /apm-logo.svg: -------------------------------------------------------------------------------- 1 | apm-color -------------------------------------------------------------------------------- /apm-server/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/apm-contrib/262d2704e2a7a2886795c82dea5385c9875ad022/apm-server/.keep -------------------------------------------------------------------------------- /kibana/6.x/error_details.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_id": "5f08a870-7c6a-11e7-aa55-3b0d52c71c60", 4 | "_source": { 5 | "description": "", 6 | "hits": 0, 7 | "kibanaSavedObjectMeta": { 8 | "searchSourceJSON": "{\"filter\": [], \"query\": {\"query\": \"\", \"language\": \"lucene\"}, \"version\": true, \"highlightAll\": true}" 9 | }, 10 | "optionsJSON": "{\"darkTheme\": false}", 11 | "panelsJSON": "[{\"type\": \"visualization\", \"id\": \"c618e4e0-7c69-11e7-aa55-3b0d52c71c60\", \"size_x\": 12, \"size_y\": 3, \"panelIndex\": 1, \"col\": 1, \"row\": 1}, {\"sort\": [\"@timestamp\", \"desc\"], \"type\": \"search\", \"id\": \"ceefd050-7c6a-11e7-aa55-3b0d52c71c60\", \"size_x\": 12, \"size_y\": 21, \"panelIndex\": 2, \"col\": 1, \"columns\": [\"error.culprit\", \"error.exception.type\", \"error.exception.message\", \"error.log.message\", \"error.exception.handled\", \"context.service.name\"], \"row\": 4}]", 12 | "timeRestore": false, 13 | "title": "[APM] Error Details", 14 | "uiStateJSON": "{}", 15 | "version": 1 16 | }, 17 | "_type": "dashboard" 18 | }, 19 | { 20 | "_id": "c618e4e0-7c69-11e7-aa55-3b0d52c71c60", 21 | "_source": { 22 | "description": "", 23 | "kibanaSavedObjectMeta": { 24 | "searchSourceJSON": "{\"index\": \"apm-*\", \"query\": {\"query\": \"\", \"language\": \"lucene\"}}" 25 | }, 26 | "title": "Error Occurrences [APM]", 27 | "uiStateJSON": "{}", 28 | "version": 1, 29 | "visState": "{\"params\": {\"time_field\": \"@timestamp\", \"series\": [{\"line_width\": \"0\", \"terms_field\": \"error.grouping_key\", \"point_size\": 1, \"color\": \"rgba(0,156,224,1)\", \"label\": \"Occurrences\", \"metrics\": [{\"type\": \"count\", \"id\": \"61ca57f2-469d-11e7-af02-69e470af7417\"}], \"seperate_axis\": 0, \"split_mode\": \"terms\", \"chart_type\": \"bar\", \"stacked\": \"none\", \"axis_position\": \"right\", \"formatter\": \"number\", \"id\": \"61ca57f1-469d-11e7-af02-69e470af7417\", \"fill\": \"1\"}], \"axis_formatter\": \"number\", \"interval\": \">=1m\", \"filter\": \"processor.event:error\", \"show_legend\": 0, \"show_grid\": 1, \"axis_position\": \"left\", \"type\": \"timeseries\", \"id\": \"61ca57f0-469d-11e7-af02-69e470af7417\"}, \"type\": \"metrics\", \"aggs\": [], \"title\": \"Error Occurrences [APM]\"}" 30 | }, 31 | "_type": "visualization" 32 | }, 33 | { 34 | "_id": "ceefd050-7c6a-11e7-aa55-3b0d52c71c60", 35 | "_source": { 36 | "columns": [ 37 | "error.culprit", 38 | "error.exception.type", 39 | "error.exception.message", 40 | "error.log.message", 41 | "error.exception.handled", 42 | "context.service.name" 43 | ], 44 | "description": "", 45 | "hits": 0, 46 | "kibanaSavedObjectMeta": { 47 | "searchSourceJSON": "{\"filter\": [{\"query\": {\"match\": {\"processor.event\": {\"query\": \"error\", \"type\": \"phrase\"}}}, \"meta\": {\"index\": \"apm-*\", \"value\": \"error\", \"disabled\": false, \"alias\": null, \"params\": {\"query\": \"error\", \"type\": \"phrase\"}, \"key\": \"processor.event\", \"negate\": false, \"type\": \"phrase\"}, \"$state\": {\"store\": \"appState\"}}], \"index\": \"apm-*\", \"version\": true, \"highlightAll\": true, \"query\": {\"query\": \"\", \"language\": \"lucene\"}}" 48 | }, 49 | "sort": [ 50 | "@timestamp", 51 | "desc" 52 | ], 53 | "title": "Error Details [APM]", 54 | "version": 1 55 | }, 56 | "_type": "search" 57 | } 58 | ] -------------------------------------------------------------------------------- /kibana/6.x/errors.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_id": "37f6fac0-7c6a-11e7-aa55-3b0d52c71c60", 4 | "_source": { 5 | "description": "", 6 | "hits": 0, 7 | "kibanaSavedObjectMeta": { 8 | "searchSourceJSON": "{\"filter\": [], \"query\": {\"query\": \"\", \"language\": \"lucene\"}, \"version\": true, \"highlightAll\": true}" 9 | }, 10 | "optionsJSON": "{\"darkTheme\": false}", 11 | "panelsJSON": "[{\"type\": \"visualization\", \"id\": \"22518e70-7c69-11e7-aa55-3b0d52c71c60\", \"size_x\": 12, \"size_y\": 10, \"panelIndex\": 1, \"col\": 1, \"row\": 4}, {\"type\": \"visualization\", \"id\": \"c618e4e0-7c69-11e7-aa55-3b0d52c71c60\", \"size_x\": 12, \"size_y\": 3, \"panelIndex\": 2, \"col\": 1, \"row\": 1}]", 12 | "timeRestore": false, 13 | "title": "[APM] Errors", 14 | "uiStateJSON": "{\"P-1\": {\"vis\": {\"params\": {\"sort\": {\"columnIndex\": null, \"direction\": null}}}}}", 15 | "version": 1 16 | }, 17 | "_type": "dashboard" 18 | }, 19 | { 20 | "_id": "22518e70-7c69-11e7-aa55-3b0d52c71c60", 21 | "_source": { 22 | "description": "", 23 | "kibanaSavedObjectMeta": { 24 | "searchSourceJSON": "{\"filter\": [], \"index\": \"apm-*\", \"query\": {\"query\": \"\", \"language\": \"lucene\"}}" 25 | }, 26 | "title": "Top Errors for Time Period [APM]", 27 | "uiStateJSON": "{\"vis\": {\"params\": {\"sort\": {\"columnIndex\": null, \"direction\": null}}}}", 28 | "version": 1, 29 | "visState": "{\"params\": {\"sort\": {\"columnIndex\": null, \"direction\": null}, \"perPage\": 25, \"showPartialRows\": false, \"totalFunc\": \"sum\", \"showTotal\": false, \"showMeticsAtAllLevels\": false}, \"type\": \"table\", \"aggs\": [{\"type\": \"terms\", \"enabled\": true, \"id\": \"2\", \"params\": {\"orderBy\": \"1\", \"field\": \"error id icon\", \"customLabel\": \"-\", \"order\": \"desc\", \"size\": 100}, \"schema\": \"bucket\"}, {\"type\": \"top_hits\", \"enabled\": true, \"id\": \"5\", \"params\": {\"sortField\": \"@timestamp\", \"customLabel\": \"Message\", \"field\": \"error.exception.message\", \"sortOrder\": \"desc\", \"aggregate\": \"concat\", \"size\": 1}, \"schema\": \"metric\"}, {\"type\": \"count\", \"enabled\": true, \"id\": \"1\", \"params\": {\"customLabel\": \"Number of Errors\"}, \"schema\": \"metric\"}, {\"type\": \"top_hits\", \"enabled\": true, \"id\": \"4\", \"params\": {\"sortField\": \"@timestamp\", \"customLabel\": \"Type\", \"field\": \"error.exception.type\", \"sortOrder\": \"desc\", \"aggregate\": \"concat\", \"size\": 1}, \"schema\": \"metric\"}, {\"type\": \"top_hits\", \"enabled\": true, \"id\": \"3\", \"params\": {\"sortField\": \"@timestamp\", \"customLabel\": \"Culprit\", \"field\": \"error.culprit\", \"sortOrder\": \"desc\", \"aggregate\": \"concat\", \"size\": 1}, \"schema\": \"metric\"}, {\"type\": \"top_hits\", \"enabled\": true, \"id\": \"6\", \"params\": {\"sortField\": \"@timestamp\", \"customLabel\": \"App Name\", \"field\": \"context.service.name\", \"sortOrder\": \"desc\", \"aggregate\": \"concat\", \"size\": 1}, \"schema\": \"metric\"}, {\"type\": \"top_hits\", \"enabled\": true, \"id\": \"7\", \"params\": {\"sortField\": \"@timestamp\", \"customLabel\": \"-\", \"field\": \"error.grouping_key\", \"sortOrder\": \"desc\", \"aggregate\": \"concat\", \"size\": 1}, \"schema\": \"metric\"}], \"title\": \"Top Errors for Time Period [APM]\"}" 30 | }, 31 | "_type": "visualization" 32 | }, 33 | { 34 | "_id": "c618e4e0-7c69-11e7-aa55-3b0d52c71c60", 35 | "_source": { 36 | "description": "", 37 | "kibanaSavedObjectMeta": { 38 | "searchSourceJSON": "{\"index\": \"apm-*\", \"query\": {\"query\": \"\", \"language\": \"lucene\"}}" 39 | }, 40 | "title": "Error Occurrences [APM]", 41 | "uiStateJSON": "{}", 42 | "version": 1, 43 | "visState": "{\"params\": {\"time_field\": \"@timestamp\", \"series\": [{\"line_width\": \"0\", \"terms_field\": \"error.grouping_key\", \"point_size\": 1, \"color\": \"rgba(0,156,224,1)\", \"label\": \"Occurrences\", \"metrics\": [{\"type\": \"count\", \"id\": \"61ca57f2-469d-11e7-af02-69e470af7417\"}], \"seperate_axis\": 0, \"split_mode\": \"terms\", \"chart_type\": \"bar\", \"stacked\": \"none\", \"axis_position\": \"right\", \"formatter\": \"number\", \"id\": \"61ca57f1-469d-11e7-af02-69e470af7417\", \"fill\": \"1\"}], \"axis_formatter\": \"number\", \"interval\": \">=1m\", \"filter\": \"processor.event:error\", \"show_legend\": 0, \"show_grid\": 1, \"axis_position\": \"left\", \"type\": \"timeseries\", \"id\": \"61ca57f0-469d-11e7-af02-69e470af7417\"}, \"type\": \"metrics\", \"aggs\": [], \"title\": \"Error Occurrences [APM]\"}" 44 | }, 45 | "_type": "visualization" 46 | } 47 | ] -------------------------------------------------------------------------------- /kibana/6.x/services.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_id": "8d3ed660-7828-11e7-8c47-65b845b5cfb3", 4 | "_source": { 5 | "description": "", 6 | "hits": 0, 7 | "kibanaSavedObjectMeta": { 8 | "searchSourceJSON": "{\"filter\": [], \"query\": {\"query\": \"\", \"language\": \"lucene\"}, \"version\": true, \"highlightAll\": true}" 9 | }, 10 | "optionsJSON": "{\"darkTheme\": false}", 11 | "panelsJSON": "[{\"type\": \"visualization\", \"id\": \"1ffc5e20-7827-11e7-8c47-65b845b5cfb3\", \"size_x\": 12, \"size_y\": 5, \"panelIndex\": 1, \"col\": 1, \"row\": 4}, {\"type\": \"visualization\", \"id\": \"1bdca740-7828-11e7-8c47-65b845b5cfb3\", \"size_x\": 6, \"size_y\": 3, \"panelIndex\": 2, \"col\": 1, \"row\": 1}, {\"type\": \"visualization\", \"id\": \"804ffc40-7828-11e7-8c47-65b845b5cfb3\", \"size_x\": 6, \"size_y\": 3, \"panelIndex\": 3, \"col\": 7, \"row\": 1}]", 12 | "timeRestore": false, 13 | "title": "[APM] Services", 14 | "uiStateJSON": "{\"P-1\": {\"vis\": {\"params\": {\"sort\": {\"columnIndex\": null, \"direction\": null}}}}}", 15 | "version": 1 16 | }, 17 | "_type": "dashboard" 18 | }, 19 | { 20 | "_id": "1ffc5e20-7827-11e7-8c47-65b845b5cfb3", 21 | "_source": { 22 | "description": "", 23 | "kibanaSavedObjectMeta": { 24 | "searchSourceJSON": "{\"filter\": [], \"index\": \"apm-*\", \"query\": {\"query\": \"\", \"language\": \"lucene\"}}" 25 | }, 26 | "title": "Services [APM]", 27 | "uiStateJSON": "{\"vis\": {\"params\": {\"sort\": {\"columnIndex\": null, \"direction\": null}}}}", 28 | "version": 1, 29 | "visState": "{\"params\": {\"sort\": {\"columnIndex\": null, \"direction\": null}, \"perPage\": 10, \"showPartialRows\": false, \"totalFunc\": \"sum\", \"showTotal\": false, \"showMeticsAtAllLevels\": false}, \"type\": \"table\", \"aggs\": [{\"type\": \"avg\", \"enabled\": true, \"id\": \"1\", \"params\": {\"field\": \"transaction.duration.us\", \"customLabel\": \"Avg. Trans. Time\"}, \"schema\": \"metric\"}, {\"type\": \"percentiles\", \"enabled\": true, \"id\": \"3\", \"params\": {\"field\": \"transaction.duration.us\", \"percents\": [95], \"customLabel\": \"Trans. Time\"}, \"schema\": \"metric\"}, {\"type\": \"cardinality\", \"enabled\": true, \"id\": \"4\", \"params\": {\"field\": \"transaction.id\", \"customLabel\": \"Total Transactions\"}, \"schema\": \"metric\"}, {\"type\": \"cardinality\", \"enabled\": true, \"id\": \"6\", \"params\": {\"field\": \"error.id\", \"customLabel\": \"Errors\"}, \"schema\": \"metric\"}, {\"type\": \"top_hits\", \"enabled\": true, \"id\": \"5\", \"params\": {\"sortField\": \"@timestamp\", \"customLabel\": \"-\", \"field\": \"view errors\", \"sortOrder\": \"desc\", \"aggregate\": \"concat\", \"size\": 1}, \"schema\": \"metric\"}, {\"type\": \"terms\", \"enabled\": true, \"id\": \"2\", \"params\": {\"orderBy\": \"1\", \"field\": \"context.service.name\", \"order\": \"desc\", \"size\": 1000}, \"schema\": \"bucket\"}], \"title\": \"Services [APM]\"}" 30 | }, 31 | "_type": "visualization" 32 | }, 33 | { 34 | "_id": "1bdca740-7828-11e7-8c47-65b845b5cfb3", 35 | "_source": { 36 | "description": "", 37 | "kibanaSavedObjectMeta": { 38 | "searchSourceJSON": "{\"index\": \"apm-*\", \"query\": {\"query\": \"\", \"language\": \"lucene\"}}" 39 | }, 40 | "title": "Top Services by Transaction Time [APM]", 41 | "uiStateJSON": "{}", 42 | "version": 1, 43 | "visState": "{\"params\": {\"time_field\": \"@timestamp\", \"series\": [{\"line_width\": \"2\", \"terms_field\": \"context.service.name\", \"point_size\": 1, \"color\": \"rgba(0,156,224,1)\", \"value_template\": \"{{value}} ms\", \"metrics\": [{\"field\": \"transaction.duration.us\", \"type\": \"avg\", \"id\": \"61ca57f2-469d-11e7-af02-69e470af7417\"}], \"seperate_axis\": 0, \"split_mode\": \"terms\", \"chart_type\": \"line\", \"terms_order_by\": \"61ca57f2-469d-11e7-af02-69e470af7417\", \"stacked\": \"none\", \"axis_position\": \"right\", \"formatter\": \"us,ms,0\", \"id\": \"61ca57f1-469d-11e7-af02-69e470af7417\", \"split_color_mode\": \"gradient\", \"fill\": \"0\"}], \"axis_formatter\": \"number\", \"interval\": \">=1m\", \"show_legend\": 1, \"show_grid\": 1, \"axis_position\": \"left\", \"type\": \"timeseries\", \"id\": \"61ca57f0-469d-11e7-af02-69e470af7417\"}, \"type\": \"metrics\", \"aggs\": [], \"title\": \"Top Services by Transaction Time [APM]\"}" 44 | }, 45 | "_type": "visualization" 46 | }, 47 | { 48 | "_id": "804ffc40-7828-11e7-8c47-65b845b5cfb3", 49 | "_source": { 50 | "description": "", 51 | "kibanaSavedObjectMeta": { 52 | "searchSourceJSON": "{\"index\": \"apm-*\", \"query\": {\"query\": \"\", \"language\": \"lucene\"}}" 53 | }, 54 | "title": "Top Services by Transaction Per Minute [APM]", 55 | "uiStateJSON": "{}", 56 | "version": 1, 57 | "visState": "{\"params\": {\"time_field\": \"@timestamp\", \"series\": [{\"line_width\": \"2\", \"terms_field\": \"context.service.name\", \"point_size\": 1, \"color\": \"rgba(0,156,224,1)\", \"value_template\": \"{{value}} tpm\", \"metrics\": [{\"type\": \"count\", \"id\": \"61ca57f2-469d-11e7-af02-69e470af7417\"}, {\"field\": \"61ca57f2-469d-11e7-af02-69e470af7417\", \"type\": \"cumulative_sum\", \"id\": \"3fcaa6c0-7828-11e7-bb25-2ff6dee07a1b\"}, {\"field\": \"3fcaa6c0-7828-11e7-bb25-2ff6dee07a1b\", \"type\": \"derivative\", \"id\": \"467f1cd0-7828-11e7-bb25-2ff6dee07a1b\", \"unit\": \"1m\"}, {\"field\": \"467f1cd0-7828-11e7-bb25-2ff6dee07a1b\", \"type\": \"positive_only\", \"id\": \"4bd1b8f0-7828-11e7-bb25-2ff6dee07a1b\", \"unit\": \"\"}], \"seperate_axis\": 0, \"split_mode\": \"terms\", \"chart_type\": \"line\", \"terms_order_by\": \"_count\", \"stacked\": \"none\", \"axis_position\": \"right\", \"formatter\": \"number\", \"id\": \"61ca57f1-469d-11e7-af02-69e470af7417\", \"fill\": \"0\"}], \"axis_formatter\": \"number\", \"interval\": \">=1m\", \"show_legend\": 1, \"show_grid\": 1, \"axis_position\": \"left\", \"type\": \"timeseries\", \"id\": \"61ca57f0-469d-11e7-af02-69e470af7417\"}, \"type\": \"metrics\", \"aggs\": [], \"title\": \"Top Apps by Transaction Per Minute [APM]\"}" 58 | }, 59 | "_type": "visualization" 60 | } 61 | ] -------------------------------------------------------------------------------- /kibana/6.x/span_details.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_id": "3e3de700-7de0-11e7-b115-df9c90da2df1", 4 | "_source": { 5 | "description": "", 6 | "hits": 0, 7 | "kibanaSavedObjectMeta": { 8 | "searchSourceJSON": "{\"filter\": [], \"query\": {\"query\": \"\", \"language\": \"lucene\"}, \"version\": true, \"highlightAll\": true}" 9 | }, 10 | "optionsJSON": "{\"darkTheme\": false}", 11 | "panelsJSON": "[{\"sort\": [\"span.start.us\", \"asc\"], \"type\": \"search\", \"col\": 1, \"size_x\": 12, \"size_y\": 23, \"panelIndex\": 1, \"id\": \"d7735b90-7ddf-11e7-b115-df9c90da2df1\", \"columns\": [\"span.type\", \"span.name\", \"span.duration.us\", \"span.start.us\"], \"row\": 1}]", 12 | "timeRestore": false, 13 | "title": "[APM] Span Details", 14 | "uiStateJSON": "{}", 15 | "version": 1 16 | }, 17 | "_type": "dashboard" 18 | }, 19 | { 20 | "_id": "d7735b90-7ddf-11e7-b115-df9c90da2df1", 21 | "_source": { 22 | "columns": [ 23 | "span.type", 24 | "span.name", 25 | "span.duration.us", 26 | "span.start.us" 27 | ], 28 | "description": "", 29 | "hits": 0, 30 | "kibanaSavedObjectMeta": { 31 | "searchSourceJSON": "{\"filter\": [{\"query\": {\"match\": {\"processor.event\": {\"query\": \"span\", \"type\": \"phrase\"}}}, \"meta\": {\"index\": \"apm-*\", \"value\": \"span\", \"disabled\": false, \"alias\": null, \"params\": {\"query\": \"span\", \"type\": \"phrase\"}, \"key\": \"processor.event\", \"negate\": false, \"type\": \"phrase\"}, \"$state\": {\"store\": \"appState\"}}], \"index\": \"apm-*\", \"version\": true, \"highlightAll\": true, \"query\": {\"query\": \"\", \"language\": \"lucene\"}}" 32 | }, 33 | "sort": [ 34 | "span.start.us", 35 | "asc" 36 | ], 37 | "title": "Spans [APM]", 38 | "version": 1 39 | }, 40 | "_type": "search" 41 | } 42 | ] -------------------------------------------------------------------------------- /kibana/6.x/transactions.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_id": "41b5d920-7821-11e7-8c47-65b845b5cfb3", 4 | "_source": { 5 | "description": "", 6 | "hits": 0, 7 | "kibanaSavedObjectMeta": { 8 | "searchSourceJSON": "{\"filter\": [], \"query\": {\"query\": \"\", \"language\": \"lucene\"}, \"version\": true, \"highlightAll\": true}" 9 | }, 10 | "optionsJSON": "{\"darkTheme\": false}", 11 | "panelsJSON": "[{\"type\": \"visualization\", \"id\": \"a2e199b0-7820-11e7-8c47-65b845b5cfb3\", \"size_x\": 12, \"size_y\": 10, \"panelIndex\": 1, \"col\": 1, \"row\": 4}, {\"type\": \"visualization\", \"id\": \"09bcf890-7822-11e7-8c47-65b845b5cfb3\", \"size_x\": 6, \"size_y\": 3, \"panelIndex\": 2, \"col\": 1, \"row\": 1}, {\"type\": \"visualization\", \"id\": \"55606a60-7823-11e7-8c47-65b845b5cfb3\", \"size_x\": 6, \"size_y\": 3, \"panelIndex\": 3, \"col\": 7, \"row\": 1}]", 12 | "timeRestore": false, 13 | "title": "[APM] Transactions", 14 | "uiStateJSON": "{\"P-1\": {\"vis\": {\"params\": {\"sort\": {\"columnIndex\": null, \"direction\": null}}}}}", 15 | "version": 1 16 | }, 17 | "_type": "dashboard" 18 | }, 19 | { 20 | "_id": "a2e199b0-7820-11e7-8c47-65b845b5cfb3", 21 | "_source": { 22 | "description": "", 23 | "kibanaSavedObjectMeta": { 24 | "searchSourceJSON": "{\"filter\": [], \"index\": \"apm-*\", \"query\": {\"query\": \"\", \"language\": \"lucene\"}}" 25 | }, 26 | "title": "Top Transactions for Time Period [APM]", 27 | "uiStateJSON": "{\"vis\": {\"params\": {\"sort\": {\"columnIndex\": null, \"direction\": null}}}}", 28 | "version": 1, 29 | "visState": "{\"type\": \"table\", \"params\": {\"sort\": {\"columnIndex\": null, \"direction\": null}, \"perPage\": 25, \"showPartialRows\": false, \"totalFunc\": \"sum\", \"showTotal\": false, \"showMeticsAtAllLevels\": false}, \"aggs\": [{\"params\": {\"orderBy\": \"1\", \"field\": \"transaction.name.keyword\", \"customLabel\": \"Transaction\", \"order\": \"desc\", \"size\": 1000}, \"type\": \"terms\", \"enabled\": true, \"id\": \"2\", \"schema\": \"bucket\"}, {\"params\": {\"sortField\": \"@timestamp\", \"customLabel\": \"Type\", \"field\": \"transaction.type\", \"sortOrder\": \"desc\", \"aggregate\": \"concat\", \"size\": 1}, \"type\": \"top_hits\", \"enabled\": true, \"id\": \"5\", \"schema\": \"metric\"}, {\"params\": {\"field\": \"transaction.duration.us\", \"customLabel\": \"Avg. Resp Time (ms)\"}, \"type\": \"avg\", \"enabled\": true, \"id\": \"1\", \"schema\": \"metric\"}, {\"params\": {\"field\": \"transaction.duration.us\", \"customLabel\": \"Resp Time (ms)\", \"percents\": [95]}, \"type\": \"percentiles\", \"enabled\": true, \"id\": \"3\", \"schema\": \"metric\"}, {\"params\": {\"sortField\": \"@timestamp\", \"customLabel\": \"View Spans\", \"field\": \"transaction.id\", \"sortOrder\": \"desc\", \"aggregate\": \"concat\", \"size\": 1}, \"type\": \"top_hits\", \"enabled\": true, \"id\": \"4\", \"schema\": \"metric\"}], \"title\": \"Top Transactions for Time Period [APM]\"}" 30 | }, 31 | "_type": "visualization" 32 | }, 33 | { 34 | "_id": "09bcf890-7822-11e7-8c47-65b845b5cfb3", 35 | "_source": { 36 | "description": "", 37 | "kibanaSavedObjectMeta": { 38 | "searchSourceJSON": "{\"index\": \"apm-*\", \"query\": {\"query\": \"\", \"language\": \"lucene\"}}" 39 | }, 40 | "title": "Transaction Times [APM]", 41 | "uiStateJSON": "{}", 42 | "version": 1, 43 | "visState": "{\"params\": {\"time_field\": \"@timestamp\", \"series\": [{\"line_width\": \"2\", \"point_size\": 1, \"color\": \"rgba(0,156,224,1)\", \"value_template\": \"{{value}} ms\", \"label\": \"Average\", \"metrics\": [{\"field\": \"transaction.duration.us\", \"type\": \"avg\", \"id\": \"61ca57f2-469d-11e7-af02-69e470af7417\"}], \"seperate_axis\": 0, \"split_mode\": \"everything\", \"chart_type\": \"line\", \"stacked\": \"none\", \"axis_position\": \"right\", \"formatter\": \"us,ms,0\", \"id\": \"61ca57f1-469d-11e7-af02-69e470af7417\", \"fill\": \"0\"}, {\"line_width\": 1, \"point_size\": 1, \"color\": \"rgba(115,216,255,1)\", \"value_template\": \"{{value}} ms\", \"label\": \"95th Percentile\", \"metrics\": [{\"field\": \"transaction.duration.us\", \"percentiles\": [{\"mode\": \"line\", \"percentile\": \"\", \"shade\": 0.2, \"value\": \"95\", \"id\": \"858ec670-7821-11e7-8745-07eaffcb65e5\"}], \"type\": \"percentile\", \"id\": \"79921481-7821-11e7-8745-07eaffcb65e5\"}], \"seperate_axis\": 0, \"split_mode\": \"everything\", \"chart_type\": \"line\", \"stacked\": \"none\", \"axis_position\": \"right\", \"formatter\": \"us,ms,0\", \"id\": \"79921480-7821-11e7-8745-07eaffcb65e5\", \"fill\": 0.5}, {\"line_width\": \"2\", \"point_size\": 1, \"color\": \"rgba(254,146,0,1)\", \"value_template\": \"{{value}} ms\", \"label\": \"99th Percentile\", \"metrics\": [{\"field\": \"transaction.duration.us\", \"percentiles\": [{\"mode\": \"line\", \"percentile\": \"\", \"shade\": 0.2, \"value\": \"99\", \"id\": \"858ec670-7821-11e7-8745-07eaffcb65e5\"}], \"type\": \"percentile\", \"id\": \"c1e42de1-7821-11e7-8745-07eaffcb65e5\"}], \"seperate_axis\": 0, \"split_mode\": \"everything\", \"chart_type\": \"line\", \"stacked\": \"none\", \"axis_position\": \"right\", \"formatter\": \"us,ms,0\", \"id\": \"c1e42de0-7821-11e7-8745-07eaffcb65e5\", \"fill\": \"0\"}], \"axis_formatter\": \"number\", \"interval\": \">=1m\", \"show_legend\": 1, \"show_grid\": 1, \"legend_position\": \"right\", \"axis_position\": \"left\", \"type\": \"timeseries\", \"id\": \"61ca57f0-469d-11e7-af02-69e470af7417\"}, \"type\": \"metrics\", \"aggs\": [], \"title\": \"Transaction Times [APM]\"}" 44 | }, 45 | "_type": "visualization" 46 | }, 47 | { 48 | "_id": "55606a60-7823-11e7-8c47-65b845b5cfb3", 49 | "_source": { 50 | "description": "", 51 | "kibanaSavedObjectMeta": { 52 | "searchSourceJSON": "{\"index\": \"apm-*\", \"query\": {\"query\": \"\", \"language\": \"lucene\"}}" 53 | }, 54 | "title": "Transaction Per Minute [APM]", 55 | "uiStateJSON": "{}", 56 | "version": 1, 57 | "visState": "{\"params\": {\"time_field\": \"@timestamp\", \"series\": [{\"line_width\": \"2\", \"terms_field\": \"transaction.result\", \"point_size\": \"0\", \"color\": \"rgba(115,216,255,1)\", \"value_template\": \"{{value}} tpm\", \"label\": \"\", \"metrics\": [{\"field\": \"transaction.id\", \"type\": \"cardinality\", \"id\": \"61ca57f2-469d-11e7-af02-69e470af7417\"}, {\"field\": \"61ca57f2-469d-11e7-af02-69e470af7417\", \"type\": \"cumulative_sum\", \"id\": \"3fcaa6c0-7828-11e7-bb25-2ff6dee07a1b\"}, {\"field\": \"3fcaa6c0-7828-11e7-bb25-2ff6dee07a1b\", \"type\": \"derivative\", \"id\": \"467f1cd0-7828-11e7-bb25-2ff6dee07a1b\", \"unit\": \"1m\"}, {\"field\": \"467f1cd0-7828-11e7-bb25-2ff6dee07a1b\", \"type\": \"positive_only\", \"id\": \"4bd1b8f0-7828-11e7-bb25-2ff6dee07a1b\", \"unit\": \"\"}], \"seperate_axis\": 0, \"split_mode\": \"everything\", \"chart_type\": \"line\", \"stacked\": \"none\", \"axis_position\": \"right\", \"formatter\": \"number\", \"id\": \"61ca57f1-469d-11e7-af02-69e470af7417\", \"fill\": \"0\"}], \"axis_formatter\": \"number\", \"interval\": \">=1m\", \"show_legend\": 0, \"show_grid\": 1, \"axis_position\": \"left\", \"type\": \"timeseries\", \"id\": \"61ca57f0-469d-11e7-af02-69e470af7417\"}, \"type\": \"metrics\", \"aggs\": [], \"title\": \"Transaction Per Minute [APM]\"}" 58 | }, 59 | "_type": "visualization" 60 | } 61 | ] -------------------------------------------------------------------------------- /kibana/7.x/agent-versions.ndjson: -------------------------------------------------------------------------------- 1 | {"attributes":{"description":"","state":{"datasourceStates":{"indexpattern":{"layers":{"5d01f4c5-6eaa-4ae0-bb35-3e15d5b9d4c0":{"columnOrder":["7b4248d6-1464-453e-ae96-c28fc0e68737","822ac48e-f644-4f5f-89ac-98897fa898b6","1348f96b-85de-4927-aaa6-745ee8afd152"],"columns":{"1348f96b-85de-4927-aaa6-745ee8afd152":{"dataType":"number","isBucketed":false,"label":"Unique count of service.name","operationType":"unique_count","scale":"ratio","sourceField":"service.name"},"7b4248d6-1464-453e-ae96-c28fc0e68737":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"Agent","operationType":"terms","params":{"missingBucket":false,"orderBy":{"fallback":false,"type":"alphabetical"},"orderDirection":"asc","otherBucket":true,"size":20},"scale":"ordinal","sourceField":"agent.name"},"822ac48e-f644-4f5f-89ac-98897fa898b6":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"Version","operationType":"terms","params":{"missingBucket":false,"orderBy":{"fallback":false,"type":"alphabetical"},"orderDirection":"asc","otherBucket":true,"size":20},"scale":"ordinal","sourceField":"agent.version"}},"incompleteColumns":{}}}}},"filters":[],"query":{"language":"kuery","query":""},"visualization":{"columns":[{"columnId":"7b4248d6-1464-453e-ae96-c28fc0e68737","isTransposed":false},{"columnId":"1348f96b-85de-4927-aaa6-745ee8afd152","isTransposed":false},{"columnId":"822ac48e-f644-4f5f-89ac-98897fa898b6","isTransposed":false}],"layerId":"5d01f4c5-6eaa-4ae0-bb35-3e15d5b9d4c0","layerType":"data"}},"title":"Agent Version Usage","visualizationType":"lnsDatatable"},"coreMigrationVersion":"7.17.0","id":"2a2fc690-8a9f-11ec-b781-0f74df3e04a9","migrationVersion":{"lens":"7.16.0"},"references":[{"id":"apm_static_index_pattern_id","name":"indexpattern-datasource-current-indexpattern","type":"index-pattern"},{"id":"apm_static_index_pattern_id","name":"indexpattern-datasource-layer-5d01f4c5-6eaa-4ae0-bb35-3e15d5b9d4c0","type":"index-pattern"}],"type":"lens","updated_at":"2022-02-10T18:27:55.389Z","version":"WzEwMzAsMV0="} 2 | {"excludedObjects":[],"excludedObjectsCount":0,"exportedCount":1,"missingRefCount":0,"missingReferences":[]} -------------------------------------------------------------------------------- /kibana/7.x/error_details.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_id": "5f08a870-7c6a-11e7-aa55-3b0d52c71c60", 4 | "_migrationVersion": { 5 | "dashboard": "7.0.0" 6 | }, 7 | "_references": [ 8 | { 9 | "id": "c618e4e0-7c69-11e7-aa55-3b0d52c71c60", 10 | "name": "panel_0", 11 | "type": "visualization" 12 | }, 13 | { 14 | "id": "ceefd050-7c6a-11e7-aa55-3b0d52c71c60", 15 | "name": "panel_1", 16 | "type": "search" 17 | } 18 | ], 19 | "_source": { 20 | "description": "", 21 | "hits": 0, 22 | "kibanaSavedObjectMeta": { 23 | "searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"version\":true,\"highlightAll\":true}" 24 | }, 25 | "optionsJSON": "{\"darkTheme\": false}", 26 | "panelsJSON": "[{\"size_x\":12,\"size_y\":3,\"panelIndex\":1,\"col\":1,\"row\":1,\"panelRefName\":\"panel_0\"},{\"sort\":[\"@timestamp\",\"desc\"],\"size_x\":12,\"size_y\":21,\"panelIndex\":2,\"col\":1,\"columns\":[\"error.culprit\",\"error.exception.type\",\"error.exception.message\",\"error.log.message\",\"error.exception.handled\",\"service.name\"],\"row\":4,\"panelRefName\":\"panel_1\"}]", 27 | "timeRestore": false, 28 | "title": "[APM] Error Details", 29 | "uiStateJSON": "{}", 30 | "version": 1 31 | }, 32 | "_type": "dashboard" 33 | }, 34 | { 35 | "_id": "c618e4e0-7c69-11e7-aa55-3b0d52c71c60", 36 | "_migrationVersion": { 37 | "visualization": "7.0.0" 38 | }, 39 | "_references": [ 40 | { 41 | "id": "apm-*", 42 | "name": "kibanaSavedObjectMeta.searchSourceJSON.index", 43 | "type": "index-pattern" 44 | } 45 | ], 46 | "_source": { 47 | "description": "", 48 | "kibanaSavedObjectMeta": { 49 | "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" 50 | }, 51 | "title": "Error Occurrences [APM]", 52 | "uiStateJSON": "{}", 53 | "version": 1, 54 | "visState": "{\"params\":{\"time_field\":\"@timestamp\",\"series\":[{\"line_width\":\"0\",\"terms_field\":\"error.grouping_key\",\"point_size\":1,\"color\":\"rgba(0,156,224,1)\",\"label\":\"Occurrences\",\"metrics\":[{\"type\":\"count\",\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\"}],\"seperate_axis\":0,\"split_mode\":\"terms\",\"chart_type\":\"bar\",\"stacked\":\"none\",\"axis_position\":\"right\",\"formatter\":\"number\",\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"fill\":\"1\"}],\"axis_formatter\":\"number\",\"interval\":\">=1m\",\"filter\":\"processor.event:error\",\"show_legend\":0,\"show_grid\":1,\"axis_position\":\"left\",\"type\":\"timeseries\",\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\"},\"type\":\"metrics\",\"aggs\":[],\"title\":\"Error Occurrences [APM]\"}" 55 | }, 56 | "_type": "visualization" 57 | }, 58 | { 59 | "_id": "ceefd050-7c6a-11e7-aa55-3b0d52c71c60", 60 | "_migrationVersion": { 61 | "search": "7.0.0" 62 | }, 63 | "_references": [ 64 | { 65 | "id": "apm-*", 66 | "name": "kibanaSavedObjectMeta.searchSourceJSON.index", 67 | "type": "index-pattern" 68 | }, 69 | { 70 | "id": "apm-*", 71 | "name": "kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index", 72 | "type": "index-pattern" 73 | } 74 | ], 75 | "_source": { 76 | "columns": [ 77 | "error.culprit", 78 | "error.exception.type", 79 | "error.exception.message", 80 | "error.log.message", 81 | "error.exception.handled", 82 | "service.name" 83 | ], 84 | "description": "", 85 | "hits": 0, 86 | "kibanaSavedObjectMeta": { 87 | "searchSourceJSON": "{\"filter\":[{\"query\":{\"match\":{\"processor.event\":{\"query\":\"error\",\"type\":\"phrase\"}}},\"meta\":{\"value\":\"error\",\"disabled\":false,\"alias\":null,\"params\":{\"query\":\"error\",\"type\":\"phrase\"},\"key\":\"processor.event\",\"negate\":false,\"type\":\"phrase\",\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index\"},\"$state\":{\"store\":\"appState\"}}],\"version\":true,\"highlightAll\":true,\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" 88 | }, 89 | "sort": [ 90 | "@timestamp", 91 | "desc" 92 | ], 93 | "title": "Error Details [APM]", 94 | "version": 1 95 | }, 96 | "_type": "search" 97 | } 98 | ] -------------------------------------------------------------------------------- /kibana/7.x/errors.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_id": "37f6fac0-7c6a-11e7-aa55-3b0d52c71c60", 4 | "_migrationVersion": { 5 | "dashboard": "7.0.0" 6 | }, 7 | "_references": [ 8 | { 9 | "id": "22518e70-7c69-11e7-aa55-3b0d52c71c60", 10 | "name": "panel_0", 11 | "type": "visualization" 12 | }, 13 | { 14 | "id": "c618e4e0-7c69-11e7-aa55-3b0d52c71c60", 15 | "name": "panel_1", 16 | "type": "visualization" 17 | } 18 | ], 19 | "_source": { 20 | "description": "", 21 | "hits": 0, 22 | "kibanaSavedObjectMeta": { 23 | "searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"version\":true,\"highlightAll\":true}" 24 | }, 25 | "optionsJSON": "{\"darkTheme\": false}", 26 | "panelsJSON": "[{\"size_x\":12,\"size_y\":10,\"panelIndex\":1,\"col\":1,\"row\":4,\"panelRefName\":\"panel_0\"},{\"size_x\":12,\"size_y\":3,\"panelIndex\":2,\"col\":1,\"row\":1,\"panelRefName\":\"panel_1\"}]", 27 | "timeRestore": false, 28 | "title": "[APM] Errors", 29 | "uiStateJSON": "{\"P-1\": {\"vis\": {\"params\": {\"sort\": {\"columnIndex\": null, \"direction\": null}}}}}", 30 | "version": 1 31 | }, 32 | "_type": "dashboard" 33 | }, 34 | { 35 | "_id": "22518e70-7c69-11e7-aa55-3b0d52c71c60", 36 | "_migrationVersion": { 37 | "visualization": "7.0.0" 38 | }, 39 | "_references": [ 40 | { 41 | "id": "apm-*", 42 | "name": "kibanaSavedObjectMeta.searchSourceJSON.index", 43 | "type": "index-pattern" 44 | } 45 | ], 46 | "_source": { 47 | "description": "", 48 | "kibanaSavedObjectMeta": { 49 | "searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" 50 | }, 51 | "title": "Top Errors for Time Period [APM]", 52 | "uiStateJSON": "{\"vis\": {\"params\": {\"sort\": {\"columnIndex\": null, \"direction\": null}}}}", 53 | "version": 1, 54 | "visState": "{\"title\":\"Top Errors for Time Period [APM]\",\"type\":\"table\",\"params\":{\"sort\":{\"columnIndex\":null,\"direction\":null},\"perPage\":25,\"showPartialRows\":false,\"totalFunc\":\"sum\",\"showTotal\":false,\"showMetricsAtAllLevels\":false,\"dimensions\":{\"metrics\":[{\"accessor\":1,\"format\":{\"id\":\"string\"},\"params\":{},\"aggType\":\"top_hits\"},{\"accessor\":2,\"format\":{\"id\":\"number\"},\"params\":{},\"aggType\":\"count\"},{\"accessor\":3,\"format\":{\"id\":\"string\"},\"params\":{},\"aggType\":\"top_hits\"},{\"accessor\":4,\"format\":{\"id\":\"string\"},\"params\":{},\"aggType\":\"top_hits\"},{\"accessor\":5,\"format\":{\"id\":\"string\"},\"params\":{},\"aggType\":\"top_hits\"}],\"buckets\":[{\"accessor\":0,\"format\":{\"id\":\"terms\",\"params\":{\"id\":\"string\",\"otherBucketLabel\":\"Other\",\"missingBucketLabel\":\"Missing\"}},\"params\":{},\"aggType\":\"terms\"}]}},\"aggs\":[{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"bucket\",\"params\":{\"field\":\"error.culprit\",\"size\":100,\"order\":\"desc\",\"orderBy\":\"1\",\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"customLabel\":\"Error Culprit\"}},{\"id\":\"5\",\"enabled\":true,\"type\":\"top_hits\",\"schema\":\"metric\",\"params\":{\"field\":\"error.exception.message\",\"aggregate\":\"concat\",\"size\":1,\"sortField\":\"@timestamp\",\"sortOrder\":\"desc\",\"customLabel\":\"Message\"}},{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{\"customLabel\":\"Number of Errors\"}},{\"id\":\"4\",\"enabled\":true,\"type\":\"top_hits\",\"schema\":\"metric\",\"params\":{\"field\":\"error.exception.type\",\"aggregate\":\"concat\",\"size\":1,\"sortField\":\"@timestamp\",\"sortOrder\":\"desc\",\"customLabel\":\"Type\"}},{\"id\":\"6\",\"enabled\":true,\"type\":\"top_hits\",\"schema\":\"metric\",\"params\":{\"field\":\"service.name\",\"aggregate\":\"concat\",\"size\":1,\"sortField\":\"@timestamp\",\"sortOrder\":\"desc\",\"customLabel\":\"App Name\"}},{\"id\":\"7\",\"enabled\":true,\"type\":\"top_hits\",\"schema\":\"metric\",\"params\":{\"field\":\"error.grouping_key\",\"aggregate\":\"concat\",\"size\":1,\"sortField\":\"@timestamp\",\"sortOrder\":\"desc\",\"customLabel\":\"Error Grouping Key\"}}]}" 55 | }, 56 | "_type": "visualization" 57 | }, 58 | { 59 | "_id": "c618e4e0-7c69-11e7-aa55-3b0d52c71c60", 60 | "_migrationVersion": { 61 | "visualization": "7.0.0" 62 | }, 63 | "_references": [ 64 | { 65 | "id": "apm-*", 66 | "name": "kibanaSavedObjectMeta.searchSourceJSON.index", 67 | "type": "index-pattern" 68 | } 69 | ], 70 | "_source": { 71 | "description": "", 72 | "kibanaSavedObjectMeta": { 73 | "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" 74 | }, 75 | "title": "Error Occurrences [APM]", 76 | "uiStateJSON": "{}", 77 | "version": 1, 78 | "visState": "{\"params\":{\"time_field\":\"@timestamp\",\"series\":[{\"line_width\":\"0\",\"terms_field\":\"error.grouping_key\",\"point_size\":1,\"color\":\"rgba(0,156,224,1)\",\"label\":\"Occurrences\",\"metrics\":[{\"type\":\"count\",\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\"}],\"seperate_axis\":0,\"split_mode\":\"terms\",\"chart_type\":\"bar\",\"stacked\":\"none\",\"axis_position\":\"right\",\"formatter\":\"number\",\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"fill\":\"1\"}],\"axis_formatter\":\"number\",\"interval\":\">=1m\",\"filter\":\"processor.event:error\",\"show_legend\":0,\"show_grid\":1,\"axis_position\":\"left\",\"type\":\"timeseries\",\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\"},\"type\":\"metrics\",\"aggs\":[],\"title\":\"Error Occurrences [APM]\"}" 79 | }, 80 | "_type": "visualization" 81 | } 82 | ] -------------------------------------------------------------------------------- /kibana/7.x/services.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_id": "8d3ed660-7828-11e7-8c47-65b845b5cfb3", 4 | "_migrationVersion": { 5 | "dashboard": "7.0.0" 6 | }, 7 | "_references": [ 8 | { 9 | "id": "1ffc5e20-7827-11e7-8c47-65b845b5cfb3", 10 | "name": "panel_0", 11 | "type": "visualization" 12 | }, 13 | { 14 | "id": "1bdca740-7828-11e7-8c47-65b845b5cfb3", 15 | "name": "panel_1", 16 | "type": "visualization" 17 | }, 18 | { 19 | "id": "804ffc40-7828-11e7-8c47-65b845b5cfb3", 20 | "name": "panel_2", 21 | "type": "visualization" 22 | } 23 | ], 24 | "_source": { 25 | "description": "", 26 | "hits": 0, 27 | "kibanaSavedObjectMeta": { 28 | "searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"version\":true,\"highlightAll\":true}" 29 | }, 30 | "optionsJSON": "{\"darkTheme\": false}", 31 | "panelsJSON": "[{\"size_x\":12,\"size_y\":5,\"panelIndex\":1,\"col\":1,\"row\":4,\"panelRefName\":\"panel_0\"},{\"size_x\":6,\"size_y\":3,\"panelIndex\":2,\"col\":1,\"row\":1,\"panelRefName\":\"panel_1\"},{\"size_x\":6,\"size_y\":3,\"panelIndex\":3,\"col\":7,\"row\":1,\"panelRefName\":\"panel_2\"}]", 32 | "timeRestore": false, 33 | "title": "[APM] Services", 34 | "uiStateJSON": "{\"P-1\": {\"vis\": {\"params\": {\"sort\": {\"columnIndex\": null, \"direction\": null}}}}}", 35 | "version": 1 36 | }, 37 | "_type": "dashboard" 38 | }, 39 | { 40 | "_id": "1ffc5e20-7827-11e7-8c47-65b845b5cfb3", 41 | "_migrationVersion": { 42 | "visualization": "7.0.0" 43 | }, 44 | "_references": [ 45 | { 46 | "id": "apm-*", 47 | "name": "kibanaSavedObjectMeta.searchSourceJSON.index", 48 | "type": "index-pattern" 49 | } 50 | ], 51 | "_source": { 52 | "description": "", 53 | "kibanaSavedObjectMeta": { 54 | "searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" 55 | }, 56 | "title": "Services [APM]", 57 | "uiStateJSON": "{\"vis\": {\"params\": {\"sort\": {\"columnIndex\": null, \"direction\": null}}}}", 58 | "version": 1, 59 | "visState": "{\"params\":{\"sort\":{\"columnIndex\":null,\"direction\":null},\"perPage\":10,\"showPartialRows\":false,\"totalFunc\":\"sum\",\"showTotal\":false,\"showMeticsAtAllLevels\":false},\"type\":\"table\",\"aggs\":[{\"type\":\"avg\",\"enabled\":true,\"id\":\"1\",\"params\":{\"field\":\"transaction.duration.us\",\"customLabel\":\"Avg. Trans. Time\"},\"schema\":\"metric\"},{\"type\":\"percentiles\",\"enabled\":true,\"id\":\"3\",\"params\":{\"field\":\"transaction.duration.us\",\"percents\":[95],\"customLabel\":\"Trans. Time\"},\"schema\":\"metric\"},{\"type\":\"cardinality\",\"enabled\":true,\"id\":\"4\",\"params\":{\"field\":\"transaction.id\",\"customLabel\":\"Total Transactions\"},\"schema\":\"metric\"},{\"type\":\"cardinality\",\"enabled\":true,\"id\":\"6\",\"params\":{\"field\":\"error.id\",\"customLabel\":\"Errors\"},\"schema\":\"metric\"},{\"type\":\"terms\",\"enabled\":true,\"id\":\"2\",\"params\":{\"orderBy\":\"1\",\"field\":\"service.name\",\"order\":\"desc\",\"size\":1000},\"schema\":\"bucket\"}],\"title\":\"Services [APM]\"}" 60 | }, 61 | "_type": "visualization" 62 | }, 63 | { 64 | "_id": "1bdca740-7828-11e7-8c47-65b845b5cfb3", 65 | "_migrationVersion": { 66 | "visualization": "7.0.0" 67 | }, 68 | "_references": [ 69 | { 70 | "id": "apm-*", 71 | "name": "kibanaSavedObjectMeta.searchSourceJSON.index", 72 | "type": "index-pattern" 73 | } 74 | ], 75 | "_source": { 76 | "description": "", 77 | "kibanaSavedObjectMeta": { 78 | "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" 79 | }, 80 | "title": "Top Services by Transaction Time [APM]", 81 | "uiStateJSON": "{}", 82 | "version": 1, 83 | "visState": "{\"params\":{\"time_field\":\"@timestamp\",\"series\":[{\"line_width\":\"2\",\"terms_field\":\"service.name\",\"point_size\":1,\"color\":\"rgba(0,156,224,1)\",\"value_template\":\"{{value}} ms\",\"metrics\":[{\"field\":\"transaction.duration.us\",\"type\":\"avg\",\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\"}],\"seperate_axis\":0,\"split_mode\":\"terms\",\"chart_type\":\"line\",\"terms_order_by\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"stacked\":\"none\",\"axis_position\":\"right\",\"formatter\":\"us,ms,0\",\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"split_color_mode\":\"gradient\",\"fill\":\"0\"}],\"axis_formatter\":\"number\",\"interval\":\">=1m\",\"show_legend\":1,\"show_grid\":1,\"axis_position\":\"left\",\"type\":\"timeseries\",\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\"},\"type\":\"metrics\",\"aggs\":[],\"title\":\"Top Services by Transaction Time [APM]\"}" 84 | }, 85 | "_type": "visualization" 86 | }, 87 | { 88 | "_id": "804ffc40-7828-11e7-8c47-65b845b5cfb3", 89 | "_migrationVersion": { 90 | "visualization": "7.0.0" 91 | }, 92 | "_references": [ 93 | { 94 | "id": "apm-*", 95 | "name": "kibanaSavedObjectMeta.searchSourceJSON.index", 96 | "type": "index-pattern" 97 | } 98 | ], 99 | "_source": { 100 | "description": "", 101 | "kibanaSavedObjectMeta": { 102 | "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" 103 | }, 104 | "title": "Top Services by Transaction Per Minute [APM]", 105 | "uiStateJSON": "{}", 106 | "version": 1, 107 | "visState": "{\"params\":{\"time_field\":\"@timestamp\",\"series\":[{\"line_width\":\"2\",\"terms_field\":\"service.name\",\"point_size\":1,\"color\":\"rgba(0,156,224,1)\",\"value_template\":\"{{value}} tpm\",\"metrics\":[{\"type\":\"count\",\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\"},{\"field\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"type\":\"cumulative_sum\",\"id\":\"3fcaa6c0-7828-11e7-bb25-2ff6dee07a1b\"},{\"field\":\"3fcaa6c0-7828-11e7-bb25-2ff6dee07a1b\",\"type\":\"derivative\",\"id\":\"467f1cd0-7828-11e7-bb25-2ff6dee07a1b\",\"unit\":\"1m\"},{\"field\":\"467f1cd0-7828-11e7-bb25-2ff6dee07a1b\",\"type\":\"positive_only\",\"id\":\"4bd1b8f0-7828-11e7-bb25-2ff6dee07a1b\",\"unit\":\"\"}],\"seperate_axis\":0,\"split_mode\":\"terms\",\"chart_type\":\"line\",\"terms_order_by\":\"_count\",\"stacked\":\"none\",\"axis_position\":\"right\",\"formatter\":\"number\",\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"fill\":\"0\"}],\"axis_formatter\":\"number\",\"interval\":\">=1m\",\"show_legend\":1,\"show_grid\":1,\"axis_position\":\"left\",\"type\":\"timeseries\",\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\"},\"type\":\"metrics\",\"aggs\":[],\"title\":\"Top Apps by Transaction Per Minute [APM]\"}" 108 | }, 109 | "_type": "visualization" 110 | } 111 | ] -------------------------------------------------------------------------------- /kibana/7.x/span_details.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_id": "3e3de700-7de0-11e7-b115-df9c90da2df1", 4 | "_migrationVersion": { 5 | "dashboard": "7.0.0" 6 | }, 7 | "_references": [ 8 | { 9 | "id": "d7735b90-7ddf-11e7-b115-df9c90da2df1", 10 | "name": "panel_0", 11 | "type": "search" 12 | } 13 | ], 14 | "_source": { 15 | "description": "", 16 | "hits": 0, 17 | "kibanaSavedObjectMeta": { 18 | "searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"version\":true,\"highlightAll\":true}" 19 | }, 20 | "optionsJSON": "{\"darkTheme\": false}", 21 | "panelsJSON": "[{\"sort\":[\"span.start.us\",\"asc\"],\"col\":1,\"size_x\":12,\"size_y\":23,\"panelIndex\":1,\"columns\":[\"span.type\",\"span.name\",\"span.duration.us\",\"span.start.us\"],\"row\":1,\"panelRefName\":\"panel_0\"}]", 22 | "timeRestore": false, 23 | "title": "[APM] Span Details", 24 | "uiStateJSON": "{}", 25 | "version": 1 26 | }, 27 | "_type": "dashboard" 28 | }, 29 | { 30 | "_id": "d7735b90-7ddf-11e7-b115-df9c90da2df1", 31 | "_migrationVersion": { 32 | "search": "7.0.0" 33 | }, 34 | "_references": [ 35 | { 36 | "id": "apm-*", 37 | "name": "kibanaSavedObjectMeta.searchSourceJSON.index", 38 | "type": "index-pattern" 39 | }, 40 | { 41 | "id": "apm-*", 42 | "name": "kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index", 43 | "type": "index-pattern" 44 | } 45 | ], 46 | "_source": { 47 | "columns": [ 48 | "span.type", 49 | "span.name", 50 | "span.duration.us", 51 | "span.start.us" 52 | ], 53 | "description": "", 54 | "hits": 0, 55 | "kibanaSavedObjectMeta": { 56 | "searchSourceJSON": "{\"filter\":[{\"query\":{\"match\":{\"processor.event\":{\"query\":\"span\",\"type\":\"phrase\"}}},\"meta\":{\"value\":\"span\",\"disabled\":false,\"alias\":null,\"params\":{\"query\":\"span\",\"type\":\"phrase\"},\"key\":\"processor.event\",\"negate\":false,\"type\":\"phrase\",\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index\"},\"$state\":{\"store\":\"appState\"}}],\"version\":true,\"highlightAll\":true,\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" 57 | }, 58 | "sort": [ 59 | "span.start.us", 60 | "asc" 61 | ], 62 | "title": "Spans [APM]", 63 | "version": 1 64 | }, 65 | "_type": "search" 66 | } 67 | ] -------------------------------------------------------------------------------- /kibana/7.x/transactions.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "_id": "41b5d920-7821-11e7-8c47-65b845b5cfb3", 4 | "_migrationVersion": { 5 | "dashboard": "7.0.0" 6 | }, 7 | "_references": [ 8 | { 9 | "id": "a2e199b0-7820-11e7-8c47-65b845b5cfb3", 10 | "name": "panel_0", 11 | "type": "visualization" 12 | }, 13 | { 14 | "id": "09bcf890-7822-11e7-8c47-65b845b5cfb3", 15 | "name": "panel_1", 16 | "type": "visualization" 17 | }, 18 | { 19 | "id": "55606a60-7823-11e7-8c47-65b845b5cfb3", 20 | "name": "panel_2", 21 | "type": "visualization" 22 | } 23 | ], 24 | "_source": { 25 | "description": "", 26 | "hits": 0, 27 | "kibanaSavedObjectMeta": { 28 | "searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"version\":true,\"highlightAll\":true}" 29 | }, 30 | "optionsJSON": "{\"darkTheme\": false}", 31 | "panelsJSON": "[{\"size_x\":12,\"size_y\":10,\"panelIndex\":1,\"col\":1,\"row\":4,\"panelRefName\":\"panel_0\"},{\"size_x\":6,\"size_y\":3,\"panelIndex\":2,\"col\":1,\"row\":1,\"panelRefName\":\"panel_1\"},{\"size_x\":6,\"size_y\":3,\"panelIndex\":3,\"col\":7,\"row\":1,\"panelRefName\":\"panel_2\"}]", 32 | "timeRestore": false, 33 | "title": "[APM] Transactions", 34 | "uiStateJSON": "{\"P-1\": {\"vis\": {\"params\": {\"sort\": {\"columnIndex\": null, \"direction\": null}}}}}", 35 | "version": 1 36 | }, 37 | "_type": "dashboard" 38 | }, 39 | { 40 | "_id": "a2e199b0-7820-11e7-8c47-65b845b5cfb3", 41 | "_migrationVersion": { 42 | "visualization": "7.0.0" 43 | }, 44 | "_references": [ 45 | { 46 | "id": "apm-*", 47 | "name": "kibanaSavedObjectMeta.searchSourceJSON.index", 48 | "type": "index-pattern" 49 | } 50 | ], 51 | "_source": { 52 | "description": "", 53 | "kibanaSavedObjectMeta": { 54 | "searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" 55 | }, 56 | "title": "Top Transactions for Time Period [APM]", 57 | "uiStateJSON": "{\"vis\": {\"params\": {\"sort\": {\"columnIndex\": null, \"direction\": null}}}}", 58 | "version": 1, 59 | "visState": "{\"type\":\"table\",\"params\":{\"sort\":{\"columnIndex\":null,\"direction\":null},\"perPage\":25,\"showPartialRows\":false,\"totalFunc\":\"sum\",\"showTotal\":false,\"showMeticsAtAllLevels\":false},\"aggs\":[{\"params\":{\"orderBy\":\"1\",\"field\":\"transaction.name\",\"customLabel\":\"Transaction\",\"order\":\"desc\",\"size\":1000},\"type\":\"terms\",\"enabled\":true,\"id\":\"2\",\"schema\":\"bucket\"},{\"params\":{\"sortField\":\"@timestamp\",\"customLabel\":\"Type\",\"field\":\"transaction.type\",\"sortOrder\":\"desc\",\"aggregate\":\"concat\",\"size\":1},\"type\":\"top_hits\",\"enabled\":true,\"id\":\"5\",\"schema\":\"metric\"},{\"params\":{\"field\":\"transaction.duration.us\",\"customLabel\":\"Avg. Resp Time (ms)\"},\"type\":\"avg\",\"enabled\":true,\"id\":\"1\",\"schema\":\"metric\"},{\"params\":{\"field\":\"transaction.duration.us\",\"customLabel\":\"Resp Time (ms)\",\"percents\":[95]},\"type\":\"percentiles\",\"enabled\":true,\"id\":\"3\",\"schema\":\"metric\"},{\"params\":{\"sortField\":\"@timestamp\",\"customLabel\":\"View Spans\",\"field\":\"transaction.id\",\"sortOrder\":\"desc\",\"aggregate\":\"concat\",\"size\":1},\"type\":\"top_hits\",\"enabled\":true,\"id\":\"4\",\"schema\":\"metric\"}],\"title\":\"Top Transactions for Time Period [APM]\"}" 60 | }, 61 | "_type": "visualization" 62 | }, 63 | { 64 | "_id": "09bcf890-7822-11e7-8c47-65b845b5cfb3", 65 | "_migrationVersion": { 66 | "visualization": "7.0.0" 67 | }, 68 | "_references": [ 69 | { 70 | "id": "apm-*", 71 | "name": "kibanaSavedObjectMeta.searchSourceJSON.index", 72 | "type": "index-pattern" 73 | } 74 | ], 75 | "_source": { 76 | "description": "", 77 | "kibanaSavedObjectMeta": { 78 | "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" 79 | }, 80 | "title": "Transaction Times [APM]", 81 | "uiStateJSON": "{}", 82 | "version": 1, 83 | "visState": "{\"params\":{\"time_field\":\"@timestamp\",\"series\":[{\"line_width\":\"2\",\"point_size\":1,\"color\":\"rgba(0,156,224,1)\",\"value_template\":\"{{value}} ms\",\"label\":\"Average\",\"metrics\":[{\"field\":\"transaction.duration.us\",\"type\":\"avg\",\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\"}],\"seperate_axis\":0,\"split_mode\":\"everything\",\"chart_type\":\"line\",\"stacked\":\"none\",\"axis_position\":\"right\",\"formatter\":\"us,ms,0\",\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"fill\":\"0\"},{\"line_width\":1,\"point_size\":1,\"color\":\"rgba(115,216,255,1)\",\"value_template\":\"{{value}} ms\",\"label\":\"95th Percentile\",\"metrics\":[{\"field\":\"transaction.duration.us\",\"percentiles\":[{\"mode\":\"line\",\"percentile\":\"\",\"shade\":0.2,\"value\":\"95\",\"id\":\"858ec670-7821-11e7-8745-07eaffcb65e5\"}],\"type\":\"percentile\",\"id\":\"79921481-7821-11e7-8745-07eaffcb65e5\"}],\"seperate_axis\":0,\"split_mode\":\"everything\",\"chart_type\":\"line\",\"stacked\":\"none\",\"axis_position\":\"right\",\"formatter\":\"us,ms,0\",\"id\":\"79921480-7821-11e7-8745-07eaffcb65e5\",\"fill\":0.5},{\"line_width\":\"2\",\"point_size\":1,\"color\":\"rgba(254,146,0,1)\",\"value_template\":\"{{value}} ms\",\"label\":\"99th Percentile\",\"metrics\":[{\"field\":\"transaction.duration.us\",\"percentiles\":[{\"mode\":\"line\",\"percentile\":\"\",\"shade\":0.2,\"value\":\"99\",\"id\":\"858ec670-7821-11e7-8745-07eaffcb65e5\"}],\"type\":\"percentile\",\"id\":\"c1e42de1-7821-11e7-8745-07eaffcb65e5\"}],\"seperate_axis\":0,\"split_mode\":\"everything\",\"chart_type\":\"line\",\"stacked\":\"none\",\"axis_position\":\"right\",\"formatter\":\"us,ms,0\",\"id\":\"c1e42de0-7821-11e7-8745-07eaffcb65e5\",\"fill\":\"0\"}],\"axis_formatter\":\"number\",\"interval\":\">=1m\",\"show_legend\":1,\"show_grid\":1,\"legend_position\":\"right\",\"axis_position\":\"left\",\"type\":\"timeseries\",\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\"},\"type\":\"metrics\",\"aggs\":[],\"title\":\"Transaction Times [APM]\"}" 84 | }, 85 | "_type": "visualization" 86 | }, 87 | { 88 | "_id": "55606a60-7823-11e7-8c47-65b845b5cfb3", 89 | "_migrationVersion": { 90 | "visualization": "7.0.0" 91 | }, 92 | "_references": [ 93 | { 94 | "id": "apm-*", 95 | "name": "kibanaSavedObjectMeta.searchSourceJSON.index", 96 | "type": "index-pattern" 97 | } 98 | ], 99 | "_source": { 100 | "description": "", 101 | "kibanaSavedObjectMeta": { 102 | "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}" 103 | }, 104 | "title": "Transaction Per Minute [APM]", 105 | "uiStateJSON": "{}", 106 | "version": 1, 107 | "visState": "{\"params\":{\"time_field\":\"@timestamp\",\"series\":[{\"line_width\":\"2\",\"terms_field\":\"transaction.result\",\"point_size\":\"0\",\"color\":\"rgba(115,216,255,1)\",\"value_template\":\"{{value}} tpm\",\"label\":\"\",\"metrics\":[{\"field\":\"transaction.id\",\"type\":\"cardinality\",\"id\":\"61ca57f2-469d-11e7-af02-69e470af7417\"},{\"field\":\"61ca57f2-469d-11e7-af02-69e470af7417\",\"type\":\"cumulative_sum\",\"id\":\"3fcaa6c0-7828-11e7-bb25-2ff6dee07a1b\"},{\"field\":\"3fcaa6c0-7828-11e7-bb25-2ff6dee07a1b\",\"type\":\"derivative\",\"id\":\"467f1cd0-7828-11e7-bb25-2ff6dee07a1b\",\"unit\":\"1m\"},{\"field\":\"467f1cd0-7828-11e7-bb25-2ff6dee07a1b\",\"type\":\"positive_only\",\"id\":\"4bd1b8f0-7828-11e7-bb25-2ff6dee07a1b\",\"unit\":\"\"}],\"seperate_axis\":0,\"split_mode\":\"everything\",\"chart_type\":\"line\",\"stacked\":\"none\",\"axis_position\":\"right\",\"formatter\":\"number\",\"id\":\"61ca57f1-469d-11e7-af02-69e470af7417\",\"fill\":\"0\"}],\"axis_formatter\":\"number\",\"interval\":\">=1m\",\"show_legend\":0,\"show_grid\":1,\"axis_position\":\"left\",\"type\":\"timeseries\",\"id\":\"61ca57f0-469d-11e7-af02-69e470af7417\"},\"type\":\"metrics\",\"aggs\":[],\"title\":\"Transaction Per Minute [APM]\"}" 108 | }, 109 | "_type": "visualization" 110 | } 111 | ] -------------------------------------------------------------------------------- /kibana/8.x/agent-versions.ndjson: -------------------------------------------------------------------------------- 1 | {"attributes":{"description":"","state":{"datasourceStates":{"indexpattern":{"layers":{"0d42d2e9-8ff6-4663-9151-24a8c62dbd8c":{"columnOrder":["3b5f1937-b817-41c6-adbf-b49dab4f0aae","b7b482f3-b3b5-46b8-8b24-d6f10763c6bd","44c8adb7-b3cc-409e-a622-805950cc3f5f"],"columns":{"3b5f1937-b817-41c6-adbf-b49dab4f0aae":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"Agent","operationType":"terms","params":{"missingBucket":false,"orderBy":{"fallback":false,"type":"alphabetical"},"orderDirection":"asc","otherBucket":true,"size":20},"scale":"ordinal","sourceField":"agent.name"},"44c8adb7-b3cc-409e-a622-805950cc3f5f":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Services","operationType":"unique_count","scale":"ratio","sourceField":"service.name"},"b7b482f3-b3b5-46b8-8b24-d6f10763c6bd":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"Version","operationType":"terms","params":{"missingBucket":false,"orderBy":{"fallback":false,"type":"alphabetical"},"orderDirection":"desc","otherBucket":true,"size":20},"scale":"ordinal","sourceField":"agent.version"}},"incompleteColumns":{}}}}},"filters":[],"query":{"language":"kuery","query":""},"visualization":{"columns":[{"columnId":"3b5f1937-b817-41c6-adbf-b49dab4f0aae","isTransposed":false},{"columnId":"3b5f1937-b817-41c6-adbf-b49dab4f0aae","isTransposed":false},{"columnId":"b7b482f3-b3b5-46b8-8b24-d6f10763c6bd","isTransposed":false},{"columnId":"44c8adb7-b3cc-409e-a622-805950cc3f5f","isTransposed":false}],"layerId":"0d42d2e9-8ff6-4663-9151-24a8c62dbd8c","layerType":"data"}},"title":"Agent Version Usage","visualizationType":"lnsDatatable"},"coreMigrationVersion":"8.1.0","id":"15e688f0-8a1c-11ec-aa8d-9b2a416a4d20","migrationVersion":{"lens":"8.1.0"},"references":[{"id":"apm_static_index_pattern_id","name":"indexpattern-datasource-current-indexpattern","type":"index-pattern"},{"id":"apm_static_index_pattern_id","name":"indexpattern-datasource-layer-0d42d2e9-8ff6-4663-9151-24a8c62dbd8c","type":"index-pattern"}],"type":"lens","updated_at":"2022-02-10T02:49:37.282Z","version":"WzI0MiwxXQ=="} 2 | {"excludedObjects":[],"excludedObjectsCount":0,"exportedCount":1,"missingRefCount":0,"missingReferences":[]} -------------------------------------------------------------------------------- /kibana/8.x/agent-versions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elastic/apm-contrib/262d2704e2a7a2886795c82dea5385c9875ad022/kibana/8.x/agent-versions.png -------------------------------------------------------------------------------- /kibana/readme.md: -------------------------------------------------------------------------------- 1 | ## APM Dashboards and Visualizations 2 | 3 | A Kibana dashboard displays a collection of visualizations and searches. 4 | This is a collection of dashboards, visualizations, and searches that you can use to organize and view your Elastic APM data. 5 | 6 | ### Installation 7 | 8 | Dashboards are imported on the **Management > Saved objects** page. 9 | Full documentation on this process is available in [Kibana](https://www.elastic.co/guide/en/kibana/current/managing-saved-objects.html). 10 | 11 | After importing, visit the [Dashboard](https://www.elastic.co/guide/en/kibana/current/dashboard.html) tab to view and edit your imported dashboards. 12 | 13 | ### Dashboards 14 | 15 | #### Errors 16 | 17 | [6.x](6.x/errors.json) | [7.x](7.x/errors.json) 18 | 19 | * Top errors for time period (visualization) 20 | * Error occurrences (visualization) 21 | 22 | [6.x](6.x/error_details.json) | [7.x](7.x/error_details.json) 23 | 24 | * Error occurrences (visualization) 25 | * Error details (search) 26 | 27 | #### Services 28 | 29 | [6.x](6.x/services.json) | [7.x](7.x/services.json) 30 | 31 | * Top services by transaction time (visualization) 32 | * Top services by transaction per minute (visualization) 33 | * Services (visualization) 34 | 35 | #### Spans 36 | 37 | [6.x](6.x/span_details.json) | [7.x](7.x/span_details.json) 38 | 39 | * Spans (search) 40 | 41 | #### Transactions 42 | 43 | [6.x](6.x/transactions.json) | [7.x](7.x/transactions.json) 44 | 45 | * Transaction times (visualization) 46 | * Transaction per minute (visualization) 47 | * Top transactions for time period (visualization) 48 | 49 | ### Visualizations 50 | 51 | #### Agent Versions 52 | 53 | [7.x](7.x/agent-versions.ndjson) | [8.x](8.x/agent-versions.ndjson) 54 | 55 | ![Agent Versions Table ](8.x/agent-versions.png) 56 | -------------------------------------------------------------------------------- /opentelemetry/.gitignore: -------------------------------------------------------------------------------- 1 | **/node_modules 2 | -------------------------------------------------------------------------------- /opentelemetry/README.md: -------------------------------------------------------------------------------- 1 | ## OpenTelemetry Quickstart 2 | 3 | This folder contains a `docker-compose.yml` for quickly bringing up an Elastic APM stack, 4 | along with a demo application. The application is comprised of three components: 5 | 6 | - "pinger", which periodically sends an HTTP request to the "frontend" 7 | - "frontend", a Node.js (Express) web service which serves a single endpoint "/", which triggers an HTTP request to "backend" 8 | - "backend", a Python (Flask) web service which serves a single endpoint "/backend" 9 | 10 | The "pinger" service is instrumented with Elastic APM, whereas "frontend" and "backend" are both instrumented with 11 | OpenTelemetry, and configured to send their trace events to an OpenTelemetry Collector. Because both Elastic APM and 12 | OpenTelemetry use the W3C Trace-Context standard, distributed traces are continued despite using the two methods of 13 | instrumentation. 14 | 15 | Get started by cloning this repo, and bringing up the stack and demo application: 16 | 17 | ```sh 18 | git clone https://github.com/elastic/apm-contrib 19 | cd apm-contrib/opentelemetry 20 | docker-compose up 21 | ``` 22 | 23 | This will download Docker container images for Elasticsearch, Kibana, APM Server, and OpenTelemetry Collector, and 24 | build the custom application containers. Once they are all running, the demo application will automatically start 25 | producing APM data. 26 | 27 | Visit http://localhost:5601/app/apm to see the results! 28 | 29 | *to stop*: hit ctrl-c to shut down all of the containers started 30 | -------------------------------------------------------------------------------- /opentelemetry/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "2" 2 | services: 3 | 4 | frontend: 5 | build: 6 | context: ./otel-js-frontend 7 | depends_on: 8 | - apm-server 9 | environment: 10 | OTEL_EXPORTER_OTLP_ENDPOINT: apm-server:8200 11 | OTEL_EXPORTER_OTLP_TRACES_INSECURE: true 12 | 13 | backend: 14 | build: 15 | context: ./otel-python-backend 16 | depends_on: 17 | - apm-server 18 | environment: 19 | OTEL_EXPORTER_OTLP_ENDPOINT: apm-server:8200 20 | OTEL_EXPORTER_OTLP_TRACES_INSECURE: true 21 | 22 | pinger: 23 | build: 24 | context: ./elastic-pinger 25 | environment: 26 | - ELASTIC_APM_SERVER_URL=http://apm-server:8200 27 | depends_on: 28 | - apm-server 29 | 30 | apm-server: 31 | image: docker.elastic.co/apm/apm-server:7.17.6 32 | command: 33 | - -e 34 | - --E 35 | - output.elasticsearch.hosts=["elasticsearch:9200"] 36 | 37 | elasticsearch: 38 | image: docker.elastic.co/elasticsearch/elasticsearch:7.17.6 39 | environment: 40 | - discovery.type=single-node 41 | - bootstrap.memory_lock=true 42 | - "ES_JAVA_OPTS=-Xms512m -Xmx512m" 43 | ports: 44 | - 9200:9200 45 | ulimits: 46 | memlock: 47 | soft: -1 48 | hard: -1 49 | 50 | kibana: 51 | image: docker.elastic.co/kibana/kibana:7.17.6 52 | ports: 53 | - 5601:5601 54 | depends_on: 55 | - elasticsearch 56 | 57 | -------------------------------------------------------------------------------- /opentelemetry/elastic-pinger/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:latest 2 | 3 | WORKDIR /app 4 | ADD . /app 5 | RUN go build 6 | CMD ["./pinger"] 7 | 8 | -------------------------------------------------------------------------------- /opentelemetry/elastic-pinger/go.mod: -------------------------------------------------------------------------------- 1 | module pinger 2 | 3 | go 1.18 4 | 5 | require ( 6 | go.elastic.co/apm/module/apmhttp/v2 v2.1.0 7 | go.elastic.co/apm/v2 v2.1.0 8 | ) 9 | 10 | require ( 11 | github.com/armon/go-radix v1.0.0 // indirect 12 | github.com/elastic/go-licenser v0.4.0 // indirect 13 | github.com/elastic/go-sysinfo v1.7.1 // indirect 14 | github.com/elastic/go-windows v1.0.1 // indirect 15 | github.com/jcchavezs/porto v0.1.0 // indirect 16 | github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901 // indirect 17 | github.com/pkg/errors v0.9.1 // indirect 18 | github.com/prometheus/procfs v0.7.3 // indirect 19 | github.com/santhosh-tekuri/jsonschema v1.2.4 // indirect 20 | go.elastic.co/fastjson v1.1.0 // indirect 21 | golang.org/x/mod v0.5.1 // indirect 22 | golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect 23 | golang.org/x/tools v0.1.9 // indirect 24 | golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect 25 | howett.net/plist v1.0.0 // indirect 26 | ) 27 | -------------------------------------------------------------------------------- /opentelemetry/elastic-pinger/go.sum: -------------------------------------------------------------------------------- 1 | github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= 2 | github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= 3 | github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= 4 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 5 | github.com/elastic/go-licenser v0.4.0 h1:jLq6A5SilDS/Iz1ABRkO6BHy91B9jBora8FwGRsDqUI= 6 | github.com/elastic/go-licenser v0.4.0/go.mod h1:V56wHMpmdURfibNBggaSBfqgPxyT1Tldns1i87iTEvU= 7 | github.com/elastic/go-sysinfo v1.7.1 h1:Wx4DSARcKLllpKT2TnFVdSUJOsybqMYCNQZq1/wO+s0= 8 | github.com/elastic/go-sysinfo v1.7.1/go.mod h1:i1ZYdU10oLNfRzq4vq62BEwD2fH8KaWh6eh0ikPT9F0= 9 | github.com/elastic/go-windows v1.0.0/go.mod h1:TsU0Nrp7/y3+VwE82FoZF8gC/XFg/Elz6CcloAxnPgU= 10 | github.com/elastic/go-windows v1.0.1 h1:AlYZOldA+UJ0/2nBuqWdo90GFCgG9xuyw9SYzGUtJm0= 11 | github.com/elastic/go-windows v1.0.1/go.mod h1:FoVvqWSun28vaDQPbj2Elfc0JahhPB7WQEGa3c814Ss= 12 | github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= 13 | github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 14 | github.com/jcchavezs/porto v0.1.0 h1:Xmxxn25zQMmgE7/yHYmh19KcItG81hIwfbEEFnd6w/Q= 15 | github.com/jcchavezs/porto v0.1.0/go.mod h1:fESH0gzDHiutHRdX2hv27ojnOVFco37hg1W6E9EZF4A= 16 | github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= 17 | github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901 h1:rp+c0RAYOWj8l6qbCUTSiRLG/iKnW3K3/QfPPuSsBt4= 18 | github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901/go.mod h1:Z86h9688Y0wesXCyonoVr47MasHilkuLMqGhRZ4Hpak= 19 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 20 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 21 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 22 | github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 23 | github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 24 | github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= 25 | github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 26 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 27 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 28 | github.com/prometheus/procfs v0.0.0-20190425082905-87a4384529e0/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= 29 | github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= 30 | github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= 31 | github.com/santhosh-tekuri/jsonschema v1.2.4 h1:hNhW8e7t+H1vgY+1QeEQpveR6D4+OwKPXCfD2aieJis= 32 | github.com/santhosh-tekuri/jsonschema v1.2.4/go.mod h1:TEAUOeZSmIxTTuHatJzrvARHiuO9LYd+cIxzgEHCQI4= 33 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 34 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 35 | github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= 36 | github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 37 | github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 38 | github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= 39 | github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= 40 | go.elastic.co/apm/module/apmhttp/v2 v2.1.0 h1:3knDFopO6LmgrqY5z9HlmCaIG+PtM9HwZGhByFCCjh4= 41 | go.elastic.co/apm/module/apmhttp/v2 v2.1.0/go.mod h1:cKGRK1snYy5Sl/zs0GD+msE9b/amcM0CWbZn8XXBa9s= 42 | go.elastic.co/apm/v2 v2.1.0 h1:rkJSHE4ggekHhUR5v0KKkoMbrRSJN8YoBiEgQnkV1OY= 43 | go.elastic.co/apm/v2 v2.1.0/go.mod h1:KGQn56LtRmkQjt2qw4+c1Jz8gv9rCBUU/m21uxrqcps= 44 | go.elastic.co/fastjson v1.1.0 h1:3MrGBWWVIxe/xvsbpghtkFoPciPhOCmjsR/HfwEeQR4= 45 | go.elastic.co/fastjson v1.1.0/go.mod h1:boNGISWMjQsUPy/t6yqt2/1Wx4YNPSe+mZjlyw9vKKI= 46 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 47 | golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 48 | golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= 49 | golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 50 | golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 51 | golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 52 | golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 53 | golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38= 54 | golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= 55 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 56 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 57 | golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 58 | golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= 59 | golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= 60 | golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= 61 | golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 62 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 63 | golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 64 | golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 65 | golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 66 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 67 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 68 | golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 69 | golang.org/x/sys v0.0.0-20191025021431-6c3a3bfe00ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 70 | golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 71 | golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 72 | golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 73 | golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 74 | golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 75 | golang.org/x/sys v0.0.0-20211102192858-4dd72447c267/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 76 | golang.org/x/sys v0.0.0-20220209214540-3681064d5158 h1:rm+CHSpPEEW2IsXUib1ThaHIjuBVZjxNgSKmBLFfD4c= 77 | golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 78 | golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= 79 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 80 | golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 81 | golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= 82 | golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= 83 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 84 | golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 85 | golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= 86 | golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 87 | golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= 88 | golang.org/x/tools v0.1.9 h1:j9KsMiaP1c3B0OTQGth0/k+miLGTgLsAFUCrF2vLcF8= 89 | golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= 90 | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 91 | golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 92 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 93 | golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= 94 | golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 95 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 96 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 97 | gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0/go.mod h1:WDnlLJ4WF5VGsH/HVa3CI79GS0ol3YnhVnKP89i0kNg= 98 | gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 99 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= 100 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 101 | howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0= 102 | howett.net/plist v1.0.0 h1:7CrbWYbPPO/PyNy38b2EB/+gYbjCe2DXBxgtOOZbSQM= 103 | howett.net/plist v1.0.0/go.mod h1:lqaXoTrLY4hg8tnEzNru53gicrbv7rrk+2xJA/7hw9g= 104 | -------------------------------------------------------------------------------- /opentelemetry/elastic-pinger/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "net/http" 6 | "time" 7 | 8 | "go.elastic.co/apm/module/apmhttp/v2" 9 | "go.elastic.co/apm/v2" 10 | ) 11 | 12 | const url = "http://frontend:8080/" 13 | 14 | var httpClient = apmhttp.WrapClient(http.DefaultClient) 15 | 16 | func pingService(ctx context.Context) { 17 | tx := apm.DefaultTracer().StartTransaction("ping", "background") 18 | defer tx.End() 19 | ctx = apm.ContextWithTransaction(ctx, tx) 20 | 21 | req, err := http.NewRequestWithContext(ctx, "GET", url, nil) 22 | if err != nil { 23 | panic(err) 24 | } 25 | 26 | resp, err := httpClient.Do(req) 27 | if err != nil { 28 | apm.CaptureError(ctx, err).Send() 29 | return 30 | } 31 | defer resp.Body.Close() 32 | } 33 | 34 | func main() { 35 | ticker := time.NewTicker(time.Second) 36 | for range ticker.C { 37 | pingService(context.Background()) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /opentelemetry/otel-js-frontend/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:16 2 | 3 | WORKDIR /app 4 | ADD . /app 5 | RUN npm install 6 | CMD ["node", "-r", "./tracing.js", "app.js"] 7 | 8 | -------------------------------------------------------------------------------- /opentelemetry/otel-js-frontend/app.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const express = require("express"); 4 | const axios = require("axios"); 5 | 6 | const app = express(); 7 | 8 | app.get("/", (req, res) => { 9 | axios 10 | .get(`http://backend:8081/backend`) 11 | .then(result => { 12 | res.send(result.data); 13 | }) 14 | .catch(err => { 15 | console.error(err); 16 | res.status(500).send(); 17 | }); 18 | }); 19 | 20 | const PORT = 8080; 21 | app.listen(PORT, () => { 22 | console.log(`Listening for requests on http://localhost:${PORT}`); 23 | }); 24 | -------------------------------------------------------------------------------- /opentelemetry/otel-js-frontend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "@opentelemetry/api": "^1.2.0", 4 | "@opentelemetry/auto-instrumentations-node": "^0.32.1", 5 | "@opentelemetry/exporter-trace-otlp-grpc": "^0.33.0", 6 | "@opentelemetry/sdk-node": "^0.33.0", 7 | "@opentelemetry/sdk-trace-node": "^1.7.0", 8 | "axios": "^0.27.2", 9 | "express": "^4.18.1" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /opentelemetry/otel-js-frontend/tracing.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const process = require('process'); 4 | const opentelemetry = require('@opentelemetry/sdk-node'); 5 | const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node'); 6 | const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-grpc'); 7 | const { Resource } = require('@opentelemetry/resources'); 8 | const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions'); 9 | 10 | const sdk = new opentelemetry.NodeSDK({ 11 | resource: new Resource({ 12 | [SemanticResourceAttributes.SERVICE_NAME]: 'frontend', 13 | }), 14 | traceExporter: new OTLPTraceExporter(), 15 | instrumentations: [getNodeAutoInstrumentations()] 16 | }); 17 | 18 | sdk.start() 19 | .then(() => console.log('Tracing initialized')) 20 | .catch((error) => console.log('Error initializing tracing', error)); 21 | 22 | // gracefully shut down the SDK on process exit 23 | process.on('SIGTERM', () => { 24 | sdk.shutdown() 25 | .then(() => console.log('Tracing terminated')) 26 | .catch((error) => console.log('Error terminating tracing', error)) 27 | .finally(() => process.exit(0)); 28 | }); 29 | -------------------------------------------------------------------------------- /opentelemetry/otel-python-backend/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3 2 | 3 | WORKDIR /app 4 | COPY requirements.txt . 5 | RUN pip install -r requirements.txt 6 | ADD . /app 7 | CMD ["python", "server.py"] 8 | 9 | -------------------------------------------------------------------------------- /opentelemetry/otel-python-backend/requirements.txt: -------------------------------------------------------------------------------- 1 | backoff==2.1.2 2 | certifi==2022.9.24 3 | charset-normalizer==2.1.1 4 | click==8.1.3 5 | Deprecated==1.2.13 6 | Flask==2.3.2 7 | googleapis-common-protos==1.56.4 8 | grpcio==1.49.1 9 | idna==3.4 10 | itsdangerous==2.1.2 11 | Jinja2==3.1.2 12 | MarkupSafe==2.1.1 13 | opentelemetry-api==1.12.0 14 | opentelemetry-exporter-otlp==1.12.0 15 | opentelemetry-exporter-otlp-proto-grpc==1.12.0 16 | opentelemetry-exporter-otlp-proto-http==1.12.0 17 | opentelemetry-instrumentation==0.33b0 18 | opentelemetry-instrumentation-flask==0.33b0 19 | opentelemetry-instrumentation-wsgi==0.33b0 20 | opentelemetry-proto==1.12.0 21 | opentelemetry-sdk==1.12.0 22 | opentelemetry-semantic-conventions==0.33b0 23 | opentelemetry-util-http==0.33b0 24 | protobuf==3.20.2 25 | requests==2.28.1 26 | six==1.16.0 27 | typing_extensions==4.3.0 28 | urllib3==1.26.12 29 | Werkzeug==2.2.2 30 | wrapt==1.14.1 31 | -------------------------------------------------------------------------------- /opentelemetry/otel-python-backend/server.py: -------------------------------------------------------------------------------- 1 | # Copyright The OpenTelemetry Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import logging 16 | from flask import Flask, request 17 | 18 | from opentelemetry import propagators, trace 19 | from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter 20 | from opentelemetry.instrumentation.flask import FlaskInstrumentor 21 | from opentelemetry.sdk.resources import Resource 22 | from opentelemetry.sdk.trace import TracerProvider 23 | from opentelemetry.sdk.trace.export import SimpleSpanProcessor 24 | 25 | logging.basicConfig(level=logging.DEBUG) 26 | 27 | app = Flask(__name__) 28 | 29 | FlaskInstrumentor().instrument_app(app) 30 | 31 | tracer_provider = TracerProvider(resource=Resource.create({"service.name": "backend"})) 32 | tracer_provider.add_span_processor( 33 | SimpleSpanProcessor(OTLPSpanExporter()) 34 | ) 35 | trace.set_tracer_provider(tracer_provider) 36 | 37 | 38 | @app.route("/backend") 39 | def server_request(): 40 | return "served" 41 | 42 | 43 | if __name__ == "__main__": 44 | app.run(host="0.0.0.0", port=8081) 45 | -------------------------------------------------------------------------------- /stack/README.md: -------------------------------------------------------------------------------- 1 | ## Stack Quickstart 2 | 3 | This folder contains a minimal `docker-compose.yml` for quickly bringing up an Elastic APM stack. 4 | Get started by downloading it and bringing up a few containers: 5 | 6 | ```sh 7 | curl -sLO https://raw.githubusercontent.com/elastic/apm-contrib/main/stack/docker-compose.yml 8 | docker-compose up 9 | ``` 10 | 11 | This will download docker container images for Elasticsearch, Kibana, and APM Server and start each service. 12 | 13 | Follow steps 4 & 5 on http://localhost:5601/app/kibana#/home/tutorial/apm to configure your application to collect and report APM data. 14 | 15 | Visit http://localhost:5601/app/apm to see the results! 16 | 17 | *to stop*: hit ctrl-c to shut down all of the containers started 18 | 19 | ## Updating 20 | 21 | This `docker-compose.yml` was generated from the [apm-integration-testing repository](https://github.com/elastic/apm-integration-testing) with: 22 | 23 | ```sh 24 | ./scripts/compose.py start 7.17.6 --release --no-xpack-secure --docker-compose-path - | sed 's/7.17.6/${STACK_VERSION:-7.17.6}/' 25 | ``` 26 | -------------------------------------------------------------------------------- /stack/docker-compose.yml: -------------------------------------------------------------------------------- 1 | { 2 | "networks": { 3 | "default": { 4 | "name": "apm-integration-testing" 5 | } 6 | }, 7 | "services": { 8 | "apm-server": { 9 | "cap_add": [ 10 | "CHOWN", 11 | "DAC_OVERRIDE", 12 | "SETGID", 13 | "SETUID" 14 | ], 15 | "cap_drop": [ 16 | "ALL" 17 | ], 18 | "command": [ 19 | "apm-server", 20 | "-e", 21 | "--httpprof", 22 | ":6060", 23 | "-E", 24 | "apm-server.rum.enabled=true", 25 | "-E", 26 | "apm-server.rum.event_rate.limit=1000", 27 | "-E", 28 | "apm-server.host=0.0.0.0:8200", 29 | "-E", 30 | "apm-server.read_timeout=1m", 31 | "-E", 32 | "apm-server.shutdown_timeout=2m", 33 | "-E", 34 | "apm-server.write_timeout=1m", 35 | "-E", 36 | "logging.json=true", 37 | "-E", 38 | "logging.metrics.enabled=false", 39 | "-E", 40 | "setup.template.settings.index.number_of_replicas=0", 41 | "-E", 42 | "setup.template.settings.index.number_of_shards=1", 43 | "-E", 44 | "setup.template.settings.index.refresh_interval=1ms", 45 | "-E", 46 | "monitoring.elasticsearch=true", 47 | "-E", 48 | "monitoring.enabled=true", 49 | "-E", 50 | "apm-server.rum.allow_headers=[\"x-custom-header\"]", 51 | "-E", 52 | "apm-server.instrumentation.enabled=true", 53 | "-E", 54 | "apm-server.instrumentation.profiling.cpu.enabled=true", 55 | "-E", 56 | "apm-server.instrumentation.profiling.heap.enabled=true", 57 | "-E", 58 | "apm-server.mode=experimental", 59 | "-E", 60 | "apm-server.kibana.enabled=true", 61 | "-E", 62 | "apm-server.kibana.host=kibana:5601", 63 | "-E", 64 | "apm-server.agent.config.cache.expiration=30s", 65 | "-E", 66 | "apm-server.jaeger.http.enabled=true", 67 | "-E", 68 | "apm-server.jaeger.http.host=0.0.0.0:14268", 69 | "-E", 70 | "apm-server.jaeger.grpc.enabled=true", 71 | "-E", 72 | "apm-server.jaeger.grpc.host=0.0.0.0:14250", 73 | "-E", 74 | "apm-server.sampling.keep_unsampled=true", 75 | "-E", 76 | "output.elasticsearch.hosts=[\"http://elasticsearch:9200\"]", 77 | "-E", 78 | "output.elasticsearch.enabled=true", 79 | "-E", 80 | "output.elasticsearch.pipelines=[{pipeline: 'apm'}]", 81 | "-E", 82 | "apm-server.register.ingest.pipeline.enabled=true" 83 | ], 84 | "container_name": "localtesting_${STACK_VERSION:-7.17.6}_apm-server", 85 | "depends_on": { 86 | "elasticsearch": { 87 | "condition": "service_healthy" 88 | }, 89 | "kibana": { 90 | "condition": "service_healthy" 91 | } 92 | }, 93 | "environment": [ 94 | "BEAT_STRICT_PERMS=false" 95 | ], 96 | "healthcheck": { 97 | "interval": "10s", 98 | "retries": 12, 99 | "test": [ 100 | "CMD", 101 | "curl", 102 | "--write-out", 103 | "'HTTP %{http_code}'", 104 | "-k", 105 | "--fail", 106 | "--silent", 107 | "--output", 108 | "/dev/null", 109 | "http://localhost:8200/" 110 | ], 111 | "timeout": "5s" 112 | }, 113 | "image": "docker.elastic.co/apm/apm-server:${STACK_VERSION:-7.17.6}", 114 | "labels": [ 115 | "co.elastic.apm.stack-version=${STACK_VERSION:-7.17.6}" 116 | ], 117 | "logging": { 118 | "driver": "json-file", 119 | "options": { 120 | "max-file": "5", 121 | "max-size": "2m" 122 | } 123 | }, 124 | "ports": [ 125 | "127.0.0.1:8200:8200", 126 | "127.0.0.1:6060:6060", 127 | "127.0.0.1:14268:14268", 128 | "127.0.0.1:14250:14250" 129 | ] 130 | }, 131 | "elasticsearch": { 132 | "container_name": "localtesting_${STACK_VERSION:-7.17.6}_elasticsearch", 133 | "environment": [ 134 | "bootstrap.memory_lock=true", 135 | "cluster.name=docker-cluster", 136 | "cluster.routing.allocation.disk.threshold_enabled=false", 137 | "discovery.type=single-node", 138 | "path.repo=/usr/share/elasticsearch/data/backups", 139 | "ES_JAVA_OPTS=-XX:UseAVX=2 -Xms1g -Xmx1g", 140 | "path.data=/usr/share/elasticsearch/data/${STACK_VERSION:-7.17.6}", 141 | "xpack.security.enabled=false", 142 | "xpack.license.self_generated.type=trial", 143 | "xpack.monitoring.collection.enabled=true" 144 | ], 145 | "healthcheck": { 146 | "interval": "20s", 147 | "retries": 10, 148 | "test": [ 149 | "CMD-SHELL", 150 | "curl -s -k http://localhost:9200/_cluster/health | grep -vq '\"status\":\"red\"'" 151 | ] 152 | }, 153 | "image": "docker.elastic.co/elasticsearch/elasticsearch:${STACK_VERSION:-7.17.6}", 154 | "labels": [ 155 | "co.elastic.apm.stack-version=${STACK_VERSION:-7.17.6}", 156 | "co.elastic.metrics/module=elasticsearch", 157 | "co.elastic.metrics/metricsets=node,node_stats", 158 | "co.elastic.metrics/hosts=http://$${data.host}:9200" 159 | ], 160 | "logging": { 161 | "driver": "json-file", 162 | "options": { 163 | "max-file": "5", 164 | "max-size": "2m" 165 | } 166 | }, 167 | "ports": [ 168 | "127.0.0.1:9200:9200" 169 | ], 170 | "ulimits": { 171 | "memlock": { 172 | "hard": -1, 173 | "soft": -1 174 | } 175 | }, 176 | "volumes": [ 177 | "esdata:/usr/share/elasticsearch/data" 178 | ] 179 | }, 180 | "kibana": { 181 | "container_name": "localtesting_${STACK_VERSION:-7.17.6}_kibana", 182 | "depends_on": { 183 | "elasticsearch": { 184 | "condition": "service_healthy" 185 | } 186 | }, 187 | "environment": { 188 | "ELASTICSEARCH_HOSTS": "http://elasticsearch:9200", 189 | "SERVER_HOST": "0.0.0.0", 190 | "SERVER_NAME": "kibana.example.org", 191 | "TELEMETRY_ENABLED": "false", 192 | "XPACK_APM_SERVICEMAPENABLED": "true", 193 | "XPACK_ENCRYPTEDSAVEDOBJECTS_ENCRYPTIONKEY": "fhjskloppd678ehkdfdlliverpoolfcr", 194 | "XPACK_FLEET_AGENTS_ELASTICSEARCH_HOST": "http://elasticsearch:9200", 195 | "XPACK_FLEET_AGENTS_KIBANA_HOST": "http://kibana:5601", 196 | "XPACK_MONITORING_ENABLED": "true", 197 | "XPACK_SECURITY_ENCRYPTIONKEY": "fhjskloppd678ehkdfdlliverpoolfcr", 198 | "XPACK_XPACK_MAIN_TELEMETRY_ENABLED": "false" 199 | }, 200 | "healthcheck": { 201 | "interval": "10s", 202 | "retries": 30, 203 | "start_period": "10s", 204 | "test": [ 205 | "CMD", 206 | "curl", 207 | "--write-out", 208 | "'HTTP %{http_code}'", 209 | "-k", 210 | "--fail", 211 | "--silent", 212 | "--output", 213 | "/dev/null", 214 | "http://kibana:5601/api/status" 215 | ], 216 | "timeout": "5s" 217 | }, 218 | "image": "docker.elastic.co/kibana/kibana:${STACK_VERSION:-7.17.6}", 219 | "labels": [ 220 | "co.elastic.apm.stack-version=${STACK_VERSION:-7.17.6}" 221 | ], 222 | "logging": { 223 | "driver": "json-file", 224 | "options": { 225 | "max-file": "5", 226 | "max-size": "2m" 227 | } 228 | }, 229 | "ports": [ 230 | "127.0.0.1:5601:5601" 231 | ] 232 | }, 233 | "wait-service": { 234 | "container_name": "wait", 235 | "depends_on": { 236 | "apm-server": { 237 | "condition": "service_healthy" 238 | }, 239 | "elasticsearch": { 240 | "condition": "service_healthy" 241 | }, 242 | "kibana": { 243 | "condition": "service_healthy" 244 | } 245 | }, 246 | "image": "busybox" 247 | } 248 | }, 249 | "version": "2.4", 250 | "volumes": { 251 | "esdata": { 252 | "driver": "local" 253 | }, 254 | "pgdata": { 255 | "driver": "local" 256 | } 257 | } 258 | } --------------------------------------------------------------------------------