diff --git a/src/OpenTelemetry.Exporter.OneCollector/.publicApi/net462/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Exporter.OneCollector/.publicApi/net462/PublicAPI.Unshipped.txt index baf438cdc1..427f6f8f5f 100644 --- a/src/OpenTelemetry.Exporter.OneCollector/.publicApi/net462/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry.Exporter.OneCollector/.publicApi/net462/PublicAPI.Unshipped.txt @@ -10,6 +10,9 @@ OpenTelemetry.Exporter.OneCollector.OneCollectorExporterPayloadTransmittedCallba OpenTelemetry.Exporter.OneCollector.OneCollectorExporterPayloadTransmittedCallbackArguments.OneCollectorExporterPayloadTransmittedCallbackArguments() -> void OpenTelemetry.Exporter.OneCollector.OneCollectorExporterPayloadTransmittedCallbackArguments.PayloadSizeInBytes.get -> long OpenTelemetry.Exporter.OneCollector.OneCollectorExporterPayloadTransmittedCallbackArguments.TransportEndpoint.get -> System.Uri! +OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType +OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType.Ignore = 0 -> OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType +OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType.IncludeAsString = 1 -> OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType OpenTelemetry.Exporter.OneCollector.OneCollectorExporterTransportOptions OpenTelemetry.Exporter.OneCollector.OneCollectorExporterTransportOptions.Endpoint.get -> System.Uri! OpenTelemetry.Exporter.OneCollector.OneCollectorExporterTransportOptions.Endpoint.set -> void @@ -21,9 +24,15 @@ OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterOptions OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterOptions.DefaultEventName.get -> string! OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterOptions.DefaultEventName.set -> void OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterOptions.OneCollectorLogExporterOptions() -> void +OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterOptions.SerializationOptions.get -> OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterSerializationOptions! +OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterSerializationOptions +OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterSerializationOptions.ExceptionStackTraceHandling.get -> OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType +OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterSerializationOptions.ExceptionStackTraceHandling.set -> void +OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterSerializationOptions.OneCollectorLogExporterSerializationOptions() -> void OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.ConfigureBatchOptions(System.Action!>! configure) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.ConfigureExporter(System.Action!>! configure) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! +OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.ConfigureSerializationOptions(System.Action! configure) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.ConfigureTransportOptions(System.Action! configure) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.SetConnectionString(string! connectionString) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.SetDefaultEventName(string! defaultEventName) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! diff --git a/src/OpenTelemetry.Exporter.OneCollector/.publicApi/net6.0/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Exporter.OneCollector/.publicApi/net6.0/PublicAPI.Unshipped.txt index baf438cdc1..427f6f8f5f 100644 --- a/src/OpenTelemetry.Exporter.OneCollector/.publicApi/net6.0/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry.Exporter.OneCollector/.publicApi/net6.0/PublicAPI.Unshipped.txt @@ -10,6 +10,9 @@ OpenTelemetry.Exporter.OneCollector.OneCollectorExporterPayloadTransmittedCallba OpenTelemetry.Exporter.OneCollector.OneCollectorExporterPayloadTransmittedCallbackArguments.OneCollectorExporterPayloadTransmittedCallbackArguments() -> void OpenTelemetry.Exporter.OneCollector.OneCollectorExporterPayloadTransmittedCallbackArguments.PayloadSizeInBytes.get -> long OpenTelemetry.Exporter.OneCollector.OneCollectorExporterPayloadTransmittedCallbackArguments.TransportEndpoint.get -> System.Uri! +OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType +OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType.Ignore = 0 -> OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType +OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType.IncludeAsString = 1 -> OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType OpenTelemetry.Exporter.OneCollector.OneCollectorExporterTransportOptions OpenTelemetry.Exporter.OneCollector.OneCollectorExporterTransportOptions.Endpoint.get -> System.Uri! OpenTelemetry.Exporter.OneCollector.OneCollectorExporterTransportOptions.Endpoint.set -> void @@ -21,9 +24,15 @@ OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterOptions OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterOptions.DefaultEventName.get -> string! OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterOptions.DefaultEventName.set -> void OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterOptions.OneCollectorLogExporterOptions() -> void +OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterOptions.SerializationOptions.get -> OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterSerializationOptions! +OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterSerializationOptions +OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterSerializationOptions.ExceptionStackTraceHandling.get -> OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType +OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterSerializationOptions.ExceptionStackTraceHandling.set -> void +OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterSerializationOptions.OneCollectorLogExporterSerializationOptions() -> void OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.ConfigureBatchOptions(System.Action!>! configure) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.ConfigureExporter(System.Action!>! configure) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! +OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.ConfigureSerializationOptions(System.Action! configure) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.ConfigureTransportOptions(System.Action! configure) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.SetConnectionString(string! connectionString) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.SetDefaultEventName(string! defaultEventName) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! diff --git a/src/OpenTelemetry.Exporter.OneCollector/.publicApi/net7.0/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Exporter.OneCollector/.publicApi/net7.0/PublicAPI.Unshipped.txt index baf438cdc1..427f6f8f5f 100644 --- a/src/OpenTelemetry.Exporter.OneCollector/.publicApi/net7.0/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry.Exporter.OneCollector/.publicApi/net7.0/PublicAPI.Unshipped.txt @@ -10,6 +10,9 @@ OpenTelemetry.Exporter.OneCollector.OneCollectorExporterPayloadTransmittedCallba OpenTelemetry.Exporter.OneCollector.OneCollectorExporterPayloadTransmittedCallbackArguments.OneCollectorExporterPayloadTransmittedCallbackArguments() -> void OpenTelemetry.Exporter.OneCollector.OneCollectorExporterPayloadTransmittedCallbackArguments.PayloadSizeInBytes.get -> long OpenTelemetry.Exporter.OneCollector.OneCollectorExporterPayloadTransmittedCallbackArguments.TransportEndpoint.get -> System.Uri! +OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType +OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType.Ignore = 0 -> OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType +OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType.IncludeAsString = 1 -> OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType OpenTelemetry.Exporter.OneCollector.OneCollectorExporterTransportOptions OpenTelemetry.Exporter.OneCollector.OneCollectorExporterTransportOptions.Endpoint.get -> System.Uri! OpenTelemetry.Exporter.OneCollector.OneCollectorExporterTransportOptions.Endpoint.set -> void @@ -21,9 +24,15 @@ OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterOptions OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterOptions.DefaultEventName.get -> string! OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterOptions.DefaultEventName.set -> void OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterOptions.OneCollectorLogExporterOptions() -> void +OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterOptions.SerializationOptions.get -> OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterSerializationOptions! +OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterSerializationOptions +OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterSerializationOptions.ExceptionStackTraceHandling.get -> OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType +OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterSerializationOptions.ExceptionStackTraceHandling.set -> void +OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterSerializationOptions.OneCollectorLogExporterSerializationOptions() -> void OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.ConfigureBatchOptions(System.Action!>! configure) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.ConfigureExporter(System.Action!>! configure) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! +OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.ConfigureSerializationOptions(System.Action! configure) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.ConfigureTransportOptions(System.Action! configure) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.SetConnectionString(string! connectionString) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.SetDefaultEventName(string! defaultEventName) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! diff --git a/src/OpenTelemetry.Exporter.OneCollector/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Exporter.OneCollector/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt index baf438cdc1..427f6f8f5f 100644 --- a/src/OpenTelemetry.Exporter.OneCollector/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry.Exporter.OneCollector/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt @@ -10,6 +10,9 @@ OpenTelemetry.Exporter.OneCollector.OneCollectorExporterPayloadTransmittedCallba OpenTelemetry.Exporter.OneCollector.OneCollectorExporterPayloadTransmittedCallbackArguments.OneCollectorExporterPayloadTransmittedCallbackArguments() -> void OpenTelemetry.Exporter.OneCollector.OneCollectorExporterPayloadTransmittedCallbackArguments.PayloadSizeInBytes.get -> long OpenTelemetry.Exporter.OneCollector.OneCollectorExporterPayloadTransmittedCallbackArguments.TransportEndpoint.get -> System.Uri! +OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType +OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType.Ignore = 0 -> OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType +OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType.IncludeAsString = 1 -> OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType OpenTelemetry.Exporter.OneCollector.OneCollectorExporterTransportOptions OpenTelemetry.Exporter.OneCollector.OneCollectorExporterTransportOptions.Endpoint.get -> System.Uri! OpenTelemetry.Exporter.OneCollector.OneCollectorExporterTransportOptions.Endpoint.set -> void @@ -21,9 +24,15 @@ OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterOptions OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterOptions.DefaultEventName.get -> string! OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterOptions.DefaultEventName.set -> void OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterOptions.OneCollectorLogExporterOptions() -> void +OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterOptions.SerializationOptions.get -> OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterSerializationOptions! +OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterSerializationOptions +OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterSerializationOptions.ExceptionStackTraceHandling.get -> OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType +OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterSerializationOptions.ExceptionStackTraceHandling.set -> void +OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterSerializationOptions.OneCollectorLogExporterSerializationOptions() -> void OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.ConfigureBatchOptions(System.Action!>! configure) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.ConfigureExporter(System.Action!>! configure) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! +OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.ConfigureSerializationOptions(System.Action! configure) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.ConfigureTransportOptions(System.Action! configure) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.SetConnectionString(string! connectionString) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.SetDefaultEventName(string! defaultEventName) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! diff --git a/src/OpenTelemetry.Exporter.OneCollector/.publicApi/netstandard2.1/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Exporter.OneCollector/.publicApi/netstandard2.1/PublicAPI.Unshipped.txt index baf438cdc1..427f6f8f5f 100644 --- a/src/OpenTelemetry.Exporter.OneCollector/.publicApi/netstandard2.1/PublicAPI.Unshipped.txt +++ b/src/OpenTelemetry.Exporter.OneCollector/.publicApi/netstandard2.1/PublicAPI.Unshipped.txt @@ -10,6 +10,9 @@ OpenTelemetry.Exporter.OneCollector.OneCollectorExporterPayloadTransmittedCallba OpenTelemetry.Exporter.OneCollector.OneCollectorExporterPayloadTransmittedCallbackArguments.OneCollectorExporterPayloadTransmittedCallbackArguments() -> void OpenTelemetry.Exporter.OneCollector.OneCollectorExporterPayloadTransmittedCallbackArguments.PayloadSizeInBytes.get -> long OpenTelemetry.Exporter.OneCollector.OneCollectorExporterPayloadTransmittedCallbackArguments.TransportEndpoint.get -> System.Uri! +OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType +OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType.Ignore = 0 -> OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType +OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType.IncludeAsString = 1 -> OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType OpenTelemetry.Exporter.OneCollector.OneCollectorExporterTransportOptions OpenTelemetry.Exporter.OneCollector.OneCollectorExporterTransportOptions.Endpoint.get -> System.Uri! OpenTelemetry.Exporter.OneCollector.OneCollectorExporterTransportOptions.Endpoint.set -> void @@ -21,9 +24,15 @@ OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterOptions OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterOptions.DefaultEventName.get -> string! OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterOptions.DefaultEventName.set -> void OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterOptions.OneCollectorLogExporterOptions() -> void +OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterOptions.SerializationOptions.get -> OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterSerializationOptions! +OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterSerializationOptions +OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterSerializationOptions.ExceptionStackTraceHandling.get -> OpenTelemetry.Exporter.OneCollector.OneCollectorExporterSerializationExceptionStackTraceHandlingType +OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterSerializationOptions.ExceptionStackTraceHandling.set -> void +OpenTelemetry.Exporter.OneCollector.OneCollectorLogExporterSerializationOptions.OneCollectorLogExporterSerializationOptions() -> void OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.ConfigureBatchOptions(System.Action!>! configure) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.ConfigureExporter(System.Action!>! configure) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! +OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.ConfigureSerializationOptions(System.Action! configure) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.ConfigureTransportOptions(System.Action! configure) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.SetConnectionString(string! connectionString) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder.SetDefaultEventName(string! defaultEventName) -> OpenTelemetry.Logs.OneCollectorLogExportProcessorBuilder! diff --git a/src/OpenTelemetry.Exporter.OneCollector/AssemblyInfo.cs b/src/OpenTelemetry.Exporter.OneCollector/AssemblyInfo.cs index 19c1510b3e..43c488ffc0 100644 --- a/src/OpenTelemetry.Exporter.OneCollector/AssemblyInfo.cs +++ b/src/OpenTelemetry.Exporter.OneCollector/AssemblyInfo.cs @@ -18,6 +18,7 @@ [assembly: CLSCompliant(false)] +[assembly: InternalsVisibleTo("OpenTelemetry.Exporter.OneCollector.Benchmarks" + AssemblyInfo.PublicKey)] [assembly: InternalsVisibleTo("OpenTelemetry.Exporter.OneCollector.Tests" + AssemblyInfo.PublicKey)] internal static class AssemblyInfo diff --git a/src/OpenTelemetry.Exporter.OneCollector/CHANGELOG.md b/src/OpenTelemetry.Exporter.OneCollector/CHANGELOG.md index 83e5ad027f..b17bc47694 100644 --- a/src/OpenTelemetry.Exporter.OneCollector/CHANGELOG.md +++ b/src/OpenTelemetry.Exporter.OneCollector/CHANGELOG.md @@ -6,10 +6,14 @@ syntax. ([#1073](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1073)) -* Added support for sending common schema `dt` (Distributed Tracing) extensions +* Added support for sending common schema `dt` (Distributed Tracing) extension when trace context is present on `LogRecord`s. ([#1073](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1073)) +* Added support for sending common schema `ex` (Exception) extension when + exception is present on `LogRecord`s. + ([#1082](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1082)) + ## 0.1.0-alpha.2 Released 2023-Mar-6 diff --git a/src/OpenTelemetry.Exporter.OneCollector/Internal/OneCollectorExporterEventSource.cs b/src/OpenTelemetry.Exporter.OneCollector/Internal/OneCollectorExporterEventSource.cs index ea5c1edd0c..bb73a80a13 100644 --- a/src/OpenTelemetry.Exporter.OneCollector/Internal/OneCollectorExporterEventSource.cs +++ b/src/OpenTelemetry.Exporter.OneCollector/Internal/OneCollectorExporterEventSource.cs @@ -148,11 +148,7 @@ public void AttributeDropped(string itemType, string name, string reason) this.WriteEvent(11, itemType, name, reason); } - /// - /// Returns a culture-independent string representation of the given object, - /// appropriate for diagnostics tracing. - /// - private static string ExceptionToInvariantString(Exception exception) + internal static string ExceptionToInvariantString(Exception exception) { var originalUICulture = Thread.CurrentThread.CurrentUICulture; diff --git a/src/OpenTelemetry.Exporter.OneCollector/Internal/Serialization/LogRecordCommonSchemaJsonSerializer.cs b/src/OpenTelemetry.Exporter.OneCollector/Internal/Serialization/LogRecordCommonSchemaJsonSerializer.cs index f78ae052a5..b2d2f7f957 100644 --- a/src/OpenTelemetry.Exporter.OneCollector/Internal/Serialization/LogRecordCommonSchemaJsonSerializer.cs +++ b/src/OpenTelemetry.Exporter.OneCollector/Internal/Serialization/LogRecordCommonSchemaJsonSerializer.cs @@ -30,6 +30,10 @@ internal sealed class LogRecordCommonSchemaJsonSerializer : CommonSchemaJsonSeri private static readonly JsonEncodedText DistributedTraceExtensionTraceIdProperty = JsonEncodedText.Encode("traceId"); private static readonly JsonEncodedText DistributedTraceExtensionSpanIdProperty = JsonEncodedText.Encode("spanId"); private static readonly JsonEncodedText DistributedTraceExtensionTraceFlagsProperty = JsonEncodedText.Encode("traceFlags"); + private static readonly JsonEncodedText ExceptionExtensionProperty = JsonEncodedText.Encode("ex"); + private static readonly JsonEncodedText ExceptionExtensionTypeProperty = JsonEncodedText.Encode("type"); + private static readonly JsonEncodedText ExceptionExtensionMessageProperty = JsonEncodedText.Encode("msg"); + private static readonly JsonEncodedText ExceptionExtensionStackTraceProperty = JsonEncodedText.Encode("stack"); private static readonly JsonEncodedText[] LogLevelToSeverityTextMappings = new JsonEncodedText[] { @@ -69,10 +73,12 @@ internal sealed class LogRecordCommonSchemaJsonSerializer : CommonSchemaJsonSeri }; private readonly EventNameManager eventNameManager; + private readonly OneCollectorExporterSerializationExceptionStackTraceHandlingType exceptionStackTraceHandling; public LogRecordCommonSchemaJsonSerializer( EventNameManager eventNameManager, string tenantToken, + OneCollectorExporterSerializationExceptionStackTraceHandlingType exceptionStackTraceHandling = OneCollectorExporterSerializationExceptionStackTraceHandlingType.Ignore, int maxPayloadSizeInBytes = int.MaxValue, int maxNumberOfItemsPerPayload = int.MaxValue) : base(tenantToken, maxPayloadSizeInBytes, maxNumberOfItemsPerPayload) @@ -80,6 +86,7 @@ public LogRecordCommonSchemaJsonSerializer( Debug.Assert(eventNameManager != null, "eventNameManager was null"); this.eventNameManager = eventNameManager!; + this.exceptionStackTraceHandling = exceptionStackTraceHandling; } public override string Description => "LogRecord Common Schema JSON"; @@ -169,16 +176,17 @@ protected override void SerializeItemToJson(Resource resource, LogRecord item, C writer.WriteEndObject(); - SerializeExtensionPropertiesToJson(item, writer, serializationState); + this.SerializeExtensionPropertiesToJson(item, writer, serializationState); writer.WriteEndObject(); } - private static void SerializeExtensionPropertiesToJson(LogRecord item, Utf8JsonWriter writer, CommonSchemaJsonSerializationState serializationState) + private void SerializeExtensionPropertiesToJson(LogRecord item, Utf8JsonWriter writer, CommonSchemaJsonSerializationState serializationState) { var hasTraceContext = item.TraceId != default; + var hasException = item.Exception != null; - if (!hasTraceContext && serializationState.ExtensionAttributeCount <= 0) + if (!hasTraceContext && !hasException && serializationState.ExtensionAttributeCount <= 0) { return; } @@ -194,6 +202,20 @@ private static void SerializeExtensionPropertiesToJson(LogRecord item, Utf8JsonW writer.WriteEndObject(); } + if (hasException) + { + writer.WriteStartObject(ExceptionExtensionProperty); + writer.WriteString(ExceptionExtensionTypeProperty, item.Exception!.GetType().FullName); + writer.WriteString(ExceptionExtensionMessageProperty, item.Exception.Message); + + if (this.exceptionStackTraceHandling == OneCollectorExporterSerializationExceptionStackTraceHandlingType.IncludeAsString) + { + writer.WriteString(ExceptionExtensionStackTraceProperty, OneCollectorExporterEventSource.ExceptionToInvariantString(item.Exception)); + } + + writer.WriteEndObject(); + } + serializationState.SerializeExtensionPropertiesToJson(writeExtensionObjectEnvelope: false); writer.WriteEndObject(); diff --git a/src/OpenTelemetry.Exporter.OneCollector/Internal/Transports/HttpJsonPostTransport.cs b/src/OpenTelemetry.Exporter.OneCollector/Internal/Transports/HttpJsonPostTransport.cs index 2324ef4a97..a65af89c19 100644 --- a/src/OpenTelemetry.Exporter.OneCollector/Internal/Transports/HttpJsonPostTransport.cs +++ b/src/OpenTelemetry.Exporter.OneCollector/Internal/Transports/HttpJsonPostTransport.cs @@ -31,14 +31,14 @@ internal sealed class HttpJsonPostTransport : ITransport, IDisposable private readonly Uri endpoint; private readonly string instrumentationKey; private readonly OneCollectorExporterHttpTransportCompressionType compressionType; - private readonly HttpClient httpClient; + private readonly IHttpClient httpClient; private MemoryStream? buffer; public HttpJsonPostTransport( string instrumentationKey, Uri endpoint, OneCollectorExporterHttpTransportCompressionType compressionType, - HttpClient httpClient) + IHttpClient httpClient) { Debug.Assert(!string.IsNullOrWhiteSpace(instrumentationKey), "instrumentationKey was null or whitespace"); Debug.Assert(endpoint != null, "endpoint was null"); @@ -104,11 +104,7 @@ public bool Send(in TransportSendRequest sendRequest) request.Headers.TryAddWithoutValidation("NoResponseBody", "true"); } -#if NET6_0_OR_GREATER using var response = this.httpClient.Send(request, CancellationToken.None); -#else - using var response = this.httpClient.SendAsync(request, CancellationToken.None).GetAwaiter().GetResult(); -#endif try { diff --git a/src/OpenTelemetry.Exporter.OneCollector/Internal/Transports/IHttpClient.cs b/src/OpenTelemetry.Exporter.OneCollector/Internal/Transports/IHttpClient.cs new file mode 100644 index 0000000000..66dff2933b --- /dev/null +++ b/src/OpenTelemetry.Exporter.OneCollector/Internal/Transports/IHttpClient.cs @@ -0,0 +1,41 @@ +// +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +namespace OpenTelemetry.Exporter.OneCollector; + +internal interface IHttpClient +{ + HttpResponseMessage Send(HttpRequestMessage request, CancellationToken cancellationToken); +} + +internal sealed class HttpClientWrapper : IHttpClient +{ + private readonly HttpClient httpClient; + + public HttpClientWrapper(HttpClient httpClient) + { + this.httpClient = httpClient; + } + + public HttpResponseMessage Send(HttpRequestMessage request, CancellationToken cancellationToken) + { +#if NET6_0_OR_GREATER + return this.httpClient.Send(request, CancellationToken.None); +#else + return this.httpClient.SendAsync(request, CancellationToken.None).GetAwaiter().GetResult(); +#endif + } +} diff --git a/src/OpenTelemetry.Exporter.OneCollector/Logs/OneCollectorLogExportProcessorBuilder.cs b/src/OpenTelemetry.Exporter.OneCollector/Logs/OneCollectorLogExportProcessorBuilder.cs index 69e47a6734..841bdcdeca 100644 --- a/src/OpenTelemetry.Exporter.OneCollector/Logs/OneCollectorLogExportProcessorBuilder.cs +++ b/src/OpenTelemetry.Exporter.OneCollector/Logs/OneCollectorLogExportProcessorBuilder.cs @@ -81,6 +81,26 @@ public OneCollectorLogExportProcessorBuilder ConfigureExporter( return this; } + /// + /// Register a callback action for configuring the serialization options + /// used by the created by the + /// builder. + /// + /// Callback action for configuring . + /// The supplied for call + /// chaining. + public OneCollectorLogExportProcessorBuilder ConfigureSerializationOptions( + Action configure) + { + Guard.ThrowIfNull(configure); + + configure(this.exporterOptions.SerializationOptions); + + return this; + } + /// /// Register a callback action for configuring the transport options used by /// the created by the builder. @@ -208,18 +228,21 @@ private ISink CreateSink() var transportOptions = this.exporterOptions.TransportOptions; + var httpClient = (this.httpClientFactory ?? DefaultHttpClientFactory)() ?? throw new NotSupportedException("HttpClientFactory cannot return a null instance."); + #pragma warning disable CA2000 // Dispose objects before losing scope return new WriteDirectlyToTransportSink( new LogRecordCommonSchemaJsonSerializer( new EventNameManager(this.exporterOptions.DefaultEventNamespace, this.exporterOptions.DefaultEventName), this.exporterOptions.TenantToken!, + this.exporterOptions.SerializationOptions.ExceptionStackTraceHandling, transportOptions.MaxPayloadSizeInBytes == -1 ? int.MaxValue : transportOptions.MaxPayloadSizeInBytes, transportOptions.MaxNumberOfItemsPerPayload == -1 ? int.MaxValue : transportOptions.MaxNumberOfItemsPerPayload), new HttpJsonPostTransport( this.exporterOptions.InstrumentationKey!, transportOptions.Endpoint, transportOptions.HttpCompression, - (this.httpClientFactory ?? DefaultHttpClientFactory)() ?? throw new NotSupportedException("HttpClientFactory cannot return a null instance."))); + new HttpClientWrapper(httpClient))); #pragma warning restore CA2000 // Dispose objects before losing scope } } diff --git a/src/OpenTelemetry.Exporter.OneCollector/Logs/OneCollectorLogExporterOptions.cs b/src/OpenTelemetry.Exporter.OneCollector/Logs/OneCollectorLogExporterOptions.cs index f6018e1f26..9be886af87 100644 --- a/src/OpenTelemetry.Exporter.OneCollector/Logs/OneCollectorLogExporterOptions.cs +++ b/src/OpenTelemetry.Exporter.OneCollector/Logs/OneCollectorLogExporterOptions.cs @@ -35,6 +35,11 @@ public sealed class OneCollectorLogExporterOptions : OneCollectorExporterOptions /// public string DefaultEventName { get; set; } = "Log"; + /// + /// Gets the OneCollector log serialization options. + /// + public OneCollectorLogExporterSerializationOptions SerializationOptions { get; } = new(); + /// /// Gets or sets the default event namespace. Default value: /// OpenTelemetry.Logs. @@ -59,6 +64,8 @@ internal override void Validate() throw new OneCollectorExporterValidationException($"{nameof(this.DefaultEventName)} was not specified on {nameof(OneCollectorLogExporterOptions)} options."); } + this.SerializationOptions.Validate(); + base.Validate(); } } diff --git a/src/OpenTelemetry.Exporter.OneCollector/Logs/OneCollectorLogExporterSerializationOptions.cs b/src/OpenTelemetry.Exporter.OneCollector/Logs/OneCollectorLogExporterSerializationOptions.cs new file mode 100644 index 0000000000..8230b30d9e --- /dev/null +++ b/src/OpenTelemetry.Exporter.OneCollector/Logs/OneCollectorLogExporterSerializationOptions.cs @@ -0,0 +1,47 @@ +// +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using OpenTelemetry.Logs; + +namespace OpenTelemetry.Exporter.OneCollector; + +/// +/// Contains serialization options used to build a instance for exporting telemetry data. +/// +public sealed class OneCollectorLogExporterSerializationOptions +{ + /// + /// Gets or sets the exception stack trace handling type. Default + /// value: . + /// + public OneCollectorExporterSerializationExceptionStackTraceHandlingType ExceptionStackTraceHandling { get; set; } + = OneCollectorExporterSerializationExceptionStackTraceHandlingType.Ignore; + + /// + /// Gets or sets OneCollector serialization format. Default value: . + /// + internal OneCollectorExporterSerializationFormatType Format { get; set; } = OneCollectorExporterSerializationFormatType.CommonSchemaV4JsonStream; + +#pragma warning disable CA1822 // Mark members as static + internal void Validate() +#pragma warning restore CA1822 // Mark members as static + { + } +} diff --git a/src/OpenTelemetry.Exporter.OneCollector/OneCollectorExporterOptions.cs b/src/OpenTelemetry.Exporter.OneCollector/OneCollectorExporterOptions.cs index 540d9e0e7e..8ea82c4caf 100644 --- a/src/OpenTelemetry.Exporter.OneCollector/OneCollectorExporterOptions.cs +++ b/src/OpenTelemetry.Exporter.OneCollector/OneCollectorExporterOptions.cs @@ -51,12 +51,6 @@ internal OneCollectorExporterOptions() /// internal string? TenantToken { get; private set; } - /// - /// Gets or sets OneCollector serialization format. Default value: . - /// - internal OneCollectorExporterSerializationFormatType SerializationFormat { get; set; } = OneCollectorExporterSerializationFormatType.CommonSchemaV4JsonStream; - internal virtual void Validate() { if (string.IsNullOrWhiteSpace(this.ConnectionString)) diff --git a/src/OpenTelemetry.Exporter.OneCollector/OneCollectorExporterSerializationExceptionStackTraceHandlingType.cs b/src/OpenTelemetry.Exporter.OneCollector/OneCollectorExporterSerializationExceptionStackTraceHandlingType.cs new file mode 100644 index 0000000000..5f230c00fd --- /dev/null +++ b/src/OpenTelemetry.Exporter.OneCollector/OneCollectorExporterSerializationExceptionStackTraceHandlingType.cs @@ -0,0 +1,35 @@ +// +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +namespace OpenTelemetry.Exporter.OneCollector; + +/// +/// Describes the OneCollector serialization behavior to use when writing the +/// stack trace for telemetry containing an instance. +/// +public enum OneCollectorExporterSerializationExceptionStackTraceHandlingType +{ + /// + /// Exception stack traces will be ignored when serializing. + /// + Ignore, + + /// + /// Exception stack traces will be included when serializing by calling . + /// + IncludeAsString, +} diff --git a/test/OpenTelemetry.Exporter.OneCollector.Tests/HttpJsonPostTransportTests.cs b/test/OpenTelemetry.Exporter.OneCollector.Tests/HttpJsonPostTransportTests.cs index 140fc7c6a3..c48fb38cc5 100644 --- a/test/OpenTelemetry.Exporter.OneCollector.Tests/HttpJsonPostTransportTests.cs +++ b/test/OpenTelemetry.Exporter.OneCollector.Tests/HttpJsonPostTransportTests.cs @@ -39,7 +39,7 @@ public void RequestWithoutCompressionTest() "instrumentation-key", requestUri, OneCollectorExporterHttpTransportCompressionType.None, - httpClient); + new HttpClientWrapper(httpClient)); }, (req, body) => { @@ -64,7 +64,7 @@ public void RequestUsingDeflateCompressionTest() "instrumentation-key", requestUri, OneCollectorExporterHttpTransportCompressionType.Deflate, - httpClient); + new HttpClientWrapper(httpClient)); }, (req, body) => { @@ -112,7 +112,7 @@ public void RegisterPayloadTransmittedCallbackTest() "instrumentation-key", requestUri, OneCollectorExporterHttpTransportCompressionType.None, - httpClient); + new HttpClientWrapper(httpClient)); return transport; }, diff --git a/test/OpenTelemetry.Exporter.OneCollector.Tests/LogRecordCommonSchemaJsonSerializerTests.cs b/test/OpenTelemetry.Exporter.OneCollector.Tests/LogRecordCommonSchemaJsonSerializerTests.cs index ec20cd563e..5c1b506325 100644 --- a/test/OpenTelemetry.Exporter.OneCollector.Tests/LogRecordCommonSchemaJsonSerializerTests.cs +++ b/test/OpenTelemetry.Exporter.OneCollector.Tests/LogRecordCommonSchemaJsonSerializerTests.cs @@ -186,6 +186,28 @@ public void LogRecordTraceContextJsonTest() json); } + [Theory] + [InlineData(true)] + [InlineData(false)] + public void LogRecordExceptionJsonTest(bool includeStackTraceAsString) + { + string json = GetLogRecordJson( + 1, + (index, logRecord) => + { + logRecord.Exception = new InvalidOperationException(); + }, + includeStackTraceAsString: includeStackTraceAsString); + + var stackJson = includeStackTraceAsString + ? $",\"stack\":\"System.InvalidOperationException: Operation is not valid due to the current state of the object.\"" + : string.Empty; + + Assert.Equal( + $"{{\"ver\":\"4.0\",\"name\":\"Namespace.Name\",\"time\":\"2032-01-18T10:11:12Z\",\"iKey\":\"o:tenant-token\",\"data\":{{\"severityText\":\"Trace\",\"severityNumber\":1}},\"ext\":{{\"ex\":{{\"type\":\"System.InvalidOperationException\",\"msg\":\"Operation is not valid due to the current state of the object.\"{stackJson}}}}}}}\n", + json); + } + [Fact] public void LogRecordExtensionsJsonTest() { @@ -217,11 +239,13 @@ private static string GetLogRecordJson( int numberOfLogRecords, Action writeLogRecordCallback, Resource? resource = null, - ScopeProvider? scopeProvider = null) + ScopeProvider? scopeProvider = null, + bool includeStackTraceAsString = false) { var serializer = new LogRecordCommonSchemaJsonSerializer( new("Namespace", "Name"), - "tenant-token"); + "tenant-token", + exceptionStackTraceHandling: includeStackTraceAsString ? OneCollectorExporterSerializationExceptionStackTraceHandlingType.IncludeAsString : OneCollectorExporterSerializationExceptionStackTraceHandlingType.Ignore); using var stream = new MemoryStream(); diff --git a/test/OpenTelemetry.Exporter.OneCollector.Tests/OpenTelemetry.Exporter.OneCollector.Tests.csproj b/test/OpenTelemetry.Exporter.OneCollector.Tests/OpenTelemetry.Exporter.OneCollector.Tests.csproj index bf5c8efbf9..be7e96512f 100644 --- a/test/OpenTelemetry.Exporter.OneCollector.Tests/OpenTelemetry.Exporter.OneCollector.Tests.csproj +++ b/test/OpenTelemetry.Exporter.OneCollector.Tests/OpenTelemetry.Exporter.OneCollector.Tests.csproj @@ -1,7 +1,7 @@ - Unit test project for OneCollector Exporters for OpenTelemetry + Unit test project for OpenTelemetry .NET OneCollectorExporter. net7.0;net6.0 $(TargetFrameworks);net48;net472;net471;net47;net462