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
Copy file name to clipboardExpand all lines: sdk/monitor/azquery/README.md
+16-6Lines changed: 16 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,8 +22,8 @@ go get github.com/Azure/azure-sdk-for-go/sdk/azidentity
22
22
23
23
* An [Azure subscription][azure_sub]
24
24
* A supported Go version (the Azure SDK supports the two most recent Go releases)
25
-
* For log queries, a Log Analytics workspace.
26
-
* For metric queries, a Resource URI.
25
+
* For log queries, an [Azure Log Analytics workspace][log_analytics_workspace_create] ID.
26
+
* For metric queries, the Resource URI of any Azure resource (Storage Account, Key Vault, CosmosDB, etc).
27
27
28
28
### Authentication
29
29
@@ -77,7 +77,7 @@ For examples of Logs and Metrics queries, see the [Examples](#examples) section
77
77
78
78
The Log Analytics service applies throttling when the request rate is too high. Limits, such as the maximum number of rows returned, are also applied on the Kusto queries. For more information, see [Query API](https://docs.microsoft.com/azure/azure-monitor/service-limits#la-query-api).
79
79
80
-
If you're executing a batch logs query, a throttled request will return a `LogsQueryError` object. That object's `code` value will be `ThrottledError`.
80
+
If you're executing a batch logs query, a throttled request will return a `ErrorInfo` object. That object's `code` value will be `ThrottledError`.
81
81
82
82
### Metrics data structure
83
83
@@ -136,8 +136,8 @@ full example: [link][example_query_workspace]
136
136
```
137
137
Body
138
138
|---Query *string // Kusto Query
139
-
|---Timespan *string // ISO8601 Standard Timespan- refer to timespan section for more info
140
-
|---Workspaces []*string //Optional- additional workspaces to query
139
+
|---Timespan *string // ISO8601 Standard Timespan
140
+
|---Workspaces []*string //Optional- additional workspaces to query
141
141
```
142
142
143
143
#### Logs query result structure
@@ -150,6 +150,7 @@ Results
150
150
|---Name *string
151
151
|---Rows [][]interface{}
152
152
|---Error *ErrorInfo
153
+
|---Code *string // custom error type
153
154
|---Render interface{}
154
155
|---Statistics interface{}
155
156
```
@@ -193,7 +194,8 @@ BatchRequest
193
194
BatchResponse
194
195
|---Responses []*BatchQueryResponse
195
196
|---Body *BatchQueryResults
196
-
|---Error *ErrorInfo
197
+
|---Error *ErrorInfo // custom error type
198
+
|---Code *string
197
199
|---Render interface{}
198
200
|---Statistics interface{}
199
201
|---Tables []*Table
@@ -301,6 +303,12 @@ Response
301
303
302
304
## Troubleshooting
303
305
306
+
### Error Handling
307
+
308
+
All methods which send HTTP requests return `*azcore.ResponseError` when these requests fail. `ResponseError` has error details and the raw response from Monitor Query.
309
+
310
+
For Logs, an error may also be returned in the response's `ErrorInfo` struct, usually to indicate a partial error from the service.
311
+
304
312
### Logging
305
313
306
314
This module uses the logging implementation in `azcore`. To turn on logging for all Azure SDK modules, set `AZURE_SDK_GO_LOGGING` to `all`. By default the logger writes to stderr. Use the `azcore/log` package to control log output. For example, logging only HTTP request and response events, and printing them to stdout:
0 commit comments