You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `sqlserver` receiver grabs metrics about a Microsoft SQL Server instance. The receiver works by either using the
17
+
The `sqlserver` receiver grabs metrics/logs about a Microsoft SQL Server instance. The receiver works by either using the
16
18
Windows Performance Counters, or by directly connecting to the instance and querying it. Windows Performance Counters
17
19
are only available when running on Windows.
18
20
@@ -36,6 +38,14 @@ Windows-specific options:
36
38
-`computer_name` (optional): The computer name identifies the SQL Server name or IP address of the computer being monitored.
37
39
If specified, `instance_name` is also required to be defined. This option is ignored in non-Windows environments.
38
40
41
+
Top-Query collection specific options (only useful when top-query collection are enabled):
42
+
-`lookback_time` (optional, example = `60`, default = `2 * collection_interval`): The time window (in second) in which to query for top queries.
43
+
- Queries that were finished execution outside the lookback window are not included in the collection. Increasing the lookback window (in seconds) will be useful for capturing long-running queries.
44
+
-`max_query_sample_count` (optional, example = `5000`, default = `1000`): The maximum number of records to fetch in a single run.
45
+
-`top_query_count`: (optional, example = `100`, default = `200`): The maximum number of active queries to report (to the next consumer) in a single run.
46
+
-`enabled`: (optional, default = `false`): Enable collection of top queries.
47
+
- e.g. `sqlserver` receiver will fetch 1000 (value: `max_query_sample_count`) queries from database and report the top 200 (value: `top_query_count`) which used the most CPU time.
48
+
39
49
Example:
40
50
41
51
```yaml
@@ -50,7 +60,7 @@ Example:
50
60
port: 1433
51
61
```
52
62
53
-
When a named instance is used on Windows, a computer name and a instance name must be specified.
63
+
When a named instance is used on Windows, a computer name and an instance name must be specified.
54
64
Example with named instance:
55
65
56
66
```yaml
@@ -68,10 +78,31 @@ Example with named instance:
68
78
69
79
The full list of settings exposed for this receiver are documented in [config.go](./config.go) with detailed sample configurations in [testdata/config.yaml](./testdata/config.yaml).
70
80
81
+
Top query collection enabled:
82
+
```yaml
83
+
receivers:
84
+
sqlserver:
85
+
collection_interval: 5s
86
+
username: sa
87
+
password: securepassword
88
+
server: 0.0.0.0
89
+
port: 1433
90
+
top_query_collection:
91
+
enabled: true
92
+
lookback_time: 60
93
+
max_query_sample_count: 1000
94
+
top_query_count: 200
95
+
96
+
```
71
97
## Metrics
72
98
73
99
Details about the metrics produced by this receiver can be found in [documentation.md](./documentation.md)
74
100
101
+
102
+
## Logs
103
+
104
+
Details about the logs produced by this receiver can be found in [logs-documentation.md](./logs-documentation.md)
105
+
75
106
## Known issues
76
107
SQL Server docker users may run into an issue that the collector fails to parse certificate from server due to `x509: negative serial number`. That's because we adopted Go `1.23` starting from contrib `v0.121.0`:
77
108
> Before Go 1.23, ParseCertificate accepted certificates with negative serial numbers.
0 commit comments