Skip to content

Commit 92f035c

Browse files
authored
Update readme (#234)
1 parent c7a4f31 commit 92f035c

File tree

2 files changed

+41
-30
lines changed

2 files changed

+41
-30
lines changed

src/document/DocumentManager.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,9 @@ export class DocumentManager implements SettingsConfigurable, Closeable {
165165

166166
private emitDocSizeMetrics() {
167167
for (const doc of this.documentMap.values()) {
168-
this.telemetry.histogram(`documents.size.bytes`, byteSize(doc.contents()), { unit: 'By' });
168+
if (doc.isTemplate()) {
169+
this.telemetry.histogram('documents.template.size.bytes', byteSize(doc.contents()), { unit: 'By' });
170+
}
169171
}
170172
}
171173

src/telemetry/README.md

Lines changed: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,47 @@ Language servers must deliver suggestions quickly to avoid interrupting your wor
55

66
Telemetry enablement is controlled by your LSP client via initialization options passed to the language server, see [Enable or Disable Telemetry](#enable-or-disable-telemetry) for details.
77
The CloudFormation Language Server environment you use will determine the default telemetry collection behaviour:
8-
* Alpha - Telemetry is enabled by default if no initialization parameter is provided
9-
* Beta and Prod - Telemetry is disabled by default if no initialization parameter is provided
8+
* **Alpha** - Telemetry is enabled by default if no initialization parameter is provided
9+
* **Beta and Prod** - Telemetry is disabled by default if no initialization parameter is provided
1010

1111
## What We Collect
12-
Language servers must deliver suggestions quickly and accurately to avoid interrupting your workflow. These metrics help us:
13-
* Measure response time: How long an operation took to complete (hover, autocomplete, go-to, etc.)
14-
* Understand the quality and relevance of suggestions we provide
15-
* Usage metrics: Invocation counts for operations
16-
* Error metrics: Fault counts when operations fail
17-
* Response metrics: Type and size of data returned by operations
18-
* Primitive data types only, actual data is not recorded
19-
* System Information: Operating system, LSP client version, Node.js version
20-
* Does the hardware impact customer experience?
21-
* Detect performance degradations that impacts the authoring experience
22-
23-
Without telemetry, we cannot objectively evaluate if suggestions are accurate or if the language server is meeting the performance expectations of a real-time authoring experience.
12+
The language server collects anonymous telemetry:
13+
* **Performance Metrics** - Response time (latency) for operations
14+
* **Usage Metrics** - Invocation counts for operations
15+
* **Error Metrics** - Fault counts when operations fail, stack trace metadata: error type, file name, line number, column number
16+
* **Response Metrics** - Data type (_primitives only_: string, number, boolean, object, array, etc.) and size
17+
* **System Metrics** - CPU utilization, Memory utilization, process uptime
18+
* **System Information**
19+
* Operating system type, platform, architecture, version
20+
* LSP client name and version
21+
* Node.js and V8 engine versions
22+
* Process platform and architecture
23+
24+
## Why We Collect Telemetry
25+
Language servers must deliver suggestions in real-time to avoid interrupting your workflow. Telemetry enables us to:
26+
* Measure if operations meet real-time performance expectations
27+
* Detect performance degradations before they impact the authoring experience
28+
* Understand if suggestions are accurate and relevant
29+
* Identify if hardware or environment impacts customer experience
30+
* Make data-driven decisions on feature improvements
31+
32+
Without telemetry, we cannot objectively evaluate if the language server meets performance expectations or if suggestions help users author CloudFormation templates effectively.
2433

2534
### Metrics Metadata
26-
Every metric includes the following metadata attributes:
27-
28-
| Attribute | Description | Example |
29-
|---|---------------------------------------------------|-------------------------------------------------------------|
30-
| `service` | Language server name and version | `aws-cloudformation-languageserver-1.2.3` |
31-
| `service.env` | Node environment and AWS environment | `production-prod` |
32-
| `client.id` | Unique session identifier (UUID) | `1111-2222-3333-4444` |
33-
| `client.type` | LSP client name and version | `vscode-1.85.0` |
34-
| `machine.type` | OS type, platform, architecture, version | `Darwin-darwin-arm64-arm64-22.1.0` |
35-
| `process.type` | Process platform and architecture | `darwin-arm64` |
36-
| `process.version` | Node.js and V8 versions | `node=22.18.0 v8=12.4.254.21-node.27 uv=1.51.0 modules=127` |
37-
| `OTelLib` | Operation name | `Hover`, `Completion`, etc. |
38-
| `HandlerSource` | Request handler that initiated an operation | `Document.Open`, `Stack.List`, `Resource.Search`, etc. |
39-
| `RequestId` | Random unique identifier for each request (UUID) | `5555-6666-7777-8888` |
35+
Metrics includes the following metadata:
36+
37+
| Attribute | Description | Example |
38+
|---|----------------------------------------------------|-------------------------------------------------------------|
39+
| `service` | Language server name and version | `aws-cloudformation-languageserver-1.2.3` |
40+
| `service.env` | Node environment and AWS environment | `production-prod` |
41+
| `client.id` | Unique client identifier (UUID) | `1111-2222-3333-4444` |
42+
| `client.type` | LSP client name and version | `vscode-1.85.0` |
43+
| `machine.type` | OS type, platform, architecture, version | `Darwin-darwin-arm64-arm64-22.1.0` |
44+
| `process.type` | Process platform and architecture | `darwin-arm64` |
45+
| `process.version` | Node.js and V8 versions | `node=22.18.0 v8=12.4.254.21-node.27 uv=1.51.0 modules=127` |
46+
| `OTelLib` | Operation name | `Hover`, `Completion`, etc. |
47+
| `HandlerSource` | Request handler that initiated an operation | `Document.Open`, `Stack.List`, `Resource.Search`, etc. |
48+
| `RequestId` | Random unique identifier for each operation (UUID) | `5555-6666-7777-8888` |
4049

4150
## Data Transmission
4251
Metrics export every 30 seconds via HTTPS with TLS 1.2+ encryption using OpenTelemetry Protocol (OTLP).
@@ -56,4 +65,4 @@ initializationOptions: {
5665
...
5766
```
5867

59-
Consult your LSP client's documentation for configuration options. Changes to telemetry enablement require restarting the language server to take effect.
68+
Consult your LSP client's documentation for configuration options. Changes to telemetry enablement require restarting the language server to take effect.

0 commit comments

Comments
 (0)