Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ protected override void Dispose(bool disposing) { }
}
public partial class AzureMonitorOpenTelemetryExporterContext : System.ClientModel.Primitives.ModelReaderWriterContext
{
public AzureMonitorOpenTelemetryExporterContext() { }
public Azure.Monitor.OpenTelemetry.Exporter.AzureMonitorOpenTelemetryExporterContext Default { get { throw null; } }
internal AzureMonitorOpenTelemetryExporterContext() { }
public static Azure.Monitor.OpenTelemetry.Exporter.AzureMonitorOpenTelemetryExporterContext Default { get { throw null; } }
Comment thread
rajkumar-rangaraj marked this conversation as resolved.
protected override bool TryGetTypeBuilderCore(System.Type type, out System.ClientModel.Primitives.ModelReaderWriterTypeBuilder builder) { throw null; }
}
public sealed partial class AzureMonitorTraceExporter : OpenTelemetry.BaseExporter<System.Diagnostics.Activity>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ protected override void Dispose(bool disposing) { }
}
public partial class AzureMonitorOpenTelemetryExporterContext : System.ClientModel.Primitives.ModelReaderWriterContext
{
public AzureMonitorOpenTelemetryExporterContext() { }
public Azure.Monitor.OpenTelemetry.Exporter.AzureMonitorOpenTelemetryExporterContext Default { get { throw null; } }
internal AzureMonitorOpenTelemetryExporterContext() { }
public static Azure.Monitor.OpenTelemetry.Exporter.AzureMonitorOpenTelemetryExporterContext Default { get { throw null; } }
protected override bool TryGetTypeBuilderCore(System.Type type, out System.ClientModel.Primitives.ModelReaderWriterTypeBuilder builder) { throw null; }
}
public sealed partial class AzureMonitorTraceExporter : OpenTelemetry.BaseExporter<System.Diagnostics.Activity>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ protected override void Dispose(bool disposing) { }
}
public partial class AzureMonitorOpenTelemetryExporterContext : System.ClientModel.Primitives.ModelReaderWriterContext
{
public AzureMonitorOpenTelemetryExporterContext() { }
public Azure.Monitor.OpenTelemetry.Exporter.AzureMonitorOpenTelemetryExporterContext Default { get { throw null; } }
internal AzureMonitorOpenTelemetryExporterContext() { }
public static Azure.Monitor.OpenTelemetry.Exporter.AzureMonitorOpenTelemetryExporterContext Default { get { throw null; } }
protected override bool TryGetTypeBuilderCore(System.Type type, out System.ClientModel.Primitives.ModelReaderWriterTypeBuilder builder) { throw null; }
}
public sealed partial class AzureMonitorTraceExporter : OpenTelemetry.BaseExporter<System.Diagnostics.Activity>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"apiVersions": {
"AzureMonitorExporter": "v2.1"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# AzureMonitorOpenTelemetryExporterContext was a source-generated infrastructure class
# marked [EditorBrowsable(EditorBrowsableState.Never)], never intended for direct use.
# The source generator now emits a private constructor (singleton via Default property)
# which is a safe change since no consumers should be instantiating this class.
CannotSealType : Type 'Azure.Monitor.OpenTelemetry.Exporter.AzureMonitorOpenTelemetryExporterContext' is effectively (has a private constructor) sealed in the implementation but not sealed in the contract.
MembersMustExist : Member 'public void Azure.Monitor.OpenTelemetry.Exporter.AzureMonitorOpenTelemetryExporterContext..ctor()' does not exist in the implementation but it does exist in the contract.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
IConfiguration. -->
<NoWarn>$(NoWarn);SYSLIB1100;SYSLIB1101</NoWarn>
<DefineConstants>$(DefineConstants);AZURE_MONITOR_EXPORTER;</DefineConstants>
<IncludeAutorestDependency>true</IncludeAutorestDependency>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,19 @@ namespace Azure.Monitor.OpenTelemetry.Exporter
{
internal partial class ApplicationInsightsRestClient
{
private RawRequestUriBuilder _rawRequestUriBuilder;
private RawRequestUriBuilder? _rawRequestUriBuilder;

/// <summary> Initializes a new instance of ApplicationInsightsRestClient with pre-built pipeline. </summary>
/// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param>
/// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param>
/// <param name="host"> Breeze endpoint. </param>
internal ApplicationInsightsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string host)
{
ClientDiagnostics = clientDiagnostics;
Pipeline = pipeline;
_endpoint = new Uri(host);
_apiVersion = "v2.1";
}

/// <summary>
/// This operation sends a sequence of telemetry events that will be monitored by Azure Monitor.
Expand All @@ -37,7 +49,7 @@ internal async Task<HttpMessage> InternalTrackAsync(IEnumerable<TelemetryItem> b
try
{
RedirectPolicy.SetAllowAutoRedirect(message, false);
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
await Pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
}
catch (Exception ex)
{
Expand Down Expand Up @@ -65,7 +77,7 @@ internal async Task<HttpMessage> InternalTrackAsync(ReadOnlyMemory<byte> body, C
try
{
RedirectPolicy.SetAllowAutoRedirect(message, false);
await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
await Pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
}
catch (Exception ex)
{
Expand Down Expand Up @@ -108,16 +120,18 @@ internal HttpMessage CreateTrackRequest(ReadOnlyMemory<byte> body)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private HttpMessage CreateRequest(RequestContent requestContent)
{
var message = _pipeline.CreateMessage();
var message = Pipeline.CreateMessage();
var request = message.Request;
request.Method = RequestMethod.Post;
request.Uri = LazyInitializer.EnsureInitialized(ref _rawRequestUriBuilder, () =>
{
var uri = new RawRequestUriBuilder();
uri.AppendRaw(_host, false);
uri.AppendRaw("/v2.1/track", false);
uri.Reset(_endpoint);
uri.AppendPath("/", false);
uri.AppendPath(_apiVersion, true);
uri.AppendPath("/track", false);
return uri;
Comment thread
rajkumar-rangaraj marked this conversation as resolved.
});
})!;
request.Headers.Add("Content-Type", "application/json");
request.Headers.Add("Accept", "application/json");
request.Content = requestContent;
Expand Down

This file was deleted.

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

Loading
Loading