@appland/appmap 3.146.0 → 3.147.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/built/docs/CLA Instructions.pdf +0 -0
  3. package/built/docs/Code of Conduct for Contributors.pdf +0 -0
  4. package/built/docs/analysis/rules-reference.html +27 -0
  5. package/built/docs/appmap-docs.md +27 -0
  6. package/built/docs/community.md +28 -0
  7. package/built/docs/guides/exporting-appmap-diagrams.md +50 -0
  8. package/built/docs/guides/handling-large-appmap-diagrams.md +138 -0
  9. package/built/docs/guides/index.md +21 -0
  10. package/built/docs/guides/navigating-code-objects.md +67 -0
  11. package/built/docs/guides/openapi.md +105 -0
  12. package/built/docs/guides/reading-sql-in-appmap-diagrams.md +69 -0
  13. package/built/docs/guides/refine-appmap-data.md +186 -0
  14. package/built/docs/guides/reverse-engineering.md +377 -0
  15. package/built/docs/guides/runtime-code-review.md +111 -0
  16. package/built/docs/guides/using-appmap-analysis.md +206 -0
  17. package/built/docs/guides/using-appmap-diagrams.md +331 -0
  18. package/built/docs/integrations/atlassian-compass.md +25 -0
  19. package/built/docs/integrations/atlassian-confluence.md +51 -0
  20. package/built/docs/integrations/circle-ci.md +424 -0
  21. package/built/docs/integrations/docker.md +109 -0
  22. package/built/docs/integrations/github-actions.md +524 -0
  23. package/built/docs/integrations/index.md +20 -0
  24. package/built/docs/integrations/plantuml.md +66 -0
  25. package/built/docs/integrations/postman.md +30 -0
  26. package/built/docs/integrations/readme.md +39 -0
  27. package/built/docs/integrations/smartbear-swaggerhub.md +119 -0
  28. package/built/docs/reference/analysis-labels.md +49 -0
  29. package/built/docs/reference/analysis-rules.md +61 -0
  30. package/built/docs/reference/appmap-client-cli.md +628 -0
  31. package/built/docs/reference/appmap-gradle-plugin.md +141 -0
  32. package/built/docs/reference/appmap-java.md +311 -0
  33. package/built/docs/reference/appmap-maven-plugin.md +164 -0
  34. package/built/docs/reference/appmap-node.md +185 -0
  35. package/built/docs/reference/appmap-python.md +520 -0
  36. package/built/docs/reference/appmap-ruby.md +514 -0
  37. package/built/docs/reference/github-action.md +171 -0
  38. package/built/docs/reference/index.md +25 -0
  39. package/built/docs/reference/jetbrains.md +136 -0
  40. package/built/docs/reference/license-key-install.md +74 -0
  41. package/built/docs/reference/navie.md +261 -0
  42. package/built/docs/reference/remote-recording-api.md +97 -0
  43. package/built/docs/reference/uninstalling-appmap.md +119 -0
  44. package/built/docs/reference/vscode.md +122 -0
  45. package/built/docs/setup-appmap-in-ci/example-projects.md +21 -0
  46. package/built/docs/setup-appmap-in-ci/how-it-works.md +43 -0
  47. package/built/docs/setup-appmap-in-ci/in-circleci.md +423 -0
  48. package/built/docs/setup-appmap-in-ci/in-github-actions.md +177 -0
  49. package/built/docs/setup-appmap-in-ci/index.md +22 -0
  50. package/built/docs/setup-appmap-in-ci/matrix-builds.md +225 -0
  51. package/built/docs/setup-appmap-in-ci/troubleshooting.md +71 -0
  52. package/built/docs/setup-appmap-in-your-code-editor/add-appmap-to-your-code-editor.md +93 -0
  53. package/built/docs/setup-appmap-in-your-code-editor/appmap-analysis.md +77 -0
  54. package/built/docs/setup-appmap-in-your-code-editor/generate-appmap-data-from-tests.md +93 -0
  55. package/built/docs/setup-appmap-in-your-code-editor/generate-appmap-data-with-remote-recording.md +112 -0
  56. package/built/docs/setup-appmap-in-your-code-editor/generate-appmap-data-with-request-recording.md +77 -0
  57. package/built/docs/setup-appmap-in-your-code-editor/how-appmap-works.md +166 -0
  58. package/built/docs/setup-appmap-in-your-code-editor/index.md +25 -0
  59. package/built/docs/setup-appmap-in-your-code-editor/navigating-appmap-diagrams.md +59 -0
  60. package/built/docs/setup-appmap-in-your-code-editor/navigating-code-objects.md +67 -0
  61. package/built/docs/unused_for_now_index.html +11 -0
  62. package/package.json +2 -2
