Skip to content

Commit 741c8ec

Browse files
authored
Update XML docs for public Monitor Query APIs (Azure#38902)
* Update XML docs for public Monitor Query APIs * Update parameter descriptions * Fix typo
1 parent b1b123c commit 741c8ec

File tree

4 files changed

+61
-31
lines changed

4 files changed

+61
-31
lines changed

sdk/monitor/Azure.Monitor.Query/src/LogsQueryClient.cs

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public LogsQueryClient(Uri endpoint, TokenCredential credential, LogsQueryClient
7979
}
8080

8181
/// <summary>
82-
/// Initializes a new instance of <see cref="LogsQueryClient"/> for mocking.
82+
/// Creates an instance of <see cref="LogsQueryClient"/> to support <see href="https://aka.ms/azsdk/net/mocking">mocking</see>.
8383
/// </summary>
8484
protected LogsQueryClient()
8585
{
@@ -113,12 +113,15 @@ protected LogsQueryClient()
113113
/// </code>
114114
/// </example>
115115
/// </summary>
116-
/// <param name="workspaceId">The workspace id to include in the query (<c>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</c>).</param>
117-
/// <param name="query">The Kusto query to execute.</param>
118-
/// <param name="timeRange">The timespan over which to query data. Logs will be filtered to include entries produced starting at <c>Now - timeSpan</c>. </param>
116+
/// <param name="workspaceId">The workspace ID to include in the query (<c>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</c>).</param>
117+
/// <param name="query">The Kusto query to fetch the logs.</param>
118+
/// <param name="timeRange">The time period for which the logs should be looked up.</param>
119119
/// <param name="options">The <see cref="LogsQueryOptions"/> to configure the query.</param>
120120
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to use.</param>
121121
/// <returns>Query results mapped to a type <typeparamref name="T"/>.</returns>
122+
/// <remarks>
123+
/// When the <paramref name="timeRange"/> argument is <see cref="QueryTimeRange.All"/> and the <paramref name="query"/> argument contains a time range filter, the underlying service uses the time range specified in <paramref name="query"/>.
124+
/// </remarks>
122125
public virtual Response<IReadOnlyList<T>> QueryWorkspace<T>(string workspaceId, string query, QueryTimeRange timeRange, LogsQueryOptions options = null, CancellationToken cancellationToken = default)
123126
{
124127
Response<LogsQueryResult> response = QueryWorkspace(workspaceId, query, timeRange, options, cancellationToken);
@@ -149,12 +152,15 @@ public virtual Response<IReadOnlyList<T>> QueryWorkspace<T>(string workspaceId,
149152
/// </code>
150153
/// </example>
151154
/// </summary>
152-
/// <param name="workspaceId">The workspace id to include in the query (<c>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</c>).</param>
153-
/// <param name="query">The Kusto query to execute.</param>
154-
/// <param name="timeRange">The timespan over which to query data. Logs will be filtered to include entries produced starting at <c>Now - timeSpan</c>. </param>
155+
/// <param name="workspaceId">The workspace ID to include in the query (<c>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</c>).</param>
156+
/// <param name="query">The Kusto query to fetch the logs.</param>
157+
/// <param name="timeRange">The time period for which the logs should be looked up.</param>
155158
/// <param name="options">The <see cref="LogsQueryOptions"/> to configure the query.</param>
156159
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to use.</param>
157160
/// <returns>Query results mapped to a type <typeparamref name="T"/>.</returns>
161+
/// <remarks>
162+
/// When the <paramref name="timeRange"/> argument is <see cref="QueryTimeRange.All"/> and the <paramref name="query"/> argument contains a time range filter, the underlying service uses the time range specified in <paramref name="query"/>.
163+
/// </remarks>
158164
public virtual async Task<Response<IReadOnlyList<T>>> QueryWorkspaceAsync<T>(string workspaceId, string query, QueryTimeRange timeRange, LogsQueryOptions options = null, CancellationToken cancellationToken = default)
159165
{
160166
Response<LogsQueryResult> response = await QueryWorkspaceAsync(workspaceId, query, timeRange, options, cancellationToken).ConfigureAwait(false);
@@ -165,12 +171,15 @@ public virtual async Task<Response<IReadOnlyList<T>>> QueryWorkspaceAsync<T>(str
165171
/// <summary>
166172
/// Executes the logs query.
167173
/// </summary>
168-
/// <param name="workspaceId">The workspace id to include in the query (<c>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</c>).</param>
169-
/// <param name="query">The Kusto query to execute.</param>
170-
/// <param name="timeRange">The timespan over which to query data. Logs will be filtered to include entries produced starting at <c>Now - timeSpan</c>. </param>
174+
/// <param name="workspaceId">The workspace ID to include in the query (<c>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</c>).</param>
175+
/// <param name="query">The Kusto query to fetch the logs.</param>
176+
/// <param name="timeRange">The time period for which the logs should be looked up.</param>
171177
/// <param name="options">The <see cref="LogsQueryOptions"/> to configure the query.</param>
172178
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to use.</param>
173179
/// <returns>The <see cref="LogsQueryResult"/> containing the query results.</returns>
180+
/// <remarks>
181+
/// When the <paramref name="timeRange"/> argument is <see cref="QueryTimeRange.All"/> and the <paramref name="query"/> argument contains a time range filter, the underlying service uses the time range specified in <paramref name="query"/>.
182+
/// </remarks>
174183
public virtual Response<LogsQueryResult> QueryWorkspace(string workspaceId, string query, QueryTimeRange timeRange, LogsQueryOptions options = null, CancellationToken cancellationToken = default)
175184
{
176185
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(LogsQueryClient)}.{nameof(QueryWorkspace)}");
@@ -189,12 +198,15 @@ public virtual Response<LogsQueryResult> QueryWorkspace(string workspaceId, stri
189198
/// <summary>
190199
/// Executes the logs query.
191200
/// </summary>
192-
/// <param name="workspaceId">The workspace id to include in the query (<c>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</c>).</param>
193-
/// <param name="query">The Kusto query to execute.</param>
194-
/// <param name="timeRange">The timespan over which to query data. Logs will be filtered to include entries produced starting at <c>Now - timeSpan</c>. </param>
201+
/// <param name="workspaceId">The workspace ID to include in the query (<c>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</c>).</param>
202+
/// <param name="query">The Kusto query to fetch the logs.</param>
203+
/// <param name="timeRange">The time period for which the logs should be looked up.</param>
195204
/// <param name="options">The <see cref="LogsQueryOptions"/> to configure the query.</param>
196205
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to use.</param>
197206
/// <returns>The <see cref="LogsQueryResult"/> with the query results.</returns>
207+
/// <remarks>
208+
/// When the <paramref name="timeRange"/> argument is <see cref="QueryTimeRange.All"/> and the <paramref name="query"/> argument contains a time range filter, the underlying service uses the time range specified in <paramref name="query"/>.
209+
/// </remarks>
198210
public virtual async Task<Response<LogsQueryResult>> QueryWorkspaceAsync(string workspaceId, string query, QueryTimeRange timeRange, LogsQueryOptions options = null, CancellationToken cancellationToken = default)
199211
{
200212
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(LogsQueryClient)}.{nameof(QueryWorkspace)}");
@@ -344,7 +356,7 @@ public virtual async Task<Response<LogsBatchQueryResultCollection>> QueryBatchAs
344356
/// </code>
345357
/// </example>
346358
/// </summary>
347-
/// <param name="resourceId"> The resourceId where the query should be executed. </param>
359+
/// <param name="resourceId"> The Azure resource ID where the query should be executed. </param>
348360
/// <param name="query"> The Kusto query to fetch the logs. </param>
349361
/// <param name="timeRange"> The time period for which the logs should be looked up. </param>
350362
/// <param name="options">The <see cref="LogsQueryOptions"/> to configure the query.</param>
@@ -383,12 +395,15 @@ public virtual Response<IReadOnlyList<T>> QueryResource<T>(ResourceIdentifier re
383395
/// </code>
384396
/// </example>
385397
/// </summary>
386-
/// <param name="resourceId"> The resourceId where the query should be executed. </param>
398+
/// <param name="resourceId"> The Azure resource ID where the query should be executed. </param>
387399
/// <param name="query"> The Kusto query to fetch the logs. </param>
388400
/// <param name="timeRange"> The time period for which the logs should be looked up. </param>
389401
/// <param name="options">The <see cref="LogsQueryOptions"/> to configure the query.</param>
390402
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to use.</param>
391403
/// <returns>The logs matching the query.</returns>
404+
/// <remarks>
405+
/// When the <paramref name="timeRange"/> argument is <see cref="QueryTimeRange.All"/> and the <paramref name="query"/> argument contains a time range filter, the underlying service uses the time range specified in <paramref name="query"/>.
406+
/// </remarks>
392407
public virtual async Task<Response<IReadOnlyList<T>>> QueryResourceAsync<T>(ResourceIdentifier resourceId, string query, QueryTimeRange timeRange, LogsQueryOptions options = null, CancellationToken cancellationToken = default)
393408
{
394409
Response<LogsQueryResult> response = await QueryResourceAsync(resourceId, query, timeRange, options, cancellationToken).ConfigureAwait(false);
@@ -422,12 +437,15 @@ public virtual async Task<Response<IReadOnlyList<T>>> QueryResourceAsync<T>(Reso
422437
/// </code>
423438
/// </example>
424439
/// </summary>
425-
/// <param name="resourceId"> The resourceId where the query should be executed. </param>
440+
/// <param name="resourceId"> The Azure resource ID where the query should be executed. </param>
426441
/// <param name="query"> The Kusto query to fetch the logs. </param>
427442
/// <param name="timeRange"> The time period for which the logs should be looked up. </param>
428443
/// <param name="options">The <see cref="LogsQueryOptions"/> to configure the query.</param>
429444
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to use.</param>
430445
/// <returns>The logs matching the query.</returns>
446+
/// <remarks>
447+
/// When the <paramref name="timeRange"/> argument is <see cref="QueryTimeRange.All"/> and the <paramref name="query"/> argument contains a time range filter, the underlying service uses the time range specified in <paramref name="query"/>.
448+
/// </remarks>
431449
public virtual Response<LogsQueryResult> QueryResource(ResourceIdentifier resourceId, string query, QueryTimeRange timeRange, LogsQueryOptions options = null, CancellationToken cancellationToken = default)
432450
{
433451
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(LogsQueryClient)}.{nameof(QueryResource)}");
@@ -471,12 +489,15 @@ public virtual Response<LogsQueryResult> QueryResource(ResourceIdentifier resour
471489
/// </code>
472490
/// </example>
473491
/// </summary>
474-
/// <param name="resourceId"> The resourceId where the query should be executed. </param>
492+
/// <param name="resourceId"> The Azure resource ID where the query should be executed. </param>
475493
/// <param name="query"> The Kusto query to fetch the logs. </param>
476494
/// <param name="timeRange"> The time period for which the logs should be looked up. </param>
477495
/// <param name="options">The <see cref="LogsQueryOptions"/> to configure the query.</param>
478496
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to use.</param>
479497
/// <returns>The logs matching the query.</returns>
498+
/// <remarks>
499+
/// When the <paramref name="timeRange"/> argument is <see cref="QueryTimeRange.All"/> and the <paramref name="query"/> argument contains a time range filter, the underlying service uses the time range specified in <paramref name="query"/>.
500+
/// </remarks>
480501
public virtual async Task<Response<LogsQueryResult>> QueryResourceAsync(ResourceIdentifier resourceId, string query, QueryTimeRange timeRange, LogsQueryOptions options = null, CancellationToken cancellationToken = default)
481502
{
482503
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(LogsQueryClient)}.{nameof(QueryResource)}");

sdk/monitor/Azure.Monitor.Query/src/LogsQueryOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class LogsQueryOptions
3838
/// </para>
3939
/// <para>
4040
/// Although this collection cannot be set, it can be modified.
41-
/// See <see href="https://docs.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/object-and-collection-initializers#object-initializers-with-collection-read-only-property-initialization">Object initializers with collection read-only property initialization</see>.
41+
/// See <see href="https://learn.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/object-and-collection-initializers#object-initializers-with-collection-read-only-property-initialization">Object initializers with collection read-only property initialization</see>.
4242
/// </para>
4343
/// </summary>
4444
public IList<string> AdditionalWorkspaces { get; } = new ChangeTrackingList<string>();

sdk/monitor/Azure.Monitor.Query/src/MetricsQueryClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public MetricsQueryClient(Uri endpoint, TokenCredential credential, MetricsQuery
7070
}
7171

7272
/// <summary>
73-
/// Initializes a new instance of <see cref="MetricsQueryClient"/> for mocking.
73+
/// Creates an instance of <see cref="MetricsQueryClient"/> to support <see href="https://aka.ms/azsdk/net/mocking">mocking</see>.
7474
/// </summary>
7575
protected MetricsQueryClient()
7676
{

sdk/monitor/Azure.Monitor.Query/src/Models/MonitorQueryModelFactory.cs

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@
1414
namespace Azure.Monitor.Query.Models
1515
{
1616
/// <summary>
17-
/// Model factory that enables mocking for the MetricsQueryResult class.
17+
/// Model factory that enables mocking for public model types.
1818
/// </summary>
1919
public static partial class MonitorQueryModelFactory
2020
{
21-
/// <summary> Enables the user to create an instance of a <see cref="MetricsQueryResult"/>. </summary>
21+
/// <summary>
22+
/// Creates an instance of <see cref="MetricsQueryResult"/> to support <see href="https://aka.ms/azsdk/net/mocking">mocking</see>.
23+
/// </summary>
2224
/// <param name="cost"> The integer value representing the relative cost of the query. </param>
2325
/// <param name="timespan"> The timespan for which the data was retrieved. Its value consists of two datetimes concatenated, separated by &apos;/&apos;. This may be adjusted in the future and returned back from what was originally requested. </param>
24-
/// <param name="granularity"> The interval (window size) for which the metric data was returned in. This may be adjusted in the future and returned back from what was originally requested. This is not present if a metadata request was made. </param>
26+
/// <param name="granularity"> The interval (window size) for which the metric data was returned in. This may be adjusted in the future and returned back from what was originally requested. This is not present if a metadata request was made. </param>
2527
/// <param name="namespace"> The namespace of the metrics being queried. </param>
2628
/// <param name="resourceRegion"> The region of the resource being queried for metrics. </param>
2729
/// <param name="metrics"> The value of the collection. </param>
@@ -31,7 +33,7 @@ public static MetricsQueryResult MetricsQueryResult(int? cost, string timespan,
3133
}
3234

3335
/// <summary>
34-
/// Enables the user to create an instance of a <see cref="MetricResult"/>.
36+
/// Creates an instance of <see cref="Models.MetricResult"/> to support <see href="https://aka.ms/azsdk/net/mocking">mocking</see>.
3537
/// </summary>
3638
/// <param name="id"> The metric ID. </param>
3739
/// <param name="resourceType"> The resource type of the metric resource. </param>
@@ -44,10 +46,10 @@ public static MetricResult MetricResult(string id, string resourceType, string n
4446
}
4547

4648
/// <summary>
47-
/// Enables the user to create an instance of a <see cref="MetricTimeSeriesElement"/>.
49+
/// Creates an instance of <see cref="Models.MetricTimeSeriesElement"/> to support <see href="https://aka.ms/azsdk/net/mocking">mocking</see>.
50+
/// </summary>
4851
/// <param name="metadataValues"> A dictionary comprised of metric metadata values. </param>
4952
/// <param name="values"> A list of <see cref="Models.MetricValue"/> elements. </param>
50-
/// </summary>
5153
public static MetricTimeSeriesElement MetricTimeSeriesElement(IReadOnlyDictionary<string, string> metadataValues, IEnumerable<MetricValue> values)
5254
{
5355
var metadataValueList = new List<MetadataValue>();
@@ -59,7 +61,9 @@ public static MetricTimeSeriesElement MetricTimeSeriesElement(IReadOnlyDictionar
5961
return new MetricTimeSeriesElement(metadataValueList, values.ToList());
6062
}
6163

62-
/// <summary> Initializes a new instance of MetricValue. </summary>
64+
/// <summary>
65+
/// Creates an instance of <see cref="Models.MetricValue"/> to support <see href="https://aka.ms/azsdk/net/mocking">mocking</see>.
66+
/// </summary>
6367
/// <param name="timeStamp"> The timestamp for the metric value in ISO 8601 format. </param>
6468
/// <param name="average"> The average value in the time range. </param>
6569
/// <param name="minimum"> The least value in the time range. </param>
@@ -71,8 +75,10 @@ public static MetricValue MetricValue(DateTimeOffset timeStamp = default, double
7175
return new MetricValue(timeStamp, average, minimum, maximum, total, count);
7276
}
7377

74-
/// <summary> Enables the user to create an instance of a <see cref="LogsQueryResult"/>. </summary>
75-
/// <param name="allTables"> The list of tables, columns and rows. </param>
78+
/// <summary>
79+
/// Creates an instance of <see cref="Models.LogsQueryResult"/> to support <see href="https://aka.ms/azsdk/net/mocking">mocking</see>.
80+
/// </summary>
81+
/// <param name="allTables"> The list of tables, columns, and rows. </param>
7682
/// <param name="statistics"> Any object. </param>
7783
/// <param name="visualization"> Any object. </param>
7884
/// <param name="error"> Any object. </param>
@@ -84,10 +90,11 @@ public static LogsQueryResult LogsQueryResult(IReadOnlyList<LogsTable> allTables
8490
return new LogsQueryResult(allTables.ToArray(), statisticsJson, visualizationJson, errorJson);
8591
}
8692

87-
/// <summary> Enables the user to create an instance of a <see cref="LogsTableRow"/>. </summary>
93+
/// <summary>
94+
/// Creates an instance of <see cref="Models.LogsTableRow"/> to support <see href="https://aka.ms/azsdk/net/mocking">mocking</see>.
95+
/// </summary>
8896
/// <param name="columns"> The list of columns. </param>
8997
/// <param name="values"> An object array representing the rows of the table. </param>
90-
/// <returns> A new <see cref="Models.LogsTableRow"/> instance for mocking. </returns>
9198
public static LogsTableRow LogsTableRow(IEnumerable<LogsTableColumn> columns, IEnumerable<object> values)
9299
{
93100
var columnsList = columns.ToArray();
@@ -96,7 +103,9 @@ public static LogsTableRow LogsTableRow(IEnumerable<LogsTableColumn> columns, IE
96103
return new LogsTableRow(columnMap, columnsList, row);
97104
}
98105

99-
/// <summary> Enables the user to create an instance of a <see cref="LogsTable"/>. </summary>
106+
/// <summary>
107+
/// Creates an instance of <see cref="Models.LogsTable"/> to support <see href="https://aka.ms/azsdk/net/mocking">mocking</see>.
108+
/// </summary>
100109
/// <param name="name"> The name of the table. </param>
101110
/// <param name="columns"> The list of columns. </param>
102111
/// <param name="rows"> The list of rows. </param>

0 commit comments

Comments
 (0)