Skip to content

Commit f868361

Browse files
committed
Update docs metadata
1 parent 7b08a6d commit f868361

File tree

2 files changed

+70
-16
lines changed

2 files changed

+70
-16
lines changed

api/overview/azure/latest/monitor.ingestion-readme.md

Lines changed: 50 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
title: Azure Monitor Ingestion client library for .NET
33
keywords: Azure, dotnet, SDK, API, Azure.Monitor.Ingestion, monitor
4-
ms.date: 04/03/2024
4+
ms.date: 08/05/2025
55
ms.topic: reference
66
ms.devlang: dotnet
77
ms.service: monitor
88
---
9-
# Azure Monitor Ingestion client library for .NET - version 1.1.2
9+
# Azure Monitor Ingestion client library for .NET - version 1.2.0
1010

1111

1212
The Azure Monitor Ingestion client library is used to send custom logs to [Azure Monitor][azure_monitor_overview].
@@ -15,10 +15,10 @@ This library allows you to send data from virtually any source to supported buil
1515

1616
**Resources:**
1717

18-
- [Source code](https://github.com/Azure/azure-sdk-for-net/blob/Azure.Monitor.Ingestion_1.1.2/sdk/monitor/Azure.Monitor.Ingestion/src)
18+
- [Source code](https://github.com/Azure/azure-sdk-for-net/blob/Azure.Monitor.Ingestion_1.2.0/sdk/monitor/Azure.Monitor.Ingestion/src)
1919
- [NuGet package](https://www.nuget.org/packages/Azure.Monitor.Ingestion)
2020
- [Service documentation][azure_monitor_overview]
21-
- [Change log](https://github.com/Azure/azure-sdk-for-net/blob/Azure.Monitor.Ingestion_1.1.2/sdk/monitor/Azure.Monitor.Ingestion/CHANGELOG.md)
21+
- [Change log](https://github.com/Azure/azure-sdk-for-net/blob/Azure.Monitor.Ingestion_1.2.0/sdk/monitor/Azure.Monitor.Ingestion/CHANGELOG.md)
2222

2323
## Getting started
2424

@@ -98,11 +98,11 @@ We guarantee that all client instance methods are thread-safe and independent of
9898
### Additional concepts
9999

100100
<!-- CLIENT COMMON BAR -->
101-
[Client options](https://github.com/Azure/azure-sdk-for-net/blob/Azure.Monitor.Ingestion_1.1.2/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) |
102-
[Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/Azure.Monitor.Ingestion_1.1.2/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) |
103-
[Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/Azure.Monitor.Ingestion_1.1.2/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) |
104-
[Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/Azure.Monitor.Ingestion_1.1.2/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) |
105-
[Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/Azure.Monitor.Ingestion_1.1.2/sdk/core/Azure.Core/samples/Diagnostics.md) |
101+
[Client options](https://github.com/Azure/azure-sdk-for-net/blob/Azure.Monitor.Ingestion_1.2.0/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) |
102+
[Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/Azure.Monitor.Ingestion_1.2.0/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) |
103+
[Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/Azure.Monitor.Ingestion_1.2.0/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) |
104+
[Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/Azure.Monitor.Ingestion_1.2.0/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) |
105+
[Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/Azure.Monitor.Ingestion_1.2.0/sdk/core/Azure.Core/samples/Diagnostics.md) |
106106
[Mocking](https://learn.microsoft.com/dotnet/azure/sdk/unit-testing-mocking) |
107107
[Client lifetime](https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/)
108108
<!-- CLIENT COMMON BAR -->
@@ -115,7 +115,7 @@ We guarantee that all client instance methods are thread-safe and independent of
115115
- [Upload custom logs as IEnumerable with EventHandler](#upload-custom-logs-as-ienumerable-with-eventhandler)
116116
- [Verify logs](#verify-logs)
117117

118-
You can familiarize yourself with different APIs using [samples](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.Ingestion_1.1.2/sdk/monitor/Azure.Monitor.Ingestion/samples).
118+
You can familiarize yourself with different APIs using [samples](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.Ingestion_1.2.0/sdk/monitor/Azure.Monitor.Ingestion/samples).
119119

120120
### Register the client with dependency injection
121121

@@ -176,6 +176,8 @@ Response response = await client.UploadAsync(
176176

177177
You can also upload logs using either the `LogsIngestionClient.Upload` or the `LogsIngestionClient.UploadAsync` method in which logs are passed in a generic `IEnumerable` type along with an optional `LogsUploadOptions` parameter. The `LogsUploadOptions` parameter includes a serializer, concurrency, and an EventHandler.
178178

179+
When uploading custom logs as an `IEnumerable` of an application model type, the `LogsIngestionClient` will perform serialization on your behalf, using either the [ObjectSerializer](https://learn.microsoft.com/dotnet/api/azure.core.serialization.objectserializer?view=azure-dotnet) registered with your `LogsUploadOptions` or the serializer used by [BinaryData.FromObjectAsJson](https://learn.microsoft.com/dotnet/api/system.binarydata.fromobjectasjson). Both approaches use a serialization path that is not compatible with [ahead-of-time compilation (AOT)](https://learn.microsoft.com/dotnet/core/deploying/native-aot).
180+
179181
```C# Snippet:UploadLogDataIEnumerableAsync
180182
var endpoint = new Uri("<data_collection_endpoint_uri>");
181183
var ruleId = "<data_collection_rule_id>";
@@ -202,6 +204,42 @@ for (int i = 0; i < 100; i++)
202204
Response response = await client.UploadAsync(ruleId, streamName, entries).ConfigureAwait(false);
203205
```
204206

207+
To upload custom logs in an AOT environment, your application must take ownership of serialization and use the `LogsIngestionClient.Upload` or `LogsIngestionClient.UploadAsync` overload that accepts an `IEnumerable<BinaryData>`.
208+
209+
For example, if you have the following custom type and AOT serialization context:
210+
```C# Snippet:IngestionAotSerializationTypes
211+
public record Person(string Name, string Department, int EmployeeNumber)
212+
{
213+
}
214+
215+
[JsonSerializable(typeof(Person))]
216+
public partial class ExampleDeserializationContext : JsonSerializerContext
217+
{
218+
}
219+
```
220+
221+
The Ingestion upload is identical, other than serializing prior to the call:
222+
```C# Snippet:UploadLogDataIEnumerableAsyncAot
223+
var endpoint = new Uri("<data_collection_endpoint_uri>");
224+
var ruleId = "<data_collection_rule_id>";
225+
var streamName = "<stream_name>";
226+
227+
var credential = new DefaultAzureCredential();
228+
LogsIngestionClient client = new(endpoint, credential);
229+
230+
DateTimeOffset currentTime = DateTimeOffset.UtcNow;
231+
232+
var entries = new List<BinaryData>();
233+
for (int i = 0; i < 100; i++)
234+
{
235+
entries.Add(BinaryData.FromBytes(
236+
JsonSerializer.SerializeToUtf8Bytes(new Person($"Person{i}", "Department{i}", i))));
237+
}
238+
239+
// Upload our logs
240+
Response response = await client.UploadAsync(ruleId, streamName, entries).ConfigureAwait(false);
241+
```
242+
205243
### Upload custom logs as IEnumerable with EventHandler
206244

207245
You can upload logs using either the `LogsIngestionClient.Upload` or the `LogsIngestionClient.UploadAsync` method. In these two methods, logs are passed in a generic `IEnumerable` type. Additionally, there's an `LogsUploadOptions`-typed parameter in which a serializer, concurrency, and EventHandler can be set. The default serializer is set to `System.Text.Json`, but you can pass in the serializer you would like used. The `MaxConcurrency` property sets the number of threads that will be used in the `UploadAsync` method. The default value is 5, and this parameter is unused in the `Upload` method. The EventHandler is used for error handling. It gives the user the option to abort the upload if a batch fails and access the failed logs and corresponding exception. Without the EventHandler, if an upload fails, an `AggregateException` will be thrown.
@@ -249,7 +287,7 @@ Task Options_UploadFailed(LogsUploadFailedEventArgs e)
249287

250288
### Verify logs
251289

252-
You can verify that your data has been uploaded correctly by using the [Azure Monitor Query](https://github.com/Azure/azure-sdk-for-net/blob/Azure.Monitor.Ingestion_1.1.2/sdk/monitor/Azure.Monitor.Query/README.md#install-the-package) library. Run the [Upload custom logs](#upload-custom-logs) sample first before verifying the logs.
290+
You can verify that your data has been uploaded correctly by using the [Azure Monitor Query](https://github.com/Azure/azure-sdk-for-net/blob/Azure.Monitor.Ingestion_1.2.0/sdk/monitor/Azure.Monitor.Query/README.md#install-the-package) library. Run the [Upload custom logs](#upload-custom-logs) sample first before verifying the logs.
253291

254292
```C# Snippet:VerifyLogsAsync
255293
var workspaceId = "<log_analytics_workspace_id>";
@@ -274,7 +312,7 @@ Console.WriteLine("Table entry count: " +
274312

275313
## Troubleshooting
276314

277-
For details on diagnosing various failure scenarios, see our [troubleshooting guide](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.Ingestion_1.1.2/sdk/monitor/Azure.Monitor.Ingestion/TROUBLESHOOTING.md).
315+
For details on diagnosing various failure scenarios, see our [troubleshooting guide](https://github.com/Azure/azure-sdk-for-net/tree/Azure.Monitor.Ingestion_1.2.0/sdk/monitor/Azure.Monitor.Ingestion/TROUBLESHOOTING.md).
278316

279317
## Next steps
280318

@@ -294,5 +332,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope
294332
[data_collection_rule]: https://learn.microsoft.com/azure/azure-monitor/essentials/data-collection-rule-overview
295333
[logging]: https://learn.microsoft.com/dotnet/azure/sdk/logging
296334

297-
298-

metadata/latest/Azure.Monitor.Ingestion.json

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"Name": "Azure.Monitor.Ingestion",
3-
"Version": "1.1.2",
3+
"Version": "1.2.0",
44
"DevVersion": null,
55
"DirectoryPath": "sdk/monitor/Azure.Monitor.Ingestion",
66
"ServiceDirectory": "monitor",
@@ -10,7 +10,25 @@
1010
"SdkType": "client",
1111
"IsNewSdk": true,
1212
"ArtifactName": "Azure.Monitor.Ingestion",
13-
"ReleaseStatus": "2024-04-03",
13+
"ReleaseStatus": "2025-08-05",
14+
"IncludedForValidation": false,
15+
"AdditionalValidationPackages": null,
16+
"ArtifactDetails": {
17+
"safeName": "AzureMonitorIngestion",
18+
"triggeringPaths": [
19+
"/sdk/monitor/ci.yml"
20+
],
21+
"name": "Azure.Monitor.Ingestion"
22+
},
23+
"CIParameters": {
24+
"CheckAOTCompat": true,
25+
"CIMatrixConfigs": [],
26+
"BuildSnippets": true,
27+
"AOTTestInputs": {
28+
"ExpectedWarningsFilepath": "None",
29+
"ArtifactName": "Azure.Monitor.Ingestion"
30+
}
31+
},
1432
"Namespaces": [
1533
"Azure.Monitor.Ingestion",
1634
"Microsoft.Extensions.Azure"

0 commit comments

Comments
 (0)