@appland/appmap 3.133.0 → 3.134.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 (83) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/built/cmds/index/index.js +3 -3
  3. package/built/cmds/index/index.js.map +1 -1
  4. package/built/cmds/index/rpc.js +18 -7
  5. package/built/cmds/index/rpc.js.map +1 -1
  6. package/built/cmds/navie/help.js +122 -0
  7. package/built/cmds/navie/help.js.map +1 -0
  8. package/built/docs/CLA Instructions.pdf +0 -0
  9. package/built/docs/Code of Conduct for Contributors.pdf +0 -0
  10. package/built/docs/analysis/rules-reference.html +27 -0
  11. package/built/docs/appmap-overview.md +54 -0
  12. package/built/docs/community.md +27 -0
  13. package/built/docs/diagrams/dependency-map.md +63 -0
  14. package/built/docs/diagrams/flamegraph.md +91 -0
  15. package/built/docs/diagrams/how-it-works.md +60 -0
  16. package/built/docs/diagrams/index.md +20 -0
  17. package/built/docs/diagrams/sequence-diagram.md +75 -0
  18. package/built/docs/diagrams/trace-view.md +55 -0
  19. package/built/docs/guides/configuring-analysis.md +157 -0
  20. package/built/docs/guides/handling-large-appmaps.md +43 -0
  21. package/built/docs/guides/index.md +17 -0
  22. package/built/docs/guides/openapi.md +104 -0
  23. package/built/docs/guides/reading-sql-in-appmaps.md +67 -0
  24. package/built/docs/guides/refine-appmaps.md +186 -0
  25. package/built/docs/guides/reverse-engineering.md +375 -0
  26. package/built/docs/guides/runtime-code-review.md +108 -0
  27. package/built/docs/integrations/atlassian-compass.md +24 -0
  28. package/built/docs/integrations/atlassian-confluence.md +50 -0
  29. package/built/docs/integrations/docker.md +108 -0
  30. package/built/docs/integrations/github-actions.md +24 -0
  31. package/built/docs/integrations/index.md +17 -0
  32. package/built/docs/integrations/plantuml.md +65 -0
  33. package/built/docs/integrations/postman.md +29 -0
  34. package/built/docs/integrations/readme.md +38 -0
  35. package/built/docs/integrations/smartbear-swaggerhub.md +125 -0
  36. package/built/docs/navie/bring-your-own-key.md +98 -0
  37. package/built/docs/navie/demo.md +49 -0
  38. package/built/docs/navie/how-navie-works.md +26 -0
  39. package/built/docs/navie/how-to-use-navie.md +152 -0
  40. package/built/docs/navie/index.md +20 -0
  41. package/built/docs/reference/analysis-labels.md +48 -0
  42. package/built/docs/reference/analysis-rules.md +60 -0
  43. package/built/docs/reference/appmap-agent-js.md +215 -0
  44. package/built/docs/reference/appmap-client-cli.md +527 -0
  45. package/built/docs/reference/appmap-gradle-plugin.md +140 -0
  46. package/built/docs/reference/appmap-java.md +310 -0
  47. package/built/docs/reference/appmap-maven-plugin.md +163 -0
  48. package/built/docs/reference/appmap-node.md +185 -0
  49. package/built/docs/reference/appmap-python.md +395 -0
  50. package/built/docs/reference/appmap-ruby.md +514 -0
  51. package/built/docs/reference/github-action.md +164 -0
  52. package/built/docs/reference/index.md +23 -0
  53. package/built/docs/reference/jetbrains.md +119 -0
  54. package/built/docs/reference/license-key-install.md +73 -0
  55. package/built/docs/reference/remote-recording-api.md +97 -0
  56. package/built/docs/reference/uninstalling-appmap.md +109 -0
  57. package/built/docs/reference/vscode.md +125 -0
  58. package/built/docs/setup-appmap-in-ci/example-projects.md +20 -0
  59. package/built/docs/setup-appmap-in-ci/how-it-works.md +42 -0
  60. package/built/docs/setup-appmap-in-ci/in-circleci.md +422 -0
  61. package/built/docs/setup-appmap-in-ci/in-github-actions.md +176 -0
  62. package/built/docs/setup-appmap-in-ci/index.md +21 -0
  63. package/built/docs/setup-appmap-in-ci/matrix-builds.md +224 -0
  64. package/built/docs/setup-appmap-in-ci/troubleshooting.md +70 -0
  65. package/built/docs/setup-appmap-in-your-code-editor/add-appmap-to-your-code-editor.md +43 -0
  66. package/built/docs/setup-appmap-in-your-code-editor/appmap-analysis.md +76 -0
  67. package/built/docs/setup-appmap-in-your-code-editor/generate-appmaps-from-tests.md +92 -0
  68. package/built/docs/setup-appmap-in-your-code-editor/generate-appmaps-with-remote-recording.md +111 -0
  69. package/built/docs/setup-appmap-in-your-code-editor/generate-appmaps-with-request-recording.md +79 -0
  70. package/built/docs/setup-appmap-in-your-code-editor/how-appmap-works.md +165 -0
  71. package/built/docs/setup-appmap-in-your-code-editor/index.md +23 -0
  72. package/built/docs/setup-appmap-in-your-code-editor/navigating-appmaps.md +58 -0
  73. package/built/docs/setup-appmap-in-your-code-editor/navigating-code-objects.md +66 -0
  74. package/built/docs/unused_for_now_index.html +11 -0
  75. package/built/rpc/appmap/stats.js +1 -1
  76. package/built/rpc/appmap/stats.js.map +1 -1
  77. package/built/rpc/explain/explain.js +6 -1
  78. package/built/rpc/explain/explain.js.map +1 -1
  79. package/built/rpc/explain/navie/navie-local.js +6 -2
  80. package/built/rpc/explain/navie/navie-local.js.map +1 -1
  81. package/built/rpc/explain/navie/navie-remote.js +5 -1
  82. package/built/rpc/explain/navie/navie-remote.js.map +1 -1
  83. package/package.json +3 -3
