Skip to content

Commit 4c33b3a

Browse files
author
Timothy Mothra
authored
Azure Monitor Exporter: Service Version (Azure#18676)
* adding service version * cleanup * addressing code review comments * update public api
1 parent aaa5760 commit 4c33b3a

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed

sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/api/Azure.Monitor.OpenTelemetry.Exporter.netstandard2.0.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@ public static partial class AzureMonitorExporterHelperExtensions
66
}
77
public partial class AzureMonitorExporterOptions : Azure.Core.ClientOptions
88
{
9-
public AzureMonitorExporterOptions() { }
9+
public AzureMonitorExporterOptions(Azure.Monitor.OpenTelemetry.Exporter.AzureMonitorExporterOptions.ServiceVersion version = Azure.Monitor.OpenTelemetry.Exporter.AzureMonitorExporterOptions.ServiceVersion.V2020_09_15_Preview) { }
1010
public string ConnectionString { get { throw null; } set { } }
11+
public Azure.Monitor.OpenTelemetry.Exporter.AzureMonitorExporterOptions.ServiceVersion Version { get { throw null; } set { } }
12+
public enum ServiceVersion
13+
{
14+
V2020_09_15_Preview = 1,
15+
}
1116
}
1217
public partial class AzureMonitorTraceExporter : OpenTelemetry.BaseExporter<System.Diagnostics.Activity>
1318
{
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,51 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4+
using System.Diagnostics.CodeAnalysis;
5+
46
using Azure.Core;
57

68
namespace Azure.Monitor.OpenTelemetry.Exporter
79
{
10+
/// <summary>
11+
/// Options that allow users to configure the Azure Monitor Exporter.
12+
/// </summary>
813
public class AzureMonitorExporterOptions : ClientOptions
914
{
15+
/// <summary>
16+
/// The latest service version supported by this library.
17+
/// </summary>
18+
internal const ServiceVersion LatestVersion = ServiceVersion.V2020_09_15_Preview;
19+
20+
/// <summary>
21+
/// The Connection String provides users with a single configuration setting to identify the Azure Monitor resource and endpoint.
22+
/// </summary>
23+
/// <remarks>
24+
/// (https://docs.microsoft.com/azure/azure-monitor/app/sdk-connection-string).
25+
/// </remarks>
1026
public string ConnectionString { get; set; }
27+
28+
/// <summary>
29+
/// The <see cref="ServiceVersion"/> of the Azure Monitor ingestion API.
30+
/// </summary>
31+
public ServiceVersion Version { get; set; } = ServiceVersion.V2020_09_15_Preview;
32+
33+
/// <summary>
34+
/// Initializes a new instance of the <see cref="AzureMonitorExporterOptions"/>.
35+
/// </summary>
36+
/// <param name="version">The <see cref="ServiceVersion"/> of the Azure Monitor ingestion API.</param>
37+
public AzureMonitorExporterOptions(ServiceVersion version = LatestVersion)
38+
{
39+
this.Version = version;
40+
}
41+
42+
[SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "This naming format is defined in the Azure SDK Design Guidelines.")]
43+
public enum ServiceVersion
44+
{
45+
/// <summary>
46+
/// (https://github.com/Azure/azure-rest-api-specs/blob/master/specification/applicationinsights/data-plane/Monitor.Exporters/preview/2020-09-15_Preview/swagger.json).
47+
/// </summary>
48+
V2020_09_15_Preview = 1,
49+
}
1150
}
1251
}

0 commit comments

Comments
 (0)