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/Azure.Monitor.Query/README.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,7 +85,7 @@ All client instance methods are thread-safe and independent of each other ([guid
85
85
86
86
### Logs query
87
87
88
-
You can query logs using the `LogsQueryClient.QueryAsync` method. The result is returned as a table with a collection of rows:
88
+
You can query logs using the `LogsQueryClient.QueryWorkspaceAsync` method. The result is returned as a table with a collection of rows:
89
89
90
90
```C# Snippet:QueryLogsAsTable
91
91
stringworkspaceId="<workspace_id>";
@@ -104,7 +104,8 @@ foreach (var row in table.Rows)
104
104
```
105
105
106
106
#### Handle logs query response
107
-
The `Query` method returns the `LogsQueryResult`, while the `QueryBatch` method returns the `LogsBatchQueryResult`. Here's a hierarchy of the response:
107
+
108
+
The `QueryWorkspace` method returns the `LogsQueryResult`, while the `QueryBatch` method returns the `LogsBatchQueryResult`. Here's a hierarchy of the response:
108
109
109
110
```
110
111
LogsQueryResult
@@ -122,7 +123,7 @@ LogsQueryResult
122
123
123
124
#### Map logs query results to a model
124
125
125
-
You can map logs query results to a model using the `LogsQueryClient.QueryAsync<T>` method.
126
+
You can map logs query results to a model using the `LogsQueryClient.QueryWorkspaceAsync<T>` method.
126
127
127
128
```C# Snippet:QueryLogsAsModelsModel
128
129
publicclassMyLogEntryModel
@@ -150,7 +151,7 @@ foreach (var logEntryModel in response.Value)
150
151
151
152
#### Map logs query results to a primitive
152
153
153
-
If your query returns a single column (or a single value) of a primitive type, use the `LogsQueryClient.QueryAsync<T>` overload to deserialize it:
154
+
If your query returns a single column (or a single value) of a primitive type, use the `LogsQueryClient.QueryWorkspaceAsync<T>` overload to deserialize it:
154
155
155
156
```C# Snippet:QueryLogsAsPrimitive
156
157
stringworkspaceId="<workspace_id>";
@@ -266,7 +267,7 @@ foreach (var resourceGroup in response.Value)
266
267
267
268
#### Query multiple workspaces
268
269
269
-
To run the same query against multiple workspaces, use the `LogsQueryOptions.AdditionalWorkspaces` property:
270
+
To run the same logs query against multiple workspaces, use the `LogsQueryOptions.AdditionalWorkspaces` property:
270
271
271
272
```C# Snippet:QueryLogsWithAdditionalWorkspace
272
273
stringworkspaceId="<workspace_id>";
@@ -292,7 +293,7 @@ foreach (var resourceGroup in response.Value)
292
293
293
294
### Metrics query
294
295
295
-
You can query metrics using the `MetricsQueryClient.QueryAsync` method. For every requested metric, a set of aggregated values is returned inside the `TimeSeries` collection.
296
+
You can query metrics using the `MetricsQueryClient.QueryResourceAsync` method. For every requested metric, a set of aggregated values is returned inside the `TimeSeries` collection.
296
297
297
298
A resource ID is required to query metrics. To find the resource ID:
298
299
@@ -328,7 +329,7 @@ foreach (var metric in results.Value.Metrics)
328
329
329
330
#### Handle metrics query response
330
331
331
-
The metrics query API returns a `MetricsQueryResult` object. The `MetricsQueryResult` object contains properties such as a list of `MetricResult`-typed objects, `Cost`, `Namespace`, `ResourceRegion`, `TimeSpan`, and `Interval`. The `MetricResult` objects list can be accessed using the `metrics` param. Each `MetricResult` object in this list contains a list of `MetricTimeSeriesElement` objects. Each `MetricTimeSeriesElement` object contains `Metadata` and `Values` properties.
332
+
The metrics query API returns a `MetricsQueryResult` object. The `MetricsQueryResult` object contains properties such as a list of `MetricResult`-typed objects, `Cost`, `Namespace`, `ResourceRegion`, `TimeSpan`, and `Interval`. The `MetricResult` objects list can be accessed using the `metrics` param. Each `MetricResult` object in this list contains a list of `MetricTimeSeriesElement` objects. Each `MetricTimeSeriesElement` object contains `Metadata` and `Values` properties.
0 commit comments