@@ -0,0 +1,111 @@
1
+ ---
2
+ layout: docs
3
+ title: Docs - Guides
4
+ description: "AppMap analyzes runtime changes in your codebase for failed tests, API, security, performance issues, and anti-patterns, providing detailed reports."
5
+ guides: true
6
+ name: Understanding the Runtime Code Review Report
7
+ step: 10
8
+ ---
9
+
10
+ # Understanding the Runtime Code Review Report <!-- omit in toc -->
11
+
12
+ AppMap Analysis works with your Continuous Integration (CI) system to collect, store, analyze, and report on the behavioral changes within each Pull Request. AppMap analyzes the changes in your application on each pushed commit or pull request. AppMap performs a thorough analysis of the runtime differences, giving you:
13
+
14
+ - Root cause analysis of failed tests.
15
+ - Web service API changes - breaking and non-breaking - via comparison of generated OpenAPI definitions.
16
+ - New and resolved security vulnerabilities.
17
+ - New and resolved performance issues.
18
+ - New and resolved flaws in other categories - maintainability, reliability, and user-defined rules.
19
+ - Code Behavior diffs represented as sequence diagrams showing changed runtime behavior within the PR.
20
+
21
+ <img class="video-screenshot" src="/assets/img/docs/guides/runtime-code-review.webp"/>
22
+
23
+ - [The AppMap Change Report](#the-appmap-change-report)
24
+ - [Summary and Status](#summary-and-status)
25
+ - [Failed Tests](#failed-tests)
26
+ - [API Changes](#api-changes)
27
+ - [Security Flaws](#security-flaws)
28
+ - [Performance Problems](#performance-problems)
29
+ - [Code Anti-Patterns](#code-anti-patterns)
30
+ - [New AppMap Diagrams](#new-appmap-diagrams)
31
+
32
+ ## The AppMap Change Report
33
+
34
+ Once a Pull Request is opened, reopened, or changed, an AppMap Analysis command will run to build a comparison report between the head revision and the most recent base revision for which an AppMap archive is available. This ensures AppMap is only analyzing the code which changed in the pull request. This report compares structural differences observed at runtime between the feature and the origin point of that feature branch. The same action can also add comments and annotations to the source code changes involved in the Pull Request. The report data is also available as a JSON file.
35
+
36
+ Key insights include:
37
+
38
+ - How the new code will impact the system.
39
+ - Any major architectural changes introduced.
40
+ - Changes to the code interactions from API to Database
41
+
42
+ Here is an example of a report from AppMap in CI:
43
+
44
+ <img class="video-screenshot" src="/assets/img/docs/gh-action/analysis-github-action.webp"/>
45
+
46
+ This report shows the runtime analysis done by AppMap, which records code execution behavior *before* those changes are approved for deployment to production.
47
+
48
+ <img class="video-screenshot" src="/assets/img/docs/appmap_CI_report_top.webp"/>
49
+
50
+ ## Summary and Status
51
+
52
+ The summary gives you an overview of the following code-related flaws, problems, and anti-patterns.
53
+
54
+ - [The AppMap Change Report](#the-appmap-change-report)
55
+ - [Summary and Status](#summary-and-status)
56
+ - [Failed Tests](#failed-tests)
57
+ - [API Changes](#api-changes)
58
+ - [Security Flaws](#security-flaws)
59
+ - [Performance Problems](#performance-problems)
60
+ - [Code Anti-Patterns](#code-anti-patterns)
61
+ - [New AppMap Diagrams](#new-appmap-diagrams)
62
+
63
+
64
+ ### Failed Tests
65
+
66
+ AppMap will report on any tests that failed as part of your test suite. For each test that failed to complete successfully, AppMap will analyze the failed test, showing the full details of the error and the specific part of the test that failed.
67
+
68
+ <img class="video-screenshot" src="/assets/img/docs/appmap_CI_report_failed_tests.webp"/>
69
+
70
+ ### API Changes
71
+
72
+ AppMap will report on any changes seen with your API routes at runtime. AppMap will identify changes to routes themselves, notifying you when a new route appears or an existing route is deleted. Additionally, it will identify changes to the response body, content, descriptions, and other attributes.
73
+
74
+ <img class="video-screenshot" src="/assets/img/docs/appmap_CI_report_api_changes.webp"/>
75
+
76
+ ### Security Flaws
77
+
78
+ AppMap analyzes your application's behavior to identify new security flaws in how the new code changes execute. AppMap can identify issues such as:
79
+
80
+ - [Deprecated cryptography algorithm](/docs/reference/analysis-rules.html#deprecated-crypto-algorithm)
81
+ - [Logout without Session Reset](/docs/reference/analysis-rules.html#logout-without-session-reset)
82
+ - [Deserialization of untrusted data](/docs/reference/analysis-rules.html#deserialization-of-untrusted-data)
83
+ - and others.
84
+
85
+ For a full list of all the flaws and issues which AppMap can detect, refer to the [Analysis Rules](/docs/reference/analysis-rules) reference section.
86
+
87
+ ### Performance Problems
88
+
89
+ AppMap analyzes software behavior changes in your code base to identify performance problems before you merge your code changes. AppMap identifies a variety of software performance problems such as:
90
+
91
+ - [N Plus One SQL Query](/docs/reference/analysis-rules.html#n-plus-one-query)
92
+ - [Slow Function Calls](/docs/reference/analysis-rules.html#slow-function-call)
93
+ - [Slow HTTP Server Requests](/docs/reference/analysis-rules.html#slow-http-server-request)
94
+ - and others.
95
+
96
+ For a full list of all the flaws and issues which AppMap can detect, refer to the [Analysis Rules](/docs/reference/analysis-rules) reference section.
97
+
98
+ ### Code Anti-Patterns
99
+
100
+ AppMap can identify any major or potential structural flaws in the architecture, or logical flow that could be introduced due to merging the feature into your application. Some examples of these code anti-patterns that AppMap can identify are:
101
+
102
+ - [Circular Dependencies](/docs/reference/analysis-rules.html#circular-dependency)
103
+ - [Too Many SQL or RPC Updates](/docs/reference/analysis-rules.html#too-many-updates)
104
+ - [SQL Queries from View Layer](/docs/reference/analysis-rules.html#query-from-view)
105
+ - and others.
106
+
107
+ For a full list of all the flaws and issues which AppMap can detect, refer to the [Analysis Rules](/docs/reference/analysis-rules) reference section.
108
+
109
+ ### New AppMap Diagrams
110
+
111
+ New test cases added to a pull request will lead to new AppMap Diagrams being created, with one AppMap created for each new test. AppMap will list all of the new diagrams (and therefore, each new test) created in each pull request.
@@ -0,0 +1,206 @@
1
+ ---
2
+ layout: docs
3
+ title: Docs - Guides
4
+ description: "Configure AppMap Analysis by customizing checks for flexible rule options. Understand findings and their properties for effective analysis."
5
+ guides: true
6
+ name: Using AppMap Analysis
7
+ step: 8
8
+ redirect_from: [/docs/analysis/configuring-checks, /docs/analysis/match-pattern-config, /docs/analysis/findings,/docs/reference/configuring-analysis,/docs/guides/configuring-analysis, /docs/analysis]
9
+ ---
10
+
11
+ # AppMap Analysis
12
+
13
+ When there is AppMap Data available in your project, AppMap Runtime Analysis will immediately scan them to detect flaws in the code. These flaws are surfaced as **findings** and are displayed in your code editor as you work so that they can be addressed **before** they are propagated to test or production environments.
14
+
15
+ - [Navigate Findings](#navigate-findings)
16
+ - [Investigate findings](#investigate-findings)
17
+ - [Use labels to visually explore your code](#use-labels-to-visually-explore-your-code)
18
+ - [Configuring Analysis](#configuring-analysis)
19
+ - [Configuring checks](#configuring-checks)
20
+ - [Example appmap-scanner.yml](#example-appmap-scanneryml)
21
+ - [Match pattern config](#match-pattern-config)
22
+ - [Examples](#examples)
23
+ - [Findings Reference](#findings-reference)
24
+ - [Properties](#properties)
25
+ - [Finding hash](#finding-hash)
26
+
27
+ ## Navigate Findings
28
+
29
+ Findings are displayed In the Runtime Analysis sidebar pane sorted by impact category and type.
30
+
31
+ <image class="video-screenshot" src="/assets/img/docs/runtime-analysis-sidebar-findings.webp"/>
32
+
33
+ Clicking the ‘Overview’ link in the Runtime Analysis sidebar will open the ‘Runtime Analysis Summary’ window which contains a summary of findings for a particular project.
34
+
35
+ <image class="video-screenshot" src="/assets/img/docs/runtime-analysis-overview-dashboard.webp"/>
36
+
37
+ {% include vimeo.html id='916087872' %}
38
+
39
+ ---
40
+
41
+ **In this video**
42
+ AppMap Analysis scans your AppMap Data to find software design flaws that impact performance, stability, security and maintainability. This runtime code analysis can find the problems that static code analyzers miss - and that cause 90% of today’s most serious production issues.
43
+
44
+ **Links mentioned**
45
+ [AppMap Community Slack](/slack)
46
+ [Get AppMap for VSCode](https://marketplace.visualstudio.com/items?itemName=appland.appmap)
47
+ [Get AppMap for JetBrains](https://plugins.jetbrains.com/plugin/16701-appmap)
48
+
49
+ ---
50
+
51
+ ## Investigate findings
52
+
53
+ Let's look at a sample Ruby on rails application, where AppMap has already been installed and AppMap Data has been generated. From the test cases, you'll see a new option for findings in the left-hand column or an option here for investigate findings.
54
+
55
+ <img class="video-screenshot" src="/assets/img/appmap-analysis-1.webp"/>
56
+
57
+ You can see one of the issues we've found is that a log event contained secret data by clicking on the finding will be taken directly to the line of code where this event occurs by hovering over the pin.
58
+ <img class="video-screenshot" src="/assets/img/appmap-analysis-2.webp"/>
59
+
60
+ ## Use labels to visually explore your code
61
+
62
+ You can open the AppMap and see exactly where the function wrote this secret to a log file. How does AppMap know that this was a secret? Unlike static analyzers and other tools that do pattern matching AppMap knows this function generates secrets because we have built in knowledge of common software libraries with pre-populated labels.
63
+
64
+ We know exactly where to look to avoid false positives. Developers can extend their labels, whether it's a common library or not with simple code comments on their functions.
65
+ <img class="video-screenshot" src="/assets/img/appmap-analysis-3.webp"/>
66
+
67
+ If you search for the secret label, you'll see the location in the code where this event occurs by clicking on the function, you'll be taken to the exact location of the AppMap, where the secret was generated. Additionally, you can open the code, combining a visual model alongside the code.
68
+ <img class="video-screenshot" src="/assets/img/appmap-analysis-4.webp"/>
69
+
70
+ ## Configuring Analysis Checks
71
+
72
+ AppMap Analysis is configured in a YAML document. It's primary job is to specify which scanner rules will check the code.
73
+ Each check specifies a rule id, and may include additional properties that customized and tune the behavior of the rule.
74
+
75
+ AppMap Analysis ships with a default configuration file located in `node_modules/@appland/scanner/built/sampleConfig/default.yml`.
76
+
77
+ Without specifying the `--config` command line option, AppMap will attempt to load `appmap-scanner.yml`, the default configuration for analysis rules. If that file does not exist, AppMap will fail back to loading the configuration in the `node_modules` path.
78
+
79
+ To use a non-default configuration, specify the path to the configuration file via the `-c` or `--config` option:
80
+
81
+ ```sh
82
+ $ npx @appland/scanner \
83
+ --appmap-dir tmp/appmap \
84
+ --config appmap-scanner.yml \
85
+ ci
86
+ ```
87
+ {: .example-code}
88
+
89
+ To use a custom configuration create a file named `appmap-scanner.yml` in the root of your project directory, you can copy the [default.yml](https://github.com/getappmap/appmap-js/blob/main/packages/scanner/src/sampleConfig/default.yml) in the AppMap source code as a starting point. Refer to the [Rules Reference](/docs/reference/analysis-rules) for additional configuration options per scanner rule.
90
+
91
+ ### Example appmap-scanner.yml
92
+
93
+ ```
94
+ checks:
95
+ - rule: authzBeforeAuthn
96
+ - rule: http500
97
+ - rule: illegalPackageDependency
98
+ properties:
99
+ callerPackages:
100
+ - equal: actionpack
101
+ calleePackage:
102
+ equal: app/controllers
103
+ - rule: insecureCompare
104
+ - rule: missingAuthentication
105
+ - rule: missingContentType
106
+ - rule: nPlusOneQuery
107
+ - rule: secretInLog
108
+ - rule: slowFunctionCall
109
+ properties:
110
+ timeAllowed: 0.2
111
+ functions:
112
+ - match: Controller#create$
113
+ - rule: slowHttpServerRequest
114
+ properties:
115
+ timeAllowed: 0.5
116
+ - rule: slowQuery
117
+ properties:
118
+ timeAllowed: 0.05
119
+ - rule: tooManyJoins
120
+ - rule: tooManyUpdates
121
+ - rule: unbatchedMaterializedQuery
122
+ - rule: updateInGetRequest
123
+ ```
124
+
125
+ ## Match pattern config
126
+
127
+ Some rule options are defined as type `MatchPatternConfig`. `MatchPatternConfig` is a flexible way to
128
+ match a string such as content type, code object name, etc.
129
+
130
+ Each `MatchPatternConfig` requires one of the following three YAML keys:
131
+
132
+ ```yaml
133
+ - match: RegExp # String value must match this regexp
134
+ - include: string # String value must include this substring
135
+ - equal: string # String value must equal this string
136
+ ```
137
+ {: .example-code}
138
+
139
+ Optionally:
140
+
141
+ ```yaml
142
+ - ignoreCase: boolean # When true, the match/include/equal test is case-insensitive
143
+ ```
144
+ {: .example-code}
145
+
146
+ ### Examples
147
+
148
+ The `illegalPackageDependency` rule is applied to the package `app/controllers` (exactly). The caller package must
149
+ be `actionpack` (exactly).
150
+
151
+ ```
152
+ - rule: illegalPackageDependency
153
+ properties:
154
+ callerPackages:
155
+ - equal: actionpack
156
+ calleePackage:
157
+ equal: app/controllers
158
+ ```
159
+
160
+ The `slowFunctionCall` rule is applied to all functions that match one of two regular expressions (case sensitive).
161
+
162
+ ```
163
+ - rule: slowFunctionCall
164
+ properties:
165
+ functions:
166
+ - match: ^app/models
167
+ - match: ^app/jobs
168
+ ```
169
+
170
+ The `missingAuthentication` rule is *not applied* to any event whose `route` includes `/api/`.
171
+
172
+ ```
173
+ - rule: missingAuthentication
174
+ exclude:
175
+ - event:
176
+ property: route
177
+ test:
178
+ include: /api/
179
+ ```
180
+
181
+ ## Findings Reference
182
+
183
+ When a scanner check matches an AppMap, it issues a _finding_. A finding includes detailed information about the match, indicating such information as:
184
+
185
+ * A title and message.
186
+ * AppMap in which the finding was found.
187
+ * The primary and secondary events that are relevant to the finding.
188
+
189
+ ### Properties
190
+
191
+ * `ruleId` identifier of the [rule](/docs/reference/analysis-rules) algorithm.
192
+ * `checkId` identifier of the `check`, which a configured instance of a `rule`.
193
+ * `ruleTitle` human-friendly title of the rule.
194
+ * `message` human-friendly message describing the finding.
195
+ * `appMapFile` relative path to the [AppMap](https://github.com/getappmap/appmap#appmap-data-specification) file containing the match.
196
+ * `event` JSON object of the primary [event](https://github.com/getappmap/appmap#events) on which the match was found.
197
+ * `relatedEvents` JSON of other events in the AppMap which are associated with the finding. They can be inspected in the AppMap to better understand the finding.
198
+ * `scope` JSON of the event which defines the AppMap subtree in which the finding was discovered.
199
+ * [`hash`](#finding-hash) of the finding which can be used to identify duplicate findings.
200
+
201
+ ### Finding hash
202
+
203
+ A `hash` of the finding is computed from the finding properties that are most important and characteristic. The hash is used implement a critical feature of AppMap Analysis - de-duplication. De-duplication serves two purposes:
204
+
205
+ 1) A finding may occur many times within a set of AppMap Diagrams. As a user, you're only interested in unique findings, therefore the hash can be used to de-duplicate the findings and present a minimal data set.
206
+ 2) Findings can be managed and triaged in the [AppMap Server](https://app.land) UI. For example, a finding can be deferred to prevent that finding from holding up a build or pull request. If the finding occurs again in the future, the hash is used to recognize that the finding has already been found, triaged - therefore the finding is not reported as new, and does not block the build or need to be re-triaged.
@@ -0,0 +1,331 @@
1
+ ---
2
+ layout: docs
3
+ title: Docs - Guides
4
+ description: "Configure AppMap Analysis by customizing checks for flexible rule options. Understand findings and their properties for effective analysis."
5
+ guides: true
6
+ toc: true
7
+ name: Using AppMap Diagrams
8
+ step: 2
9
+ redirect_from: [/docs/how-to-use-appmap-diagrams.html, /docs/how-to-use-appmap-diagrams, /docs/diagrams/how-to-use-appmaps, /docs/diagrams/sequence-diagrams, /docs/diagrams, /docs/diagrams/how-it-works, /docs/diagrams/dependency-map, /docs/diagrams/trace-view, /docs/diagrams/sequence-diagram, /docs/diagrams/flamegraph, /docs/setup-appmap-in-your-code-editor/navigating-appmap-diagrams]
10
+ ---
11
+
12
+ # Using AppMap Diagrams <!-- omit in toc -->
13
+
14
+ AppMap records code execution traces, collecting information about how your code works and what it does. Then it presents this information as interactive diagrams that you can search and navigate. In the diagrams, you can see exactly how functions, web services, data stores, security, I/O, and dependent services all work together when application code runs.
15
+
16
+ You use AppMap right in your code editor, using the AppMap extension for your code editor. AppMap Diagrams also link directly to code, so you can use the information in the diagrams to make immediate code changes and improvements.
17
+
18
+ - [How it Works](#how-it-works)
19
+ - [Dependency Map](#dependency-map)
20
+ - [Trace View](#trace-view)
21
+ - [Sequence Diagram](#sequence-diagram)
22
+ - [Flame Graph](#flame-graph)
23
+
24
+ ## How it Works <!-- omit in toc -->
25
+
26
+ AppMap records the behavior of running code into JSON files, and visualizes them in interactive diagrams right in your code editor.
27
+
28
+ {% include docs/how_it_works_illo.html %}
29
+
30
+ #### AppMap agent records executing code as JSON files
31
+
32
+ Once your app is instrumented, the AppMap agent creates JSON files as you execute test cases, run sample programs, or perform interactive sessions with your app.
33
+
34
+ AppMap Data can be most conveniently recorded from automated tests, but other methods of recording are preferred in certain situations, such as direct recording of code blocks or remote recording controlled with REST endpoints. [Learn more about Recording AppMap Data](/docs/recording-methods).
35
+
36
+ #### Quick search for HTTP routes, packages, classes, and functions in the left-hand navigation bar
37
+
38
+ Use the navigation bar for quick navigation to items of interest, for example, HTTP routes, labels, packages, classes, functions.
39
+
40
+ <div class="video-container">
41
+ <video playsinline loop autoplay muted>
42
+ <source src="/assets/img/docs/navigate-to-interest.mp4" type="video/mp4">
43
+ </video>
44
+ </div>
45
+
46
+ #### Use the filtering icon to reduce the number of objects in the AppMap view
47
+
48
+ Filter out items such as unlabeled code, specific classes or packages, external code, and more.
49
+
50
+ <div class="video-container">
51
+ <video playsinline loop autoplay muted>
52
+ <source src="/assets/img/docs/filter-appmaps.mp4" type="video/mp4">
53
+ </video>
54
+ </div>
55
+
56
+ #### Show more detailed statistics about your AppMap
57
+
58
+ Includes the frequency of specific function calls and the size represented within the AppMap. This is helpful when [handling large AppMap Diagrams](/docs/guides/handling-large-appmap-diagrams) and to reduce their size.
59
+
60
+ <img src="/assets/img/docs/appmap-stats.webp"/>
61
+
62
+ #### Expand and Collapse the Depth of Sequence Diagrams
63
+
64
+ This will hide or show all actions that are deeper in the call stack than the selected value, and will result in a more compact diagram. Actions can be expanded or collapsed with the `+` or `-` controls to change the depth of the calls shown within your sequence diagram.
65
+
66
+ <div class="video-container">
67
+ <video playsinline loop autoplay muted>
68
+ <source src="/assets/img/docs/sequence-diagram-expand.mp4" type="video/mp4">
69
+ </video>
70
+ </div>
71
+
72
+ #### Demo of using AppMap Diagrams
73
+ This video demonstrates how to use AppMap Diagrams when learning how unfamiliar code works:
74
+
75
+ <div style="position: relative; padding-bottom: 56.25%; height: 0;"><iframe src="https://www.loom.com/embed/de75ba638d57418da2d42417936cdf95" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe></div>
76
+
77
+ ## Dependency Map
78
+
79
+ The Dependency Map diagram shows all the code that's relevant to what you're working on and how it's connected. Here you can search and navigate through web services, code, libraries, dependency services, and SQL, all in the context of a specific feature.
80
+
81
+ The dependency map is fully interactive. You can:
82
+ - [Expand and collapse packages and Web Service endpoints](#expand-and-collapse-packages-and-web-service-endpoints)
83
+ - [View detailed information about dependencies and classes](#view-detailed-information-about-dependencies-and-classes)
84
+ - [List the functions of a class that are used by the executed code](#list-the-functions-of-a-class-that-are-used-by-the-executed-code)
85
+ - [Explore callers and callees](#explore-callers-and-callees)
86
+ - [View SQL queries in dependency map](#view-sql-queries-in-dependency-map)
87
+ - [Open source code right to the line of any particular function.](#open-source-code-right-to-the-line-of-any-particular-function)
88
+
89
+ ![Dependency map overview](/assets/img/docs/dependency-map-overview.webp "Dependency map overview")
90
+
91
+ #### Expand and collapse packages and Web Service endpoints:
92
+ <div class="video-container">
93
+ <video playsinline loop autoplay muted>
94
+ <source src="/assets/img/docs/expand-and-collapse-packages.mp4" type="video/mp4">
95
+ </video>
96
+ </div>
97
+
98
+ #### View detailed information about dependencies and classes:
99
+ <div class="video-container">
100
+ <video playsinline loop autoplay muted>
101
+ <source src="/assets/img/docs/view-detailed-information-about-dependencies.mp4" type="video/mp4">
102
+ </video>
103
+ </div>
104
+
105
+ #### List the functions of a class that are used by the executed code:
106
+ <div class="video-container">
107
+ <video playsinline loop autoplay muted>
108
+ <source src="/assets/img/docs/list-the-functions-of-a-class.mp4" type="video/mp4">
109
+ </video>
110
+ </div>
111
+
112
+
113
+ #### Explore callers and callees:
114
+ <div class="video-container">
115
+ <video playsinline loop autoplay muted>
116
+ <source src="/assets/img/docs/dependency-explore-callers-and-callees.mp4" type="video/mp4">
117
+ </video>
118
+ </div>
119
+
120
+ #### View SQL queries in dependency map:
121
+ <div class="video-container">
122
+ <video playsinline loop autoplay muted>
123
+ <source src="/assets/img/docs/view-sql-queries-in-dependency-map.mp4" type="video/mp4">
124
+ </video>
125
+ </div>
126
+
127
+ #### Open source code right to the line of any particular function:
128
+ <div class="video-container">
129
+ <video playsinline loop autoplay muted>
130
+ <source src="/assets/img/docs/open-source-from-dependency-map.mp4" type="video/mp4">
131
+ </video>
132
+ </div>
133
+
134
+ ## Trace View
135
+
136
+ The Trace view diagram shows all the details of how a feature works. Here you can navigate forward, backward, up, and down through a detailed execution trace. See the call tree starting with web service endpoints going through function calls all the way to SQL operations. At any point, you can move quickly back and forth between the Trace view and your source code.
137
+
138
+ The Trace view is fully interactive. You can:
139
+ - [Expand and collapse execution paths](#expand-and-collapse-execution-paths)
140
+ - [Explore callers and callees](#explore-callers-and-callees)
141
+ - [View variable names and values at any point in the code flow](#view-variable-names-and-values-at-any-point-in-the-code-flow)
142
+ - [View SQL queries](#view-sql-queries)
143
+ - [Open source code right to the line of any particular function](#open-source-code-right-to-the-line-of-any-particular-function)
144
+
145
+ ![Trace view is fully interactive](/assets/img/docs/trace-is-fully-interactive.webp "Trace view is fully interactive")
146
+
147
+ #### Expand and collapse execution paths
148
+ <div class="video-container">
149
+ <video playsinline loop autoplay muted>
150
+ <source src="/assets/img/docs/expand-and-collapse-execution-paths.mp4" type="video/mp4">
151
+ </video>
152
+ </div>
153
+
154
+ #### Explore callers and callees
155
+ <div class="video-container">
156
+ <video playsinline loop autoplay muted>
157
+ <source src="/assets/img/docs/trace-explore-callers-and-callees.mp4" type="video/mp4">
158
+ </video>
159
+ </div>
160
+
161
+ #### View variable names and values at any point in the code flow
162
+ <div class="video-container">
163
+ <video playsinline loop autoplay muted>
164
+ <source src="/assets/img/docs/view-variable-names-and-values.mp4" type="video/mp4">
165
+ </video>
166
+ </div>
167
+
168
+ #### View SQL queries
169
+ <div class="video-container">
170
+ <video playsinline loop autoplay muted>
171
+ <source src="/assets/img/docs/view-sql-queries.mp4" type="video/mp4">
172
+ </video>
173
+ </div>
174
+
175
+ #### Open source code right to the line of any particular function
176
+ <div class="video-container">
177
+ <video playsinline loop autoplay muted>
178
+ <source src="/assets/img/docs/open-source-code-right-to-the-line.mp4" type="video/mp4">
179
+ </video>
180
+ </div>
181
+
182
+ ## Sequence Diagram
183
+
184
+ > “A sequence diagram shows [process](https://en.wikipedia.org/wiki/Process_(computing)) interactions arranged in time sequence in the field of [software engineering](https://en.wikipedia.org/wiki/Software_engineering). It depicts the processes involved and the sequence of messages exchanged between the processes needed to carry out the functionality.“[^1]
185
+
186
+ The Sequence Diagram view shows an application's behavior in a linear chronological layout. Function calls are shown as horizontal arrows, ordered from top to bottom as they occurred at runtime. The elements in the sequence diagram are interactive and can be selected, collapsed, and hidden.
187
+
188
+ Sequence diagrams can also be exported as SVG files for easy sharing and collaboration. Similar AppMap Diagrams can also be compared in a sequence diagram "diff" to reveal changes in runtime behavior caused by a code update.
189
+
190
+ However, like all forms of documentation, a sequence diagram is only useful when it is current and accurate. AppMap gives you the ability to instantly generate sequence diagrams of any recorded program. A generated sequence diagram is accurate and easy to produce, and it can be re-created on demand. The sequence diagram format is described in the [UML standard](https://www.omg.org/spec/UML/).
191
+
192
+ You can use AppMap to view and interact with sequence diagrams of your application right in your code editor. AppMap can also generate sequence diagrams comparisons to make it easy to see the differences in runtime behavior caused by a coding change.
193
+
194
+ Sequence diagrams can be also exported as SVG images, or in popular text formats like PlantUML so that you can edit and share the diagrams however you prefer. AppMap sequence diagrams can also be generated on the command line, making it simple to use within a CI build to generate up-to-date sequence diagrams every time a change is made on your primary development branches.
195
+
196
+ ### Viewing sequence diagrams in the code editor
197
+
198
+ The AppMap extensions for Visual Studio Code and JetBrains include support for viewing AppMap Data as sequence diagrams. Simply open any AppMap and click on the `Sequence Diagram` tab to view it in the main editor window.
199
+
200
+ ![Open sequence diagram](/assets/img/docs/find-sequence-diagram.webp "Open sequence diagram")
201
+
202
+ Sequence Diagrams follow these conventions:
203
+ 1. Inbound HTTP server requests (if any) will be on the left hand side
204
+ 2. Database queries and RPC requests (e.g. HTTP client requests) (if any) will be on the right hand side.
205
+ 3. Each code package is represented as a sequence diagram “lifeline”. Each lifeline is a vertical lane which you can follow down the page.
206
+ 4. Each function call is represented as a line from one lifeline to another.
207
+ 5. The function return value (if any) will be depicted in the opposite direction.
208
+ 6. If an AppMap contains HTTP server requests, other “root” events which are not HTTP server requests will be filtered out, by default.
209
+
210
+ Scrolling down within a sequence diagram in the editor retains the lifeline labels at the top, making it easy to keep track of which vertical line belongs to which entity. You can select function calls to see their details, or to see the same event in Trace View for even more detail.
211
+
212
+ ### Removing lifelines from view
213
+
214
+ By default, AppMap Sequence Diagrams will contain "lifelines" for each of the actors in your application. If you would prefer not to see any of those, just click on the "X" within the lifeline label to remove it. This can be useful when hiding less important calls such as those to made a central logging package.
215
+
216
+ ![Hide lifeline in sequence diagram](/assets/img/docs/hide-lifeline-sequence-diagram.webp "Hide lifeline in sequence diagram")
217
+
218
+ Lifelines that have been hidden can be re-shown using the "Filters" control, or by resetting the map using the "Clear" control.
219
+
220
+ ![Show lifeline in sequence diagram](/assets/img/docs/show-lifeline-sequence-diagram.webp "Show lifeline in sequence diagram")
221
+
222
+ ### Collapsing sections of a Sequence Diagram
223
+
224
+ Function calls that contain other events can be collapsed to make the diagram easier to read. This is done using the `[-]` control.
225
+
226
+ ![Collapse sequence diagram](/assets/img/docs/collapse-sequence-diagram.gif "Collapse sequence diagram")
227
+
228
+ Clicking on the `[+]` control will expand the same sequence set once again.
229
+
230
+ ### Exporting sequence diagrams as SVG files
231
+
232
+ Sequence diagrams can be exported from the code editor as SVG image files. Any lifelines that are hidden from view will also not appear in the exported image.
233
+
234
+ To export a sequence diagram, click on `EXPORT` and the SVG data will appear in a new file in your project. Save that file to a desired location and then open it with a web browser or other suitable tool to view it.
235
+
236
+ ![Export sequence diagram](/assets/img/docs/export-sequence-diagram.webp "Export sequence diagram")
237
+ ![Save sequence diagram](/assets/img/docs/save-sequence-diagram.webp "Save sequence diagram")
238
+
239
+ ### 3rd Party Integrations
240
+
241
+ Refer to the AppMap [integration documentation](/docs/integrations/plantuml) to learn more about how to integrate Sequence Diagrams with PlantUML and other 3rd party tools.
242
+
243
+
244
+ ### Notes
245
+
246
+ [^1]:
247
+ [https://en.wikipedia.org/wiki/Sequence_diagram](https://en.wikipedia.org/wiki/Sequence_diagram)
248
+
249
+ ## Flame Graph
250
+
251
+ - [How to read a Flame Graph](#how-to-read-a-flame-graph)
252
+ - [Drilling Down](#drilling-down)
253
+ - [Switching to Other Views](#switching-to-other-views)
254
+ - [Identifying Performance Issues](#identifying-performance-issues)
255
+ - [Expensive functions and queries](#expensive-functions-and-queries)
256
+ - [N+1 Queries](#n1-queries)
257
+ - [Delays from external service calls](#delays-from-external-service-calls)
258
+
259
+ Flame Graphs visualize the performance of your application’s code. A Flame Graph shows the time spent in each part of your application’s call stack, where the width of the event is proportional to how long it takes to execute.
260
+
261
+ Flame Graphs make it easy to see how much time is spent in each function, and which calls are the most expensive.
262
+
263
+ ![flame graph image](/assets/img/docs/flamegraph-5.webp)
264
+
265
+ ### How to read a Flame Graph
266
+
267
+ The lowest layer in a Flame Graph represents the AppMap Data recording, and it contains the recordings’s name. For an AppMap Flame Graph created from tests, this will usually be the same name as the test from which it was generated. In the example below, the AppMap was recorded from a test related to an application’s account activation capability.
268
+
269
+ ![flame graph image](/assets/img/docs/flamegraph-8.webp)
270
+
271
+ Events in a Flame Graph are ordered bottom-up for functions calling other functions, and left-to-right for subsequent calls. To illustrate, the events in the map below are numbered according to the sequence in which they occurred.
272
+
273
+ ![flame graph image](/assets/img/docs/flamegraph-9.png)
274
+
275
+ Cells in the flame graph are colored similarly to how they appear in the other AppMap views like the Dependency Map and Sequence Diagram. Blue represents classes, purple represents database queries, and yellow represents outgoing calls to other services. The lowest level of the Flame Graph, the map name, is colored teal.
276
+
277
+ Each event cell also shows the elapsed time spent executing it. This may be displayed in ms (milliseconds) or µ (microseconds).
278
+
279
+ ![flame graph image](/assets/img/docs/flamegraph-4.png)
280
+
281
+ Timing data and event names may not always fit on small cells. These can be revealed by hovering your mouse pointer over the cell.
282
+
283
+ ### Drilling Down
284
+
285
+ It can be useful to zoom into particular parts of the call stack to examine the performance of certain functions more closely. Clicking on any event will expand it to the full width, allowing you to more clearly see the functions which it called.
286
+
287
+ <div class="video-container">
288
+ <video playsinline loop autoplay muted>
289
+ <source src="/assets/img/docs/flamegraph-6.mp4" type="video/mp4">
290
+ </video>
291
+ </div>
292
+
293
+ You can also drill deeper into the Flame Graph using the zoom control on the right by clicking on the `+` and `-` controls, or by dragging the zoom bar. You can also zoom using your mouse wheel, and the graph will zoom towards the position of your mouse pointer.
294
+
295
+ <div class="video-container">
296
+ <video playsinline loop autoplay muted>
297
+ <source src="/assets/img/docs/flamegraph-2.mp4" type="video/mp4">
298
+ </video>
299
+ </div>
300
+
301
+ AppMap filter settings also apply to Flame Graphs. For example, if you decide to hide calls to certain types of events (for example, by excluding calls to a logging package) those events will not appear in the Flame Graph.
302
+
303
+ ### Switching to Other Views
304
+
305
+ While investigating an event in an application, you can also view the same event in the Sequence Diagram and Trace View diagrams. Click on the event in question, and then select either “Show in Sequence” or “Show in Trace”.
306
+
307
+ Similarly, you can select an event in a Sequence Diagram or Trace View and click “Show in Flame Graph” to see it displayed in a Flame Graph diagram.
308
+
309
+ ![flame graph image](/assets/img/docs/flamegraph-7.gif)
310
+
311
+ ### Identifying Performance Issues
312
+
313
+ Certain performance problems can be visually easier to spot with a Flame Graph.
314
+
315
+ #### Expensive functions and queries
316
+
317
+ Expensive functions are those that are slow due to them doing a lot of computation and not spending much time waiting on other functions to return. In the example graph shown below, the function at the bottom of the stack is spending most of its 15.1 milliseconds of time waiting for the functions and queries which it called to return. The most expensive area in this stack is therefore the SQL `SELECT` query at the top which takes 10.3 milliseconds. That query should likely be the focus of any performance optimization effort over the other functions and queries.
318
+
319
+ ![flame graph image](/assets/img/docs/flamegraph-expensive.png)
320
+
321
+ #### N+1 Queries
322
+
323
+ AppMap Analysis automatically detects [N+1 queries](/docs/reference/analysis-rules#n-plus-one-query), which are identical database queries called by the same parent function. In the example graph below, 60 repeated queries are visible at the top of the call stack.
324
+
325
+ ![flame graph image](/assets/img/docs/flamegraph-1.gif)
326
+
327
+ #### Delays from external service calls
328
+
329
+ Performance problems can sometimes be caused by latency in external services. In the example graph below, the event in yellow represents a call to another service using HTTP. The call took 936 milliseconds to return, and only a few milliseconds more for the calling function to deal with that. Any optimization efforts for this area should therefore be spent in that other application, preferably by generating an AppMap for its `/users` API.
330
+
331
+ ![flame graph image](/assets/img/docs/flamegraph-external-svc.png)