|
7 | 7 | using System.Diagnostics; |
8 | 8 | using Azure.Core; |
9 | 9 | using Azure.Monitor.OpenTelemetry.Exporter.Internals; |
| 10 | +using Azure.Monitor.OpenTelemetry.Exporter.Internals.Diagnostics; |
10 | 11 | using Microsoft.Extensions.DependencyInjection; |
11 | 12 | using Microsoft.Extensions.Options; |
12 | 13 | using OpenTelemetry; |
@@ -73,6 +74,11 @@ public static TracerProviderBuilder AddAzureMonitorTraceExporter( |
73 | 74 | configure(exporterOptions); |
74 | 75 | } |
75 | 76 |
|
| 77 | + if (exporterOptions.EnableLiveMetrics == true) |
| 78 | + { |
| 79 | + AzureMonitorExporterEventSource.Log.LiveMetricsNotSupported(methodName: nameof(AddAzureMonitorTraceExporter)); |
| 80 | + } |
| 81 | + |
76 | 82 | builder.SetSampler(new ApplicationInsightsSampler(exporterOptions.SamplingRatio)); |
77 | 83 |
|
78 | 84 | if (credential != null) |
@@ -138,6 +144,11 @@ public static MeterProviderBuilder AddAzureMonitorMetricExporter( |
138 | 144 | configure(exporterOptions); |
139 | 145 | } |
140 | 146 |
|
| 147 | + if (exporterOptions.EnableLiveMetrics == true) |
| 148 | + { |
| 149 | + AzureMonitorExporterEventSource.Log.LiveMetricsNotSupported(methodName: nameof(AddAzureMonitorMetricExporter)); |
| 150 | + } |
| 151 | + |
141 | 152 | if (credential != null) |
142 | 153 | { |
143 | 154 | // Credential can be set by either AzureMonitorExporterOptions or Extension Method Parameter. |
@@ -176,6 +187,11 @@ public static OpenTelemetryLoggerOptions AddAzureMonitorLogExporter( |
176 | 187 | var options = new AzureMonitorExporterOptions(); |
177 | 188 | configure?.Invoke(options); |
178 | 189 |
|
| 190 | + if (options.EnableLiveMetrics == true) |
| 191 | + { |
| 192 | + AzureMonitorExporterEventSource.Log.LiveMetricsNotSupported(methodName: nameof(AddAzureMonitorLogExporter)); |
| 193 | + } |
| 194 | + |
179 | 195 | if (credential != null) |
180 | 196 | { |
181 | 197 | // Credential can be set by either AzureMonitorExporterOptions or Extension Method Parameter. |
@@ -236,6 +252,11 @@ public static LoggerProviderBuilder AddAzureMonitorLogExporter( |
236 | 252 | exporterOptions = sp.GetRequiredService<IOptionsMonitor<AzureMonitorExporterOptions>>().Get(finalOptionsName); |
237 | 253 | } |
238 | 254 |
|
| 255 | + if (exporterOptions.EnableLiveMetrics == true) |
| 256 | + { |
| 257 | + AzureMonitorExporterEventSource.Log.LiveMetricsNotSupported(methodName: nameof(AddAzureMonitorLogExporter)); |
| 258 | + } |
| 259 | + |
239 | 260 | if (credential != null) |
240 | 261 | { |
241 | 262 | // Credential can be set by either AzureMonitorExporterOptions or Extension Method Parameter. |
|
0 commit comments