@@ -0,0 +1,20 @@
1
+ ---
2
+ layout: docs
3
+ title: Docs - Diagrams
4
+ toc: false
5
+ ---
6
+
7
+ # Using AppMap Diagrams
8
+
9
+ 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.
10
+
11
+ You use AppMaps right in your code editor, using an AppMap extension or plugin. AppMaps also link directly to code, so you can use the information in the diagrams to make immediate code changes and improvements.
12
+
13
+ - [How it works](/docs/diagrams/how-it-works)
14
+ - [Dependency Map](/docs/diagrams/dependency-map)
15
+ - [Trace View](/docs/diagrams/trace-view)
16
+ - [Sequence Diagram](/docs/diagrams/sequence-diagram)
17
+ - [Flame Graph](/docs/diagrams/flamegraph)
18
+
19
+ #### AppMap is optimized for these frameworks:
20
+ {% include docs/app_framework_logos.html %}
@@ -0,0 +1,75 @@
1
+ ---
2
+ layout: docs
3
+ title: Docs - Diagrams
4
+ diagrams: true
5
+ name: Sequence Diagram
6
+ step: 4
7
+ redirect_from: [/docs/diagrams/sequence-diagrams]
8
+ ---
9
+
10
+ # Sequence Diagram
11
+
12
+ > “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]
13
+
14
+ 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.
15
+
16
+ Sequence diagrams can also be exported as SVG files for easy sharing and collaboration. Similar AppMaps can also be compared in a sequence diagram "diff" to reveal changes in runtime behavior caused by a code update.
17
+
18
+ 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/).
19
+
20
+ 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.
21
+
22
+ 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.
23
+
24
+ ## Viewing sequence diagrams in the code editor
25
+
26
+ The AppMap extensions for Visual Studio Code and JetBrains include support for viewing AppMaps as sequence diagrams. Simply open any AppMap and click on the `Sequence Diagram` tab to view it in the main editor window.
27
+
28
+ ![Open sequence diagram](/assets/img/docs/find-sequence-diagram.webp "Open sequence diagram")
29
+
30
+ Sequence Diagrams follow these conventions:
31
+ 1. Inbound HTTP server requests (if any) will be on the left hand side
32
+ 2. Database queries and RPC requests (e.g. HTTP client requests) (if any) will be on the right hand side.
33
+ 3. Each code package is represented as a sequence diagram “lifeline”. Each lifeline is a vertical lane which you can follow down the page.
34
+ 4. Each function call is represented as a line from one lifeline to another.
35
+ 5. The function return value (if any) will be depicted in the opposite direction.
36
+ 6. If an AppMap contains HTTP server requests, other “root” events which are not HTTP server requests will be filtered out, by default.
37
+
38
+ 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.
39
+
40
+ ### Removing lifelines from view
41
+
42
+ 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.
43
+
44
+ ![Hide lifeline in sequence diagram](/assets/img/docs/hide-lifeline-sequence-diagram.webp "Hide lifeline in sequence diagram")
45
+
46
+ Lifelines that have been hidden can be re-shown using the "Filters" control, or by resetting the map using the "Clear" control.
47
+
48
+ ![Show lifeline in sequence diagram](/assets/img/docs/show-lifeline-sequence-diagram.webp "Show lifeline in sequence diagram")
49
+
50
+ ### Collapsing sections of a Sequence Diagram
51
+
52
+ Function calls that contain other events can be collapsed to make the diagram easier to read. This is done using the `[-]` control.
53
+
54
+ ![Collapse sequence diagram](/assets/img/docs/collapse-sequence-diagram.gif "Collapse sequence diagram")
55
+
56
+ Clicking on the `[+]` control will expand the same sequence set once again.
57
+
58
+ ### Exporting sequence diagrams as SVG files
59
+
60
+ 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.
61
+
62
+ 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.
63
+
64
+ ![Export sequence diagram](/assets/img/docs/export-sequence-diagram.webp "Export sequence diagram")
65
+ ![Save sequence diagram](/assets/img/docs/save-sequence-diagram.webp "Save sequence diagram")
66
+
67
+ ## 3rd Party Integrations
68
+
69
+ 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.
70
+
71
+
72
+ ### Notes
73
+
74
+ [^1]:
75
+ [https://en.wikipedia.org/wiki/Sequence_diagram](https://en.wikipedia.org/wiki/Sequence_diagram)
@@ -0,0 +1,55 @@
1
+ ---
2
+ layout: docs
3
+ title: Docs - AppMap Diagrams - Trace View
4
+ diagrams: true
5
+ name: Trace View
6
+ step: 3
7
+ ---
8
+
9
+ # Trace View
10
+
11
+ 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.
12
+
13
+ The Trace view is fully interactive. You can:
14
+ - [Expand and collapse execution paths](#expand-and-collapse-execution-paths)
15
+ - [Explore callers and callees](#explore-callers-and-callees)
16
+ - [View variable names and values at any point in the code flow](#view-variable-names-and-values-at-any-point-in-the-code-flow)
17
+ - [View SQL queries](#view-sql-queries)
18
+ - [Open source code right to the line of any particular function](#open-source-code-right-to-the-line-of-any-particular-function)
19
+
20
+ ![Trace view is fully interactive](/assets/img/docs/trace-is-fully-interactive.webp "Trace view is fully interactive")
21
+
22
+ #### Expand and collapse execution paths
23
+ <div class="video-container">
24
+ <video playsinline loop autoplay muted>
25
+ <source src="/assets/img/docs/expand-and-collapse-execution-paths.mp4" type="video/mp4">
26
+ </video>
27
+ </div>
28
+
29
+ #### Explore callers and callees
30
+ <div class="video-container">
31
+ <video playsinline loop autoplay muted>
32
+ <source src="/assets/img/docs/trace-explore-callers-and-callees.mp4" type="video/mp4">
33
+ </video>
34
+ </div>
35
+
36
+ #### View variable names and values at any point in the code flow
37
+ <div class="video-container">
38
+ <video playsinline loop autoplay muted>
39
+ <source src="/assets/img/docs/view-variable-names-and-values.mp4" type="video/mp4">
40
+ </video>
41
+ </div>
42
+
43
+ #### View SQL queries
44
+ <div class="video-container">
45
+ <video playsinline loop autoplay muted>
46
+ <source src="/assets/img/docs/view-sql-queries.mp4" type="video/mp4">
47
+ </video>
48
+ </div>
49
+
50
+ #### Open source code right to the line of any particular function
51
+ <div class="video-container">
52
+ <video playsinline loop autoplay muted>
53
+ <source src="/assets/img/docs/open-source-code-right-to-the-line.mp4" type="video/mp4">
54
+ </video>
55
+ </div>
@@ -0,0 +1,157 @@
1
+ ---
2
+ layout: docs
3
+ title: Docs - Guides
4
+ guides: true
5
+ name: Configuring Analysis
6
+ step: 6
7
+ redirect_from: [/docs/analysis/match-pattern-config, /docs/analysis/findings,/docs/reference/configuring-analysis]
8
+ ---
9
+
10
+ # Configuring Analysis <!-- omit in toc -->
11
+
12
+ - [Configuring checks](#configuring-checks)
13
+ - [Example appmap-scanner.yml](#example-appmap-scanneryml)
14
+ - [Match pattern config](#match-pattern-config)
15
+ - [Examples](#examples)
16
+ - [Findings Reference](#findings-reference)
17
+ - [Properties](#properties)
18
+ - [Finding hash](#finding-hash)
19
+
20
+
21
+ ## Configuring checks
22
+
23
+ AppMap Analysis is configured in a YAML document. It's primary job is to specify which scanner rules will check the code.
24
+ Each check specifies a rule id, and may include additional properties that customized and tune the behavior of the rule.
25
+
26
+ AppMap Analysis ships with a default configuration file located in `node_modules/@appland/scanner/built/sampleConfig/default.yml`.
27
+
28
+ 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.
29
+
30
+ To use a non-default configuration, specify the path to the configuration file via the `-c` or `--config` option:
31
+
32
+ ```sh
33
+ $ npx @appland/scanner \
34
+ --appmap-dir tmp/appmap \
35
+ --config appmap-scanner.yml \
36
+ ci
37
+ ```
38
+ {: .example-code}
39
+
40
+ 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.
41
+
42
+ ### Example appmap-scanner.yml
43
+
44
+ ```
45
+ checks:
46
+ - rule: authzBeforeAuthn
47
+ - rule: http500
48
+ - rule: illegalPackageDependency
49
+ properties:
50
+ callerPackages:
51
+ - equal: actionpack
52
+ calleePackage:
53
+ equal: app/controllers
54
+ - rule: insecureCompare
55
+ - rule: missingAuthentication
56
+ - rule: missingContentType
57
+ - rule: nPlusOneQuery
58
+ - rule: secretInLog
59
+ - rule: slowFunctionCall
60
+ properties:
61
+ timeAllowed: 0.2
62
+ functions:
63
+ - match: Controller#create$
64
+ - rule: slowHttpServerRequest
65
+ properties:
66
+ timeAllowed: 0.5
67
+ - rule: slowQuery
68
+ properties:
69
+ timeAllowed: 0.05
70
+ - rule: tooManyJoins
71
+ - rule: tooManyUpdates
72
+ - rule: unbatchedMaterializedQuery
73
+ - rule: updateInGetRequest
74
+ ```
75
+
76
+ ## Match pattern config
77
+
78
+ Some rule options are defined as type `MatchPatternConfig`. `MatchPatternConfig` is a flexible way to
79
+ match a string such as content type, code object name, etc.
80
+
81
+ Each `MatchPatternConfig` requires one of the following three YAML keys:
82
+
83
+ ```yaml
84
+ - match: RegExp # String value must match this regexp
85
+ - include: string # String value must include this substring
86
+ - equal: string # String value must equal this string
87
+ ```
88
+ {: .example-code}
89
+
90
+ Optionally:
91
+
92
+ ```yaml
93
+ - ignoreCase: boolean # When true, the match/include/equal test is case-insensitive
94
+ ```
95
+ {: .example-code}
96
+
97
+ ### Examples
98
+
99
+ The `illegalPackageDependency` rule is applied to the package `app/controllers` (exactly). The caller package must
100
+ be `actionpack` (exactly).
101
+
102
+ ```
103
+ - rule: illegalPackageDependency
104
+ properties:
105
+ callerPackages:
106
+ - equal: actionpack
107
+ calleePackage:
108
+ equal: app/controllers
109
+ ```
110
+
111
+ The `slowFunctionCall` rule is applied to all functions that match one of two regular expressions (case sensitive).
112
+
113
+ ```
114
+ - rule: slowFunctionCall
115
+ properties:
116
+ functions:
117
+ - match: ^app/models
118
+ - match: ^app/jobs
119
+ ```
120
+
121
+ The `missingAuthentication` rule is *not applied* to any event whose `route` includes `/api/`.
122
+
123
+ ```
124
+ - rule: missingAuthentication
125
+ exclude:
126
+ - event:
127
+ property: route
128
+ test:
129
+ include: /api/
130
+ ```
131
+
132
+ ## Findings Reference
133
+
134
+ When a scanner check matches an AppMap, it issues a _finding_. A finding includes detailed information about the match, indicating such information as:
135
+
136
+ * A title and message.
137
+ * AppMap in which the finding was found.
138
+ * The primary and secondary events that are relevant to the finding.
139
+
140
+ ### Properties
141
+
142
+ * `ruleId` identifier of the [rule](/docs/reference/analysis-rules) algorithm.
143
+ * `checkId` identifier of the `check`, which a configured instance of a `rule`.
144
+ * `ruleTitle` human-friendly title of the rule.
145
+ * `message` human-friendly message describing the finding.
146
+ * `appMapFile` relative path to the [AppMap](https://github.com/getappmap/appmap#appmap-data-specification) file containing the match.
147
+ * `event` JSON object of the primary [event](https://github.com/getappmap/appmap#events) on which the match was found.
148
+ * `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.
149
+ * `scope` JSON of the event which defines the AppMap subtree in which the finding was discovered.
150
+ * [`hash`](#finding-hash) of the finding which can be used to identify duplicate findings.
151
+
152
+ ### Finding hash
153
+
154
+ 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:
155
+
156
+ 1) A finding may occur many times within a set of AppMaps. 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.
157
+ 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,43 @@
1
+ ---
2
+ layout: docs
3
+ title: Docs - Guides
4
+ guides: true
5
+ name: Handling Large AppMaps
6
+ step: 2
7
+ redirect_from: [/docs/reference/handling-large-appmaps]
8
+ ---
9
+
10
+ # Handling Large AppMaps <!-- omit in toc -->
11
+
12
+ Some AppMaps contain too much data and can be difficult to review. Often, these AppMaps have many repetitive function calls that add a lot of data to the file, but don't add much value when interpreting the AppMap. Large AppMaps are a potential indication that you should change how you're recording by filtering out less valuable information. For example, you could exclude some calls to logging functions, or record fewer endpoints when manually recording.
13
+
14
+ - [AppMaps Over 10 MB](#appmaps-over-10-mb)
15
+ - [AppMaps Over 200 MB](#appmaps-over-200-mb)
16
+
17
+ ## AppMaps Over 10 MB
18
+
19
+ When you attempt to open an AppMap in a code editor extension that is over 10 MB, it will be automatically pruned down to ~10 MB. The most frequently called functions will be removed until the file is below 10 MB in size. (Don't worry, the file will remain untouched because the pruning is done in memory). You will see notifications within the AppMap informing you that it has been pruned, and the pruned functions will be highlighted in the Stats panel:
20
+
21
+ ![Pruned Stats Panel](/assets/img/docs/pruned_stats_panel.webp)
22
+
23
+ The automatic pruning might be sufficient, but if you want more control over what events are removed, you have two options:
24
+
25
+ 1. [Use the `prune` CLI command to remove events from an existing AppMap](/docs/reference/appmap-client-cli.html#prune)
26
+ 2. Change the configuration of your `appmap.yml` to exclude certain events when an AppMap is generated
27
+ * [Configure exclusions in a Ruby project](/docs/reference/appmap-ruby.html#configuration)
28
+ * [Configure exclusions in a Java project](/docs/reference/appmap-java.html#configuration)
29
+ * [Configure exclusions in a Python project](/docs/reference/appmap-python.html#configuration)
30
+ * [Configure exclusions in a Node.js project](/docs/reference/appmap-node.html#configuration)
31
+
32
+ ## AppMaps Over 200 MB
33
+
34
+ When an AppMap is over 200 MB, we will **not** open it in the code editor extension because it could cause performance issues on your computer. Instead, we generate statistics about your AppMap and open the Stats panel. Use this information to configure your `appmap.yml` to exclude these functions (see below). The next time that you generate your AppMap, it will be smaller because it will not contain the specified functions:
35
+
36
+ ![Giant Map Stats Panel](/assets/img/docs/giant_map_stats_panel.jpg)
37
+
38
+ * [Configure exclusions in a Ruby project](/docs/reference/appmap-ruby.html#configuration)
39
+ * [Configure exclusions in a Java project](/docs/reference/appmap-java.html#configuration)
40
+ * [Configure exclusions in a Python project](/docs/reference/appmap-python.html#configuration)
41
+ * [Configure exclusions in a Node.js project](/docs/reference/appmap-node.html#configuration)
42
+
43
+ We do not recommend using the `prune` CLI command for AppMaps over 200 MB, because it loads the entire AppMap into memory, which may cause performance issues for your computer.
@@ -0,0 +1,17 @@
1
+ ---
2
+ layout: docs
3
+ title: Docs - How-To Guides
4
+ step: 1
5
+ ---
6
+
7
+ # How-To Guides
8
+
9
+ These guide contain in-depth information on how to use AppMap for different use cases and scenarios.
10
+
11
+ - [Handling Large AppMaps](/docs/guides/handling-large-appmaps)
12
+ - [Reading SQL in AppMaps](/docs/guides/reading-sql-in-appmaps)
13
+ - [Refining AppMaps](/docs/guides/refine-appmaps)
14
+ - [Generating OpenAPI Definitions](/docs/guides/openapi)
15
+ - [Configuring Analysis](/docs/guides/configuring-analysis)
16
+ - [Reverse Engineering with AppMap](/docs/guides/reverse-engineering)
17
+ - [Understanding the Runtime Code Review Report](/docs/guides/runtime-code-review)
@@ -0,0 +1,104 @@
1
+ ---
2
+ layout: docs
3
+ title: Docs - Guides
4
+ guides: true
5
+ name: Generating OpenAPI Definitions
6
+ step: 5
7
+ redirect_from: [/docs/openapi,/docs/openapi/features,/docs/openapi/code-editor-extensions,/docs/openapi/integrations,/docs/openapi/customization,/docs/reference/openapi]
8
+ ---
9
+
10
+
11
+ # Generating OpenAPI Definitions <!-- omit in toc -->
12
+
13
+ > "The OpenAPI specification, which is formerly known as Swagger Specification, is a community-driven open standard, programming language-agnostic interface description for HTTP APIs. This allows both humans and computers to discover and understand the capabilities of a service without requiring access to the source code."
14
+
15
+ Because AppMap records your code's runtime behavior, it can see and record all of the HTTP API calls processed including the schema of each request and response. Creating OpenAPI definitions by hand is error prone and time consuming. Keeping them up to date is additional work that quickly falls out of sync with the code. Using the AppMap we can automatically output OpenAPI definitions for an application.
16
+
17
+ - [Requirements](#requirements)
18
+ - [Schema](#schema)
19
+ - [Use Cases](#use-cases)
20
+ - [Pull Request Review](#pull-request-review)
21
+ - [Update Documentation Automatically](#update-documentation-automatically)
22
+ - [Send to 3rd Party Services](#send-to-3rd-party-services)
23
+ - [Generating definitions](#generating-definitions)
24
+ - [Integrations](#integrations)
25
+ - [Customization](#customization)
26
+ - [Operation `summary`](#operation-summary)
27
+
28
+ ## Requirements
29
+
30
+ 1. AppMaps for your application that includes calls to your API endpoints. (Refer to the AppMap documentation on [how to record your application](/docs/recording-methods))
31
+ 2. The latest version of the [AppMap binaries downloaded.](https://github.com/getappmap/appmap-js/releases?q=@appland/appmap*&expanded=true) (For the CLI usage)
32
+ 3. The latest version of the AppMap code editor extension (for code editor usage)
33
+
34
+ ## Schema
35
+
36
+ The generated OpenAPI schema only includes information (paths, methods, status codes, parameters, responses, headers, security) that have actually been observed in the AppMap data. So, if a particular code behavior has not been observed by AppMap, it won't be present in the OpenAPI.
37
+
38
+ When AppMap data is collected by running test cases, the generated OpenAPI will reflect the code coverage of the application with regard to its APIs. If an expected path, method, status or parameter is not observed in the generated OpenAPI, you'll know it's missing because it's not tested.
39
+
40
+ Object schema is inferred from runtime data. When there are many examples of a request, the inferred schema of all the examples is merged into one unified schema.
41
+
42
+ Both request and response schema are available.
43
+
44
+ ## Use Cases
45
+
46
+ ### Pull Request Review
47
+
48
+ We suggest you generate OpenAPI for all new work, and commit the _openapi.yaml_ file to source control. When a pull request contains API changes, a diff view of the OpenAPI changes is a very useful way for code reviewers to quickly get the "big picture" of the new branch.
49
+
50
+ ### Update Documentation Automatically
51
+
52
+ By generating OpenAPI definitions as part of your continuous integration process, you can ensure that your documentation continually updates automatically as the code updates. This reduces unnecessary engineering toil working to keep documentation up to date manually.
53
+
54
+ ### Send to 3rd Party Services
55
+
56
+ Integrate AppMap OpenAPI generation with various 3rd party services to share OpenAPI documentation with your end users or validate and diff changes over time. [Refer to the documentation](/docs/integrations/) to learn how to incorporate AppMap OpenAPI generation with various 3rd party services.
57
+
58
+ ## Generating definitions
59
+
60
+ * [AppMap extension for VSCode](/docs/reference/vscode.html#generate-openapi-definitions)
61
+ * [AppMap extension for JetBrains](/docs/reference/jetbrains.html#generate-openapi-definitions)
62
+ * [AppMap CLI](/docs/reference/appmap-client-cli.html#openapi)
63
+
64
+ ## Integrations
65
+
66
+ Refer to the AppMap [integrations documentation](/docs/integrations/) to learn more about how to integrate your OpenAPI documentation with other 3rd party software and services.
67
+
68
+ ## Customization
69
+
70
+ ### Operation `summary`
71
+
72
+ To populate [`operation.summary`](https://swagger.io/specification/#operation-object), set the header `X-OpenAPI-Summary` in your response.
73
+
74
+ **Example**
75
+
76
+ _Ruby on Rails Controller_
77
+
78
+ ```
79
+ class AccountActivationsController < ApplicationController
80
+ def edit
81
+ response.headers['X-OpenAPI-Summary'] = 'Activate the account of an existing user'
82
+ ```
83
+
84
+ _openapi.yaml_
85
+
86
+ ```
87
+ /account_activations/{id}/edit:
88
+ get:
89
+ responses:
90
+ '302':
91
+ content: {}
92
+ description: Found
93
+ parameters:
94
+ - name: email
95
+ in: query
96
+ schema:
97
+ type: string
98
+ - name: id
99
+ in: path
100
+ schema:
101
+ type: string
102
+ required: true
103
+ summary: Activate the account of an existing user
104
+ ```
@@ -0,0 +1,67 @@
1
+ ---
2
+ layout: docs
3
+ title: Docs - Guides
4
+ guides: true
5
+ name: Reading SQL in AppMaps
6
+ step: 3
7
+ ---
8
+
9
+ ## Reading SQL in AppMaps
10
+ The AppMap extension for your editor displays SQL commands in AppMap Diagrams so you can understand how your application logic interacts with the database. You can quickly discover SQL inefficiencies and anti-patterns that pose hidden scalability and reliability risks even if your application seems to be working well.
11
+
12
+ With the AppMap extension, not only are trips to database logs no longer required to see the SQL commands, but the SQL commands are also directly linked to the code that initiates their execution, helping developers understand the direct impacts of their code updates on database operations and performance.
13
+
14
+ ### View all SQL commands, pick a command of interest, and drill down to details
15
+ When you open an AppMap, the navigation bar lists all captured SQL commands. This is a great starting point for your SQL investigation:
16
+ - Browse the list of SQL commands, pick a command, and click on it to drill down to details
17
+ - View the SQL command in the Trace to see how it is connected to upstream/downstream code and other SQL commands
18
+ - Click on the Caller link to see the function call that initiated the command’s execution.
19
+
20
+ <div class="video-container">
21
+ <video playsinline loop autoplay muted>
22
+ <source src="/assets/img/docs/view-all-sql-commands.mp4" type="video/mp4">
23
+ </video>
24
+ </div>
25
+
26
+ ### Search for specific SQL commands/tables/columns
27
+ Use the search box in the Navigation bar to select for a specific subset of SQL Commands:
28
+ - Search for a specific SQL command such as SELECT, UPDATE, INSERT, etc.
29
+ - Search for a table or column name
30
+ - Use regular expressions for complex searches, filtering the results by multiple criteria, for example, `SELECT.*_orders.*`
31
+
32
+ <div class="video-container">
33
+ <video playsinline loop autoplay muted>
34
+ <source src="/assets/img/docs/search-for-specific-sql-commands.mp4" type="video/mp4">
35
+ </video>
36
+ </div>
37
+
38
+ ### View SQL commands executed by a specific class or package
39
+ When you click on a dependency link in the Dependency Map, the navigation bar will list events specific to that relationship.
40
+ - Select a link between the database icon and a class to see SQL commands executed by functions of that class
41
+ - Click on a SQL command to drill down to details.
42
+
43
+ <div class="video-container">
44
+ <video playsinline loop autoplay muted>
45
+ <source src="/assets/img/docs/view-specific-sql-executed-by-class.mp4" type="video/mp4">
46
+ </video>
47
+ </div>
48
+
49
+ ### Spot complex SQL patterns
50
+ When investigating how efficiently the application code or the ORM utilizes the database, it’s helpful to see whether multiple SQL commands are clustered together and whether they form any specific (anti-)patterns. The Trace view is a great visual tool for spotting clusters and repetitions of SQL commands enveloped by code that are difficult to discover using database logs or other simple tools.
51
+ - In the AppMap, switch to the Trace view
52
+ - Start with any of the SQL commands in the navigation bar and investigate how they are connected with other SQL commands or code blocks
53
+ - When looking for N+1-like patterns, look for repetitive SQL `SELECT`s fetching single records using a specific ID
54
+ - Use the zoom controls, arrow keys, panning, and expand/collapse functions to navigate around the trace efficiently.
55
+
56
+ #### Navigate the trace efficiently
57
+ <div class="video-container">
58
+ <video playsinline loop autoplay muted>
59
+ <source src="/assets/img/docs/navigate-the-trace-efficiently.mp4" type="video/mp4">
60
+ </video>
61
+ </div>
62
+
63
+
64
+ ### Example: How to spot and fix Django ORM anti-patterns
65
+ In this video example, you can learn how to optimize Django ORM by seeing how it makes SQL queries under the hood. The video explains the role of ORM in modern applications, SQL efficiency challenges, and how to use AppMap for uncovering and fixing the infamous N+1 anti-pattern
66
+
67
+ <div style="position: relative; padding-bottom: 56.25%; height: 0;"><iframe src="https://www.loom.com/embed/3872950e96174da4a714211b2af7f56e" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe></div>