Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Azure.Monitor.Ingestion] Add Concurrency Upload method #31074

Merged
merged 22 commits into from
Sep 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions sdk/monitor/Azure.Monitor.Ingestion/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
# Release History

## 1.0.0-beta.3 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes
## 1.0.0-beta.3 (2022-09-23)
## Features Added
- Added Concurrency with Multi-Threading to Upload methods
- Added Model `UploadLogsResult` representing the request to upload logs to Azure Monitor

## 1.0.0-beta.2 (2022-08-26)
## Features Added
Expand Down
4 changes: 2 additions & 2 deletions sdk/monitor/Azure.Monitor.Ingestion/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,15 @@ TokenCredential credential = new DefaultAzureCredential();

LogsQueryClient logsQueryClient = new(credential);
LogsBatchQuery batch = new();
string query = tableName + " | count;";
string query = tableName + " | Count;";
string countQueryId = batch.AddWorkspaceQuery(
workspaceId,
query,
new QueryTimeRange(TimeSpan.FromDays(1)));

Response<LogsBatchQueryResultCollection> queryResponse = logsQueryClient.QueryBatch(batch);

Console.WriteLine("Table entry count: " + queryResponse.Value.GetResult<int>(countQueryId).Single());
Console.WriteLine("Table entry Count: " + queryResponse.Value.GetResult<int>(countQueryId).Single());
```

## Troubleshooting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ protected LogsIngestionClient() { }
public LogsIngestionClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { }
public LogsIngestionClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.Monitor.Ingestion.LogsIngestionClientOptions options) { }
public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } }
public virtual Azure.Response Upload(string ruleId, string streamName, Azure.Core.RequestContent content, string contentEncoding = "gzip", Azure.RequestContext context = null) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> UploadAsync(string ruleId, string streamName, Azure.Core.RequestContent content, string contentEncoding = "gzip", Azure.RequestContext context = null) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Monitor.Ingestion.UploadLogsResult>> UploadAsync<T>(string ruleId, string streamName, System.Collections.Generic.IEnumerable<T> logEntries, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Monitor.Ingestion.UploadLogsResult> Upload<T>(string ruleId, string streamName, System.Collections.Generic.IEnumerable<T> logEntries, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Monitor.Ingestion.UploadLogsResult>> UploadAsync<T>(string ruleId, string streamName, System.Collections.Generic.IEnumerable<T> logs, Azure.Monitor.Ingestion.UploadLogsOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Monitor.Ingestion.UploadLogsResult> Upload<T>(string ruleId, string streamName, System.Collections.Generic.IEnumerable<T> logs, Azure.Monitor.Ingestion.UploadLogsOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
}
public partial class LogsIngestionClientOptions : Azure.Core.ClientOptions
{
Expand All @@ -23,7 +21,13 @@ public partial class UploadLogsError
{
internal UploadLogsError() { }
public Azure.ResponseError Error { get { throw null; } }
public System.Collections.Generic.IEnumerable<object> FailedLogs { get { throw null; } }
public System.Collections.Generic.IReadOnlyList<System.BinaryData> FailedLogs { get { throw null; } }
}
public partial class UploadLogsOptions
{
public UploadLogsOptions() { }
public int MaxConcurrency { get { throw null; } set { } }
public Azure.Core.Serialization.ObjectSerializer Serializer { get { throw null; } set { } }
}
public partial class UploadLogsResult
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ protected LogsIngestionClient() { }
public LogsIngestionClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { }
public LogsIngestionClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.Monitor.Ingestion.LogsIngestionClientOptions options) { }
public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } }
public virtual Azure.Response Upload(string ruleId, string streamName, Azure.Core.RequestContent content, string contentEncoding = "gzip", Azure.RequestContext context = null) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> UploadAsync(string ruleId, string streamName, Azure.Core.RequestContent content, string contentEncoding = "gzip", Azure.RequestContext context = null) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Monitor.Ingestion.UploadLogsResult>> UploadAsync<T>(string ruleId, string streamName, System.Collections.Generic.IEnumerable<T> logEntries, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Monitor.Ingestion.UploadLogsResult> Upload<T>(string ruleId, string streamName, System.Collections.Generic.IEnumerable<T> logEntries, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Monitor.Ingestion.UploadLogsResult>> UploadAsync<T>(string ruleId, string streamName, System.Collections.Generic.IEnumerable<T> logs, Azure.Monitor.Ingestion.UploadLogsOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Monitor.Ingestion.UploadLogsResult> Upload<T>(string ruleId, string streamName, System.Collections.Generic.IEnumerable<T> logs, Azure.Monitor.Ingestion.UploadLogsOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
}
public partial class LogsIngestionClientOptions : Azure.Core.ClientOptions
{
Expand All @@ -23,7 +21,13 @@ public partial class UploadLogsError
{
internal UploadLogsError() { }
public Azure.ResponseError Error { get { throw null; } }
public System.Collections.Generic.IEnumerable<object> FailedLogs { get { throw null; } }
public System.Collections.Generic.IReadOnlyList<System.BinaryData> FailedLogs { get { throw null; } }
}
public partial class UploadLogsOptions
{
public UploadLogsOptions() { }
public int MaxConcurrency { get { throw null; } set { } }
public Azure.Core.Serialization.ObjectSerializer Serializer { get { throw null; } set { } }
}
public partial class UploadLogsResult
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ protected LogsIngestionClient() { }
public LogsIngestionClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { }
public LogsIngestionClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.Monitor.Ingestion.LogsIngestionClientOptions options) { }
public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } }
public virtual Azure.Response Upload(string ruleId, string streamName, Azure.Core.RequestContent content, string contentEncoding = "gzip", Azure.RequestContext context = null) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response> UploadAsync(string ruleId, string streamName, Azure.Core.RequestContent content, string contentEncoding = "gzip", Azure.RequestContext context = null) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Monitor.Ingestion.UploadLogsResult>> UploadAsync<T>(string ruleId, string streamName, System.Collections.Generic.IEnumerable<T> logEntries, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Monitor.Ingestion.UploadLogsResult> Upload<T>(string ruleId, string streamName, System.Collections.Generic.IEnumerable<T> logEntries, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Monitor.Ingestion.UploadLogsResult>> UploadAsync<T>(string ruleId, string streamName, System.Collections.Generic.IEnumerable<T> logs, Azure.Monitor.Ingestion.UploadLogsOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Monitor.Ingestion.UploadLogsResult> Upload<T>(string ruleId, string streamName, System.Collections.Generic.IEnumerable<T> logs, Azure.Monitor.Ingestion.UploadLogsOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
}
public partial class LogsIngestionClientOptions : Azure.Core.ClientOptions
{
Expand All @@ -23,7 +21,13 @@ public partial class UploadLogsError
{
internal UploadLogsError() { }
public Azure.ResponseError Error { get { throw null; } }
public System.Collections.Generic.IEnumerable<object> FailedLogs { get { throw null; } }
public System.Collections.Generic.IReadOnlyList<System.BinaryData> FailedLogs { get { throw null; } }
}
public partial class UploadLogsOptions
{
public UploadLogsOptions() { }
public int MaxConcurrency { get { throw null; } set { } }
public Azure.Core.Serialization.ObjectSerializer Serializer { get { throw null; } set { } }
}
public partial class UploadLogsResult
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ TokenCredential credential = new DefaultAzureCredential();

LogsQueryClient logsQueryClient = new(credential);
LogsBatchQuery batch = new();
string query = tableName + " | count;";
string query = tableName + " | Count;";
string countQueryId = batch.AddWorkspaceQuery(
workspaceId,
query,
new QueryTimeRange(TimeSpan.FromDays(1)));

Response<LogsBatchQueryResultCollection> queryResponse = logsQueryClient.QueryBatch(batch);

Console.WriteLine("Table entry count: " + queryResponse.Value.GetResult<int>(countQueryId).Single());
Console.WriteLine("Table entry Count: " + queryResponse.Value.GetResult<int>(countQueryId).Single());
```

To see the full example source files, see [Query](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/monitor/Azure.Monitor.Ingestion/tests/Samples/LogDataAndQuery.cs).
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ TokenCredential credential = new DefaultAzureCredential();

LogsQueryClient logsQueryClient = new(credential);
LogsBatchQuery batch = new();
string query = tableName + " | count;";
string query = tableName + " | Count;";
string countQueryId = batch.AddWorkspaceQuery(
workspaceId,
query,
new QueryTimeRange(TimeSpan.FromDays(1)));

Response<LogsBatchQueryResultCollection> queryResponse = await logsQueryClient.QueryBatchAsync(batch).ConfigureAwait(false);

Console.WriteLine("Table entry count: " + queryResponse.Value.GetResult<int>(countQueryId).Single());
Console.WriteLine("Table entry Count: " + queryResponse.Value.GetResult<int>(countQueryId).Single());
```

To see the full example source files, see [QueryAsync](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/monitor/Azure.Monitor.Ingestion/tests/Samples/LogDataAndQueryAsync.cs).

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading