diff --git a/tracer/build/_build/Honeypot/IntegrationGroups.cs b/tracer/build/_build/Honeypot/IntegrationGroups.cs index a2b038ca450c..698ef688254f 100644 --- a/tracer/build/_build/Honeypot/IntegrationGroups.cs +++ b/tracer/build/_build/Honeypot/IntegrationGroups.cs @@ -129,7 +129,10 @@ static IntegrationMap() NugetPackages.Add("Datadog.Trace", new string[] { }); NugetPackages.Add("Datadog.Trace.Manual", new string[] { }); NugetPackages.Add("Datadog.Trace.OpenTracing", new string[] { }); - + + // Serverless + NugetPackages.Add("Datadog.Serverless.Compat", new string[] { }); + // Feature Flags NugetPackages.Add("Datadog.FeatureFlags.OpenFeature", new string[] { }); NugetPackages.Add("OpenFeature", new string[] { }); diff --git a/tracer/build/supported_calltargets.g.json b/tracer/build/supported_calltargets.g.json index cd1e0ba03f82..4c60c1d358a1 100644 --- a/tracer/build/supported_calltargets.g.json +++ b/tracer/build/supported_calltargets.g.json @@ -16459,6 +16459,50 @@ "IsAdoNetIntegration": false, "InstrumentationCategory": 1 }, + { + "IntegrationName": "ServerlessCompat", + "AssemblyName": "Datadog.Serverless.Compat", + "TargetTypeName": "Datadog.Serverless.CompatibilityLayer", + "TargetMethodName": "CalculateDogStatsDPipeName", + "TargetReturnType": "System.String", + "TargetParameterTypes": [], + "MinimumVersion": { + "Item1": 0, + "Item2": 0, + "Item3": 0 + }, + "MaximumVersion": { + "Item1": 1, + "Item2": 65535, + "Item3": 65535 + }, + "InstrumentationTypeName": "Datadog.Trace.ClrProfiler.AutoInstrumentation.Serverless.CompatibilityLayer_CalculateDogStatsDPipeName_Integration", + "IntegrationKind": 0, + "IsAdoNetIntegration": false, + "InstrumentationCategory": 1 + }, + { + "IntegrationName": "ServerlessCompat", + "AssemblyName": "Datadog.Serverless.Compat", + "TargetTypeName": "Datadog.Serverless.CompatibilityLayer", + "TargetMethodName": "CalculateTracePipeName", + "TargetReturnType": "System.String", + "TargetParameterTypes": [], + "MinimumVersion": { + "Item1": 0, + "Item2": 0, + "Item3": 0 + }, + "MaximumVersion": { + "Item1": 1, + "Item2": 65535, + "Item3": 65535 + }, + "InstrumentationTypeName": "Datadog.Trace.ClrProfiler.AutoInstrumentation.Serverless.CompatibilityLayer_CalculateTracePipeName_Integration", + "IntegrationKind": 0, + "IsAdoNetIntegration": false, + "InstrumentationCategory": 1 + }, { "IntegrationName": "ServiceStackRedis", "AssemblyName": "ServiceStack.Redis", diff --git a/tracer/src/Datadog.Trace.Trimming/build/Datadog.Trace.Trimming.xml b/tracer/src/Datadog.Trace.Trimming/build/Datadog.Trace.Trimming.xml index 5c07278816bf..a6d07d24ce3c 100644 --- a/tracer/src/Datadog.Trace.Trimming/build/Datadog.Trace.Trimming.xml +++ b/tracer/src/Datadog.Trace.Trimming/build/Datadog.Trace.Trimming.xml @@ -16,6 +16,7 @@ + diff --git a/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Serverless/CompatibilityLayer_CalculateDogStatsDPipeName_Integration.cs b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Serverless/CompatibilityLayer_CalculateDogStatsDPipeName_Integration.cs new file mode 100644 index 000000000000..1a16ebbdbe18 --- /dev/null +++ b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Serverless/CompatibilityLayer_CalculateDogStatsDPipeName_Integration.cs @@ -0,0 +1,87 @@ +// +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc. +// + +#nullable enable + +#if !NETFRAMEWORK +using System; +using System.ComponentModel; +using Datadog.Trace.ClrProfiler.CallTarget; +using Datadog.Trace.Configuration; +using Datadog.Trace.Logging; + +namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.Serverless +{ + /// + /// Instrumentation for Datadog.Serverless.CompatibilityLayer.CalculateDogStatsDPipeName method. + /// This instrumentation overrides the return value with the tracer's pre-generated pipe name, + /// ensuring the tracer's runtime metrics and the compat layer use the same pipe name. + /// Version range 0.0.0–1.*.* matches all 0.x and 1.x versions, including the 0.0.0 dev build. + /// If the target method doesn't exist (e.g. older/newer compat assembly), the native profiler + /// silently skips instrumentation — no exception is thrown. + /// + [InstrumentMethod( + AssemblyName = "Datadog.Serverless.Compat", + TypeName = "Datadog.Serverless.CompatibilityLayer", + MethodName = "CalculateDogStatsDPipeName", + ReturnTypeName = ClrNames.String, + ParameterTypeNames = [], + MinimumVersion = "0.0.0", + MaximumVersion = "1.*.*", + IntegrationName = nameof(IntegrationId.ServerlessCompat), + InstrumentationCategory = InstrumentationCategory.Tracing)] + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class CompatibilityLayer_CalculateDogStatsDPipeName_Integration + { + private static readonly IDatadogLogger Log = DatadogLogging.GetLoggerFor(typeof(CompatibilityLayer_CalculateDogStatsDPipeName_Integration)); + + /// + /// OnMethodEnd callback - intercepts the return value and overrides it with a unique pipe name + /// + /// Type of the target + /// Instance value, aka `this` of the instrumented method (null for static methods) + /// The pipe name calculated by the compat layer + /// Exception instance in case the original code threw an exception + /// Calltarget state value + /// A unique pipe name for coordination between tracer and compat layer + internal static CallTargetReturn OnMethodEnd( + TTarget instance, + string returnValue, + Exception exception, + in CallTargetState state) + { + if (exception is not null) + { + // If there was an exception, pass it through + return new CallTargetReturn(returnValue); + } + + try + { + // Use the tracer's configured pipe name, which in Azure Functions will be the + // unique name generated by ExporterSettings. Fall back to the compat layer's + // own calculated name if the tracer isn't initialized yet. + var pipeName = Tracer.Instance.Settings?.Manager?.InitialExporterSettings?.MetricsPipeName ?? returnValue; + + Log.Debug( + "ServerlessCompat integration: Overriding compat layer DogStatsD pipe name. " + + "Compat layer calculated: {CompatPipeName}, Tracer using: {TracerPipeName}", + returnValue, + pipeName); + + return new CallTargetReturn(pipeName); + } + catch (Exception ex) + { + Log.Error(ex, "ServerlessCompat integration: Error overriding DogStatsD pipe name"); + } + + // Fallback to compat layer's original value + return new CallTargetReturn(returnValue); + } + } +} +#endif diff --git a/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Serverless/CompatibilityLayer_CalculateTracePipeName_Integration.cs b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Serverless/CompatibilityLayer_CalculateTracePipeName_Integration.cs new file mode 100644 index 000000000000..403370392b31 --- /dev/null +++ b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Serverless/CompatibilityLayer_CalculateTracePipeName_Integration.cs @@ -0,0 +1,87 @@ +// +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc. +// + +#nullable enable + +#if !NETFRAMEWORK +using System; +using System.ComponentModel; +using Datadog.Trace.ClrProfiler.CallTarget; +using Datadog.Trace.Configuration; +using Datadog.Trace.Logging; + +namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.Serverless +{ + /// + /// Instrumentation for Datadog.Serverless.CompatibilityLayer.CalculateTracePipeName method. + /// This instrumentation overrides the return value with the tracer's pre-generated pipe name, + /// ensuring both the tracer and the compat layer use the same pipe name for communication. + /// Version range 0.0.0–1.*.* matches all 0.x and 1.x versions, including the 0.0.0 dev build. + /// If the target method doesn't exist (e.g. older/newer compat assembly), the native profiler + /// silently skips instrumentation — no exception is thrown. + /// + [InstrumentMethod( + AssemblyName = "Datadog.Serverless.Compat", + TypeName = "Datadog.Serverless.CompatibilityLayer", + MethodName = "CalculateTracePipeName", + ReturnTypeName = ClrNames.String, + ParameterTypeNames = [], + MinimumVersion = "0.0.0", + MaximumVersion = "1.*.*", + IntegrationName = nameof(IntegrationId.ServerlessCompat), + InstrumentationCategory = InstrumentationCategory.Tracing)] + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public sealed class CompatibilityLayer_CalculateTracePipeName_Integration + { + private static readonly IDatadogLogger Log = DatadogLogging.GetLoggerFor(typeof(CompatibilityLayer_CalculateTracePipeName_Integration)); + + /// + /// OnMethodEnd callback - intercepts the return value and overrides it with a unique pipe name + /// + /// Type of the target + /// Instance value, aka `this` of the instrumented method (null for static methods) + /// The pipe name calculated by the compat layer + /// Exception instance in case the original code threw an exception + /// Calltarget state value + /// A unique pipe name for coordination between tracer and compat layer + internal static CallTargetReturn OnMethodEnd( + TTarget instance, + string returnValue, + Exception exception, + in CallTargetState state) + { + if (exception is not null) + { + // If there was an exception, pass it through + return new CallTargetReturn(returnValue); + } + + try + { + // Use the tracer's configured pipe name, which in Azure Functions will be the + // unique name generated by ExporterSettings. Fall back to the compat layer's + // own calculated name if the tracer isn't initialized yet. + var pipeName = Tracer.Instance.Settings?.Manager?.InitialExporterSettings?.TracesPipeName ?? returnValue; + + Log.Debug( + "ServerlessCompat integration: Overriding compat layer trace pipe name. " + + "Compat layer calculated: {CompatPipeName}, Tracer using: {TracerPipeName}", + returnValue, + pipeName); + + return new CallTargetReturn(pipeName); + } + catch (Exception ex) + { + Log.Error(ex, "ServerlessCompat integration: Error overriding trace pipe name"); + } + + // Fallback to compat layer's original value + return new CallTargetReturn(returnValue); + } + } +} +#endif diff --git a/tracer/src/Datadog.Trace/Configuration/ExporterSettings.cs b/tracer/src/Datadog.Trace/Configuration/ExporterSettings.cs index f398fbdc4a9e..b2bc8456e9c0 100644 --- a/tracer/src/Datadog.Trace/Configuration/ExporterSettings.cs +++ b/tracer/src/Datadog.Trace/Configuration/ExporterSettings.cs @@ -14,6 +14,7 @@ using Datadog.Trace.Configuration.ConfigurationSources; using Datadog.Trace.Configuration.ConfigurationSources.Telemetry; using Datadog.Trace.Configuration.Telemetry; +using Datadog.Trace.Logging; using Datadog.Trace.SourceGenerators; using Datadog.Trace.Telemetry; using Datadog.Trace.Telemetry.Metrics; @@ -27,6 +28,8 @@ namespace Datadog.Trace.Configuration /// public sealed partial class ExporterSettings { + private static readonly IDatadogLogger Log = DatadogLogging.GetLoggerFor(typeof(ExporterSettings)); + /// /// Allows overriding of file system access for tests. /// @@ -88,12 +91,31 @@ internal ExporterSettings(Raw rawSettings, Func fileExists, IConfi ValidationWarnings = new List(); + // In Azure Functions (without AAS Site Extension), generate unique pipe names so each + // function instance gets its own pipe even when sharing a hosting plan. The generated names + // use the user-configured base name (from any config source) with a unique GUID suffix. + string? tracesPipeName; + string? metricsPipeName; + + if (Util.EnvironmentHelpers.IsAzureFunctions() + && !Util.EnvironmentHelpers.IsUsingAzureAppServicesSiteExtension() + && Serverless.ServerlessCompatPipeNameHelper.IsCompatLayerAvailableWithPipeSupport()) + { + tracesPipeName = GenerateUniquePipeName(rawSettings.TracesPipeName, "dd_trace", ConfigurationKeys.TracesPipeName); + metricsPipeName = GenerateUniquePipeName(rawSettings.MetricsPipeName, "dd_dogstatsd", ConfigurationKeys.MetricsPipeName); + } + else + { + tracesPipeName = rawSettings.TracesPipeName; + metricsPipeName = rawSettings.MetricsPipeName; + } + var traceSettings = GetTraceTransport( - agentUri: rawSettings.TraceAgentUri, - tracesPipeName: rawSettings.TracesPipeName, - agentHost: rawSettings.TraceAgentHost, - agentPort: rawSettings.TraceAgentPort, - tracesUnixDomainSocketPath: rawSettings.TracesUnixDomainSocketPath); + agentUri: rawSettings.TraceAgentUri, + tracesPipeName: tracesPipeName, + agentHost: rawSettings.TraceAgentHost, + agentPort: rawSettings.TraceAgentPort, + tracesUnixDomainSocketPath: rawSettings.TracesUnixDomainSocketPath); TracesEncoding = TracesEncoding.DatadogV0_4; TracesTransport = traceSettings.Transport; @@ -130,7 +152,7 @@ internal ExporterSettings(Raw rawSettings, Func fileExists, IConfi traceAgentUrl: rawSettings.TraceAgentUri, agentHost: rawSettings.TraceAgentHost, dogStatsdPort: rawSettings.DogStatsdPort, - metricsPipeName: rawSettings.MetricsPipeName, + metricsPipeName: metricsPipeName, metricsUnixDomainSocketPath: rawSettings.MetricsUnixDomainSocketPath); MetricsHostname = metricsSettings.Hostname; @@ -325,6 +347,15 @@ private static string GetMetricsHostNameFromAgentUri(Uri agentUri) return string.IsNullOrEmpty(traceHostname) ? DefaultDogstatsdHostname : traceHostname; } + private string GenerateUniquePipeName(string? configuredBaseName, string defaultBaseName, string configKey) + { + var baseName = StringUtil.IsNullOrEmpty(configuredBaseName) ? defaultBaseName : configuredBaseName; + var name = Serverless.ServerlessCompatPipeNameHelper.GenerateUniquePipeName(baseName, "ExporterSettings"); + Log.Information("Azure Functions environment detected. Using pipe base name '{BaseName}', generated unique pipe name: {PipeName}", baseName, name); + _telemetry.Record(configKey, name, recordValue: true, ConfigurationOrigins.Calculated); + return name; + } + private MetricsTransportSettings ConfigureMetricsTransport(string? metricsUrl, string? traceAgentUrl, string? agentHost, int dogStatsdPort, string? metricsPipeName, string? metricsUnixDomainSocketPath) { if (!string.IsNullOrEmpty(metricsUrl) && TryGetMetricsUriAndTransport(metricsUrl!, out var settingsFromUri)) diff --git a/tracer/src/Datadog.Trace/Configuration/IntegrationId.cs b/tracer/src/Datadog.Trace/Configuration/IntegrationId.cs index d40a2736d301..787eb373cf17 100644 --- a/tracer/src/Datadog.Trace/Configuration/IntegrationId.cs +++ b/tracer/src/Datadog.Trace/Configuration/IntegrationId.cs @@ -90,6 +90,7 @@ internal enum IntegrationId AzureEventHubs, DatadogTraceVersionConflict, Hangfire, - OpenFeature + OpenFeature, + ServerlessCompat } } diff --git a/tracer/src/Datadog.Trace/Configuration/supported-configurations.yaml b/tracer/src/Datadog.Trace/Configuration/supported-configurations.yaml index 7287c5dd06bf..eb7ebbe157df 100644 --- a/tracer/src/Datadog.Trace/Configuration/supported-configurations.yaml +++ b/tracer/src/Datadog.Trace/Configuration/supported-configurations.yaml @@ -1468,6 +1468,15 @@ supportedConfigurations: Match all spans that start with "cart" without any limits and any operation name. "[{"service": "cart*"}]" + DD_SERVERLESS_COMPAT_PATH: + - implementation: A + type: string + default: null + const_name: ServerlessCompatPath + documentation: |- + Overrides the default path to the serverless compatibility layer binary. + Default value in windows is C:\home\site\wwwroot\datadog\bin\windows-amd64\datadog-serverless-compat.exe. + Default value in linux is /bin/linux-amd64/datadog-serverless-compat. DD_SYMBOL_DATABASE_BATCH_SIZE_BYTES: - implementation: A type: int diff --git a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/ConfigurationKeysGenerator/ConfigurationKeys.g.cs b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/ConfigurationKeysGenerator/ConfigurationKeys.g.cs index 1926eaef1500..04a795504c87 100644 --- a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/ConfigurationKeysGenerator/ConfigurationKeys.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/ConfigurationKeysGenerator/ConfigurationKeys.g.cs @@ -242,6 +242,13 @@ internal static partial class ConfigurationKeys /// public const string RuntimeMetricsEnabled = "DD_RUNTIME_METRICS_ENABLED"; + /// + /// Overrides the default path to the serverless compatibility layer binary. + /// Default value in windows is C:\home\site\wwwroot\datadog\bin\windows-amd64\datadog-serverless-compat.exe. + /// Default value in linux is /bin/linux-amd64/datadog-serverless-compat. + /// + public const string ServerlessCompatPath = "DD_SERVERLESS_COMPAT_PATH"; + /// /// Configuration key for the application's default service name. /// Used as the service name for top-level spans, diff --git a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs index 3c9c56bf7d70..cfc3e86ece7b 100644 --- a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs @@ -17,7 +17,7 @@ internal static partial class IntegrationIdExtensions /// The number of members in the enum. /// This is a non-distinct count of defined names. /// - public const int Length = 79; + public const int Length = 80; /// /// Returns the string representation of the value. @@ -109,6 +109,7 @@ public static string ToStringFast(this Datadog.Trace.Configuration.IntegrationId Datadog.Trace.Configuration.IntegrationId.DatadogTraceVersionConflict => nameof(Datadog.Trace.Configuration.IntegrationId.DatadogTraceVersionConflict), Datadog.Trace.Configuration.IntegrationId.Hangfire => nameof(Datadog.Trace.Configuration.IntegrationId.Hangfire), Datadog.Trace.Configuration.IntegrationId.OpenFeature => nameof(Datadog.Trace.Configuration.IntegrationId.OpenFeature), + Datadog.Trace.Configuration.IntegrationId.ServerlessCompat => nameof(Datadog.Trace.Configuration.IntegrationId.ServerlessCompat), _ => value.ToString(), }; @@ -201,6 +202,7 @@ public static Datadog.Trace.Configuration.IntegrationId[] GetValues() Datadog.Trace.Configuration.IntegrationId.DatadogTraceVersionConflict, Datadog.Trace.Configuration.IntegrationId.Hangfire, Datadog.Trace.Configuration.IntegrationId.OpenFeature, + Datadog.Trace.Configuration.IntegrationId.ServerlessCompat, }; /// @@ -293,5 +295,6 @@ public static string[] GetNames() nameof(Datadog.Trace.Configuration.IntegrationId.DatadogTraceVersionConflict), nameof(Datadog.Trace.Configuration.IntegrationId.Hangfire), nameof(Datadog.Trace.Configuration.IntegrationId.OpenFeature), + nameof(Datadog.Trace.Configuration.IntegrationId.ServerlessCompat), }; } \ No newline at end of file diff --git a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationNameToKeys.g.cs b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationNameToKeys.g.cs index 937b0fffb12c..1082a62da2ba 100644 --- a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationNameToKeys.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationNameToKeys.g.cs @@ -259,6 +259,9 @@ public static string[] GetAllIntegrationEnabledKeys() => "DD_TRACE_OPENFEATURE_ENABLED", "DD_TRACE_OpenFeature_ENABLED", "DD_OpenFeature_ENABLED", "DD_TRACE_OPENFEATURE_ANALYTICS_ENABLED", "DD_TRACE_OpenFeature_ANALYTICS_ENABLED", "DD_OpenFeature_ANALYTICS_ENABLED", "DD_TRACE_OPENFEATURE_ANALYTICS_SAMPLE_RATE", "DD_TRACE_OpenFeature_ANALYTICS_SAMPLE_RATE", "DD_OpenFeature_ANALYTICS_SAMPLE_RATE", + "DD_TRACE_SERVERLESSCOMPAT_ENABLED", "DD_TRACE_ServerlessCompat_ENABLED", "DD_ServerlessCompat_ENABLED", + "DD_TRACE_SERVERLESSCOMPAT_ANALYTICS_ENABLED", "DD_TRACE_ServerlessCompat_ANALYTICS_ENABLED", "DD_ServerlessCompat_ANALYTICS_ENABLED", + "DD_TRACE_SERVERLESSCOMPAT_ANALYTICS_SAMPLE_RATE", "DD_TRACE_ServerlessCompat_ANALYTICS_SAMPLE_RATE", "DD_ServerlessCompat_ANALYTICS_SAMPLE_RATE", ]; /// /// Gets the configuration keys for the specified integration name. @@ -348,6 +351,7 @@ public static System.Collections.Generic.KeyValuePair GetInteg "DatadogTraceVersionConflict" => new("DD_TRACE_DATADOGTRACEVERSIONCONFLICT_ENABLED", ["DD_TRACE_DatadogTraceVersionConflict_ENABLED", "DD_DatadogTraceVersionConflict_ENABLED"]), "Hangfire" => new("DD_TRACE_HANGFIRE_ENABLED", ["DD_TRACE_Hangfire_ENABLED", "DD_Hangfire_ENABLED"]), "OpenFeature" => new("DD_TRACE_OPENFEATURE_ENABLED", ["DD_TRACE_OpenFeature_ENABLED", "DD_OpenFeature_ENABLED"]), + "ServerlessCompat" => new("DD_TRACE_SERVERLESSCOMPAT_ENABLED", ["DD_TRACE_ServerlessCompat_ENABLED", "DD_ServerlessCompat_ENABLED"]), _ => GetIntegrationEnabledKeysFallback(integrationName) // we should never get here }; /// @@ -439,6 +443,7 @@ public static System.Collections.Generic.KeyValuePair GetInteg "DatadogTraceVersionConflict" => new("DD_TRACE_DATADOGTRACEVERSIONCONFLICT_ANALYTICS_ENABLED", ["DD_TRACE_DatadogTraceVersionConflict_ANALYTICS_ENABLED", "DD_DatadogTraceVersionConflict_ANALYTICS_ENABLED"]), "Hangfire" => new("DD_TRACE_HANGFIRE_ANALYTICS_ENABLED", ["DD_TRACE_Hangfire_ANALYTICS_ENABLED", "DD_Hangfire_ANALYTICS_ENABLED"]), "OpenFeature" => new("DD_TRACE_OPENFEATURE_ANALYTICS_ENABLED", ["DD_TRACE_OpenFeature_ANALYTICS_ENABLED", "DD_OpenFeature_ANALYTICS_ENABLED"]), + "ServerlessCompat" => new("DD_TRACE_SERVERLESSCOMPAT_ANALYTICS_ENABLED", ["DD_TRACE_ServerlessCompat_ANALYTICS_ENABLED", "DD_ServerlessCompat_ANALYTICS_ENABLED"]), _ => GetIntegrationAnalyticsEnabledKeysFallback(integrationName) // we should never get here }; /// @@ -530,6 +535,7 @@ public static System.Collections.Generic.KeyValuePair GetInteg "DatadogTraceVersionConflict" => new("DD_TRACE_DATADOGTRACEVERSIONCONFLICT_ANALYTICS_SAMPLE_RATE", ["DD_TRACE_DatadogTraceVersionConflict_ANALYTICS_SAMPLE_RATE", "DD_DatadogTraceVersionConflict_ANALYTICS_SAMPLE_RATE"]), "Hangfire" => new("DD_TRACE_HANGFIRE_ANALYTICS_SAMPLE_RATE", ["DD_TRACE_Hangfire_ANALYTICS_SAMPLE_RATE", "DD_Hangfire_ANALYTICS_SAMPLE_RATE"]), "OpenFeature" => new("DD_TRACE_OPENFEATURE_ANALYTICS_SAMPLE_RATE", ["DD_TRACE_OpenFeature_ANALYTICS_SAMPLE_RATE", "DD_OpenFeature_ANALYTICS_SAMPLE_RATE"]), + "ServerlessCompat" => new("DD_TRACE_SERVERLESSCOMPAT_ANALYTICS_SAMPLE_RATE", ["DD_TRACE_ServerlessCompat_ANALYTICS_SAMPLE_RATE", "DD_ServerlessCompat_ANALYTICS_SAMPLE_RATE"]), _ => GetIntegrationAnalyticsSampleRateKeysFallback(integrationName) // we should never get here }; diff --git a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs index bfaf729c064b..074a939c1ce9 100644 --- a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs @@ -11,7 +11,7 @@ namespace Datadog.Trace.Telemetry; internal sealed partial class CiVisibilityMetricsTelemetryCollector { - private const int CountSharedLength = 336; + private const int CountSharedLength = 340; /// /// Creates the buffer for the values. @@ -356,6 +356,10 @@ private static AggregatedMetric[] GetCountSharedBuffer() new(new[] { "integration_name:hangfire", "error_type:invoker" }), new(new[] { "integration_name:hangfire", "error_type:execution" }), new(new[] { "integration_name:hangfire", "error_type:missing_member" }), + new(new[] { "integration_name:serverlesscompat", "error_type:duck_typing" }), + new(new[] { "integration_name:serverlesscompat", "error_type:invoker" }), + new(new[] { "integration_name:serverlesscompat", "error_type:execution" }), + new(new[] { "integration_name:serverlesscompat", "error_type:missing_member" }), }; /// @@ -364,7 +368,7 @@ private static AggregatedMetric[] GetCountSharedBuffer() /// It is equal to the cardinality of the tag combinations (or 1 if there are no tags) /// private static int[] CountSharedEntryCounts { get; } - = new int[]{ 336, }; + = new int[]{ 340, }; public void RecordCountSharedIntegrationsError(Datadog.Trace.Telemetry.Metrics.MetricTags.IntegrationName tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.InstrumentationError tag2, int increment = 1) { diff --git a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs index e382010a658c..8cc8110fcc6a 100644 --- a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs @@ -11,7 +11,7 @@ namespace Datadog.Trace.Telemetry; internal sealed partial class MetricsTelemetryCollector { - private const int CountLength = 656; + private const int CountLength = 658; /// /// Creates the buffer for the values. @@ -109,35 +109,36 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "integration_name:emailhtmlinjection" }), new(new[] { "integration_name:protobuf" }), new(new[] { "integration_name:hangfire" }), - // spans_finished, index = 88 + new(new[] { "integration_name:serverlesscompat" }), + // spans_finished, index = 89 new(null), - // spans_enqueued_for_serialization, index = 89 + // spans_enqueued_for_serialization, index = 90 new(new[] { "reason:p0_keep" }), new(new[] { "reason:single_span_sampling" }), new(new[] { "reason:default" }), - // spans_dropped, index = 92 + // spans_dropped, index = 93 new(new[] { "reason:p0_drop" }), new(new[] { "reason:overfull_buffer" }), new(new[] { "reason:serialization_error" }), new(new[] { "reason:api_error" }), - // trace_segments_created, index = 96 + // trace_segments_created, index = 97 new(new[] { "new_continued:new" }), new(new[] { "new_continued:continued" }), - // trace_chunks_enqueued_for_serialization, index = 98 + // trace_chunks_enqueued_for_serialization, index = 99 new(new[] { "reason:p0_keep" }), new(new[] { "reason:default" }), - // trace_chunks_dropped, index = 100 + // trace_chunks_dropped, index = 101 new(new[] { "reason:p0_drop" }), new(new[] { "reason:overfull_buffer" }), new(new[] { "reason:serialization_error" }), new(new[] { "reason:api_error" }), - // trace_chunks_sent, index = 104 + // trace_chunks_sent, index = 105 new(null), - // trace_segments_closed, index = 105 + // trace_segments_closed, index = 106 new(null), - // trace_api.requests, index = 106 + // trace_api.requests, index = 107 new(null), - // trace_api.responses, index = 107 + // trace_api.responses, index = 108 new(new[] { "status_code:200" }), new(new[] { "status_code:201" }), new(new[] { "status_code:202" }), @@ -160,33 +161,33 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "status_code:503" }), new(new[] { "status_code:504" }), new(new[] { "status_code:5xx" }), - // trace_api.errors, index = 129 + // trace_api.errors, index = 130 new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // trace_partial_flush.count, index = 132 + // trace_partial_flush.count, index = 133 new(new[] { "reason:large_trace" }), new(new[] { "reason:single_span_ingestion" }), - // context_header_style.injected, index = 134 + // context_header_style.injected, index = 135 new(new[] { "header_style:tracecontext" }), new(new[] { "header_style:datadog" }), new(new[] { "header_style:b3multi" }), new(new[] { "header_style:b3single" }), new(new[] { "header_style:baggage" }), - // context_header_style.extracted, index = 139 + // context_header_style.extracted, index = 140 new(new[] { "header_style:tracecontext" }), new(new[] { "header_style:datadog" }), new(new[] { "header_style:b3multi" }), new(new[] { "header_style:b3single" }), new(new[] { "header_style:baggage" }), - // context_header.truncated, index = 144 + // context_header.truncated, index = 145 new(new[] { "truncation_reason:baggage_item_count_exceeded" }), new(new[] { "truncation_reason:baggage_byte_count_exceeded" }), - // context_header_style.malformed, index = 146 + // context_header_style.malformed, index = 147 new(new[] { "header_style:baggage" }), - // stats_api.requests, index = 147 + // stats_api.requests, index = 148 new(null), - // stats_api.responses, index = 148 + // stats_api.responses, index = 149 new(new[] { "status_code:200" }), new(new[] { "status_code:201" }), new(new[] { "status_code:202" }), @@ -209,11 +210,11 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "status_code:503" }), new(new[] { "status_code:504" }), new(new[] { "status_code:5xx" }), - // stats_api.errors, index = 170 + // stats_api.errors, index = 171 new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // otel.env.hiding, index = 173 + // otel.env.hiding, index = 174 new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_log_level" }), new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_metrics_exporter" }), new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_propagators" }), @@ -304,7 +305,7 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_traces_sampler" }), new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_traces_sampler_arg" }), new(new[] { "config_datadog:unknown", "config_opentelemetry:unknown" }), - // otel.env.invalid, index = 263 + // otel.env.invalid, index = 264 new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_log_level" }), new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_metrics_exporter" }), new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_propagators" }), @@ -395,30 +396,30 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_traces_sampler" }), new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_traces_sampler_arg" }), new(new[] { "config_datadog:unknown", "config_opentelemetry:unknown" }), - // otel.metrics_export_attempts, index = 353 + // otel.metrics_export_attempts, index = 354 new(new[] { "protocol:grpc", "encoding:protobuf" }), new(new[] { "protocol:grpc", "encoding:json" }), new(new[] { "protocol:http", "encoding:protobuf" }), new(new[] { "protocol:http", "encoding:json" }), - // otel.metrics_export_successes, index = 357 + // otel.metrics_export_successes, index = 358 new(new[] { "protocol:grpc", "encoding:protobuf" }), new(new[] { "protocol:grpc", "encoding:json" }), new(new[] { "protocol:http", "encoding:protobuf" }), new(new[] { "protocol:http", "encoding:json" }), - // otel.metrics_export_partial_successes, index = 361 + // otel.metrics_export_partial_successes, index = 362 new(new[] { "protocol:grpc", "encoding:protobuf" }), new(new[] { "protocol:grpc", "encoding:json" }), new(new[] { "protocol:http", "encoding:protobuf" }), new(new[] { "protocol:http", "encoding:json" }), - // otel.metrics_export_failures, index = 365 + // otel.metrics_export_failures, index = 366 new(new[] { "protocol:grpc", "encoding:protobuf" }), new(new[] { "protocol:grpc", "encoding:json" }), new(new[] { "protocol:http", "encoding:protobuf" }), new(new[] { "protocol:http", "encoding:json" }), - // telemetry_api.requests, index = 369 + // telemetry_api.requests, index = 370 new(new[] { "endpoint:agent" }), new(new[] { "endpoint:agentless" }), - // telemetry_api.responses, index = 371 + // telemetry_api.responses, index = 372 new(new[] { "endpoint:agent", "status_code:200" }), new(new[] { "endpoint:agent", "status_code:201" }), new(new[] { "endpoint:agent", "status_code:202" }), @@ -463,18 +464,18 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "endpoint:agentless", "status_code:503" }), new(new[] { "endpoint:agentless", "status_code:504" }), new(new[] { "endpoint:agentless", "status_code:5xx" }), - // telemetry_api.errors, index = 415 + // telemetry_api.errors, index = 416 new(new[] { "endpoint:agent", "type:timeout" }), new(new[] { "endpoint:agent", "type:network" }), new(new[] { "endpoint:agent", "type:status_code" }), new(new[] { "endpoint:agentless", "type:timeout" }), new(new[] { "endpoint:agentless", "type:network" }), new(new[] { "endpoint:agentless", "type:status_code" }), - // version_conflict_tracers_created, index = 421 + // version_conflict_tracers_created, index = 422 new(null), - // unsupported_custom_instrumentation_services, index = 422 + // unsupported_custom_instrumentation_services, index = 423 new(null), - // direct_log_logs, index = 423 + // direct_log_logs, index = 424 new(new[] { "integration_name:datadog" }), new(new[] { "integration_name:opentracing" }), new(new[] { "integration_name:version_conflict" }), @@ -559,9 +560,10 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "integration_name:emailhtmlinjection" }), new(new[] { "integration_name:protobuf" }), new(new[] { "integration_name:hangfire" }), - // direct_log_api.requests, index = 507 + new(new[] { "integration_name:serverlesscompat" }), + // direct_log_api.requests, index = 509 new(null), - // direct_log_api.responses, index = 508 + // direct_log_api.responses, index = 510 new(new[] { "status_code:200" }), new(new[] { "status_code:201" }), new(new[] { "status_code:202" }), @@ -584,17 +586,17 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "status_code:503" }), new(new[] { "status_code:504" }), new(new[] { "status_code:5xx" }), - // direct_log_api.errors, index = 530 + // direct_log_api.errors, index = 532 new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // waf.init, index = 533 + // waf.init, index = 535 new(new[] { "waf_version", "event_rules_version", "success:true" }), new(new[] { "waf_version", "event_rules_version", "success:false" }), - // waf.updates, index = 535 + // waf.updates, index = 537 new(new[] { "waf_version", "event_rules_version", "success:true" }), new(new[] { "waf_version", "event_rules_version", "success:false" }), - // waf.requests, index = 537 + // waf.requests, index = 539 new(new[] { "waf_version", "event_rules_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:false", "block_failure:false", "rate_limited:false", "input_truncated:false" }), new(new[] { "waf_version", "event_rules_version", "rule_triggered:true", "request_blocked:false", "waf_timeout:false", "block_failure:false", "rate_limited:false", "input_truncated:false" }), new(new[] { "waf_version", "event_rules_version", "rule_triggered:true", "request_blocked:true", "waf_timeout:false", "block_failure:false", "rate_limited:false", "input_truncated:false" }), @@ -603,17 +605,17 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "waf_version", "event_rules_version", "rule_triggered:true", "request_blocked:false", "waf_timeout:false", "block_failure:false", "rate_limited:false", "input_truncated:true" }), new(new[] { "waf_version", "event_rules_version", "rule_triggered:true", "request_blocked:true", "waf_timeout:false", "block_failure:false", "rate_limited:false", "input_truncated:true" }), new(new[] { "waf_version", "event_rules_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:true", "block_failure:false", "rate_limited:false", "input_truncated:true" }), - // waf.input_truncated, index = 545 + // waf.input_truncated, index = 547 new(new[] { "truncation_reason:string_too_long" }), new(new[] { "truncation_reason:list_or_map_too_large" }), new(new[] { "truncation_reason:object_too_deep" }), - // rasp.rule.eval, index = 548 + // rasp.rule.eval, index = 550 new(new[] { "waf_version", "event_rules_version", "rule_type:lfi" }), new(new[] { "waf_version", "event_rules_version", "rule_type:ssrf" }), new(new[] { "waf_version", "event_rules_version", "rule_type:sql_injection" }), new(new[] { "waf_version", "event_rules_version", "rule_type:command_injection", "rule_variant:shell" }), new(new[] { "waf_version", "event_rules_version", "rule_type:command_injection", "rule_variant:exec" }), - // rasp.rule.match, index = 553 + // rasp.rule.match, index = 555 new(new[] { "waf_version", "event_rules_version", "block:success", "rule_type:lfi" }), new(new[] { "waf_version", "event_rules_version", "block:success", "rule_type:ssrf" }), new(new[] { "waf_version", "event_rules_version", "block:success", "rule_type:sql_injection" }), @@ -629,29 +631,29 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "waf_version", "event_rules_version", "block:irrelevant", "rule_type:sql_injection" }), new(new[] { "waf_version", "event_rules_version", "block:irrelevant", "rule_type:command_injection", "rule_variant:shell" }), new(new[] { "waf_version", "event_rules_version", "block:irrelevant", "rule_type:command_injection", "rule_variant:exec" }), - // rasp.timeout, index = 568 + // rasp.timeout, index = 570 new(new[] { "waf_version", "event_rules_version", "rule_type:lfi" }), new(new[] { "waf_version", "event_rules_version", "rule_type:ssrf" }), new(new[] { "waf_version", "event_rules_version", "rule_type:sql_injection" }), new(new[] { "waf_version", "event_rules_version", "rule_type:command_injection", "rule_variant:shell" }), new(new[] { "waf_version", "event_rules_version", "rule_type:command_injection", "rule_variant:exec" }), - // instrum.user_auth.missing_user_id, index = 573 + // instrum.user_auth.missing_user_id, index = 575 new(new[] { "framework:aspnetcore_identity", "event_type:login_success" }), new(new[] { "framework:aspnetcore_identity", "event_type:login_failure" }), new(new[] { "framework:aspnetcore_identity", "event_type:signup" }), new(new[] { "framework:unknown", "event_type:signup" }), - // instrum.user_auth.missing_user_login, index = 577 + // instrum.user_auth.missing_user_login, index = 579 new(new[] { "framework:aspnetcore_identity", "event_type:login_success" }), new(new[] { "framework:aspnetcore_identity", "event_type:login_failure" }), new(new[] { "framework:aspnetcore_identity", "event_type:signup" }), new(new[] { "framework:unknown", "event_type:signup" }), - // sdk.event, index = 581 + // sdk.event, index = 583 new(new[] { "event_type:login_success", "sdk_version:v1" }), new(new[] { "event_type:login_success", "sdk_version:v2" }), new(new[] { "event_type:login_failure", "sdk_version:v1" }), new(new[] { "event_type:login_failure", "sdk_version:v2" }), new(new[] { "event_type:custom", "sdk_version:v1" }), - // executed.source, index = 586 + // executed.source, index = 588 new(new[] { "source_type:http.request.body" }), new(new[] { "source_type:http.request.path" }), new(new[] { "source_type:http.request.parameter.name" }), @@ -666,9 +668,9 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "source_type:http.request.uri" }), new(new[] { "source_type:grpc.request.body" }), new(new[] { "source_type:sql.row.value" }), - // executed.propagation, index = 600 + // executed.propagation, index = 602 new(null), - // executed.sink, index = 601 + // executed.sink, index = 603 new(new[] { "vulnerability_type:none" }), new(new[] { "vulnerability_type:weak_cipher" }), new(new[] { "vulnerability_type:weak_hash" }), @@ -696,9 +698,9 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "vulnerability_type:directory_listing_leak" }), new(new[] { "vulnerability_type:session_timeout" }), new(new[] { "vulnerability_type:email_html_injection" }), - // request.tainted, index = 628 + // request.tainted, index = 630 new(null), - // suppressed.vulnerabilities, index = 629 + // suppressed.vulnerabilities, index = 631 new(new[] { "vulnerability_type:none" }), new(new[] { "vulnerability_type:weak_cipher" }), new(new[] { "vulnerability_type:weak_hash" }), @@ -734,7 +736,7 @@ private static AggregatedMetric[] GetCountBuffer() /// It is equal to the cardinality of the tag combinations (or 1 if there are no tags) /// private static int[] CountEntryCounts { get; } - = new int[]{ 4, 84, 1, 3, 4, 2, 2, 4, 1, 1, 1, 22, 3, 2, 5, 5, 2, 1, 1, 22, 3, 90, 90, 4, 4, 4, 4, 2, 44, 6, 1, 1, 84, 1, 22, 3, 2, 2, 8, 3, 5, 15, 5, 4, 4, 5, 14, 1, 27, 1, 27, }; + = new int[]{ 4, 85, 1, 3, 4, 2, 2, 4, 1, 1, 1, 22, 3, 2, 5, 5, 2, 1, 1, 22, 3, 90, 90, 4, 4, 4, 4, 2, 44, 6, 1, 1, 85, 1, 22, 3, 2, 2, 8, 3, 5, 15, 5, 4, 4, 5, 14, 1, 27, 1, 27, }; public void RecordCountLogCreated(Datadog.Trace.Telemetry.Metrics.MetricTags.LogLevel tag, int increment = 1) { @@ -750,285 +752,285 @@ public void RecordCountSpanCreated(Datadog.Trace.Telemetry.Metrics.MetricTags.In public void RecordCountSpanFinished(int increment = 1) { - Interlocked.Add(ref _buffer.Count[88], increment); + Interlocked.Add(ref _buffer.Count[89], increment); } public void RecordCountSpanEnqueuedForSerialization(Datadog.Trace.Telemetry.Metrics.MetricTags.SpanEnqueueReason tag, int increment = 1) { - var index = 89 + (int)tag; + var index = 90 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountSpanDropped(Datadog.Trace.Telemetry.Metrics.MetricTags.DropReason tag, int increment = 1) { - var index = 92 + (int)tag; + var index = 93 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceSegmentCreated(Datadog.Trace.Telemetry.Metrics.MetricTags.TraceContinuation tag, int increment = 1) { - var index = 96 + (int)tag; + var index = 97 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceChunkEnqueued(Datadog.Trace.Telemetry.Metrics.MetricTags.TraceChunkEnqueueReason tag, int increment = 1) { - var index = 98 + (int)tag; + var index = 99 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceChunkDropped(Datadog.Trace.Telemetry.Metrics.MetricTags.DropReason tag, int increment = 1) { - var index = 100 + (int)tag; + var index = 101 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceChunkSent(int increment = 1) { - Interlocked.Add(ref _buffer.Count[104], increment); + Interlocked.Add(ref _buffer.Count[105], increment); } public void RecordCountTraceSegmentsClosed(int increment = 1) { - Interlocked.Add(ref _buffer.Count[105], increment); + Interlocked.Add(ref _buffer.Count[106], increment); } public void RecordCountTraceApiRequests(int increment = 1) { - Interlocked.Add(ref _buffer.Count[106], increment); + Interlocked.Add(ref _buffer.Count[107], increment); } public void RecordCountTraceApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag, int increment = 1) { - var index = 107 + (int)tag; + var index = 108 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1) { - var index = 129 + (int)tag; + var index = 130 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTracePartialFlush(Datadog.Trace.Telemetry.Metrics.MetricTags.PartialFlushReason tag, int increment = 1) { - var index = 132 + (int)tag; + var index = 133 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountContextHeaderStyleInjected(Datadog.Trace.Telemetry.Metrics.MetricTags.ContextHeaderStyle tag, int increment = 1) { - var index = 134 + (int)tag; + var index = 135 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountContextHeaderStyleExtracted(Datadog.Trace.Telemetry.Metrics.MetricTags.ContextHeaderStyle tag, int increment = 1) { - var index = 139 + (int)tag; + var index = 140 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountContextHeaderTruncated(Datadog.Trace.Telemetry.Metrics.MetricTags.ContextHeaderTruncationReason tag, int increment = 1) { - var index = 144 + (int)tag; + var index = 145 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountContextHeaderMalformed(Datadog.Trace.Telemetry.Metrics.MetricTags.ContextHeaderMalformed tag, int increment = 1) { - var index = 146 + (int)tag; + var index = 147 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountStatsApiRequests(int increment = 1) { - Interlocked.Add(ref _buffer.Count[147], increment); + Interlocked.Add(ref _buffer.Count[148], increment); } public void RecordCountStatsApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag, int increment = 1) { - var index = 148 + (int)tag; + var index = 149 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountStatsApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1) { - var index = 170 + (int)tag; + var index = 171 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountOpenTelemetryConfigHiddenByDatadogConfig(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1) { - var index = 173 + ((int)tag1 * 10) + (int)tag2; + var index = 174 + ((int)tag1 * 10) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountOpenTelemetryConfigInvalid(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1) { - var index = 263 + ((int)tag1 * 10) + (int)tag2; + var index = 264 + ((int)tag1 * 10) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountMetricsExportAttempts(Datadog.Trace.Telemetry.Metrics.MetricTags.Protocol tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.MetricEncoding tag2, int increment = 1) { - var index = 353 + ((int)tag1 * 2) + (int)tag2; + var index = 354 + ((int)tag1 * 2) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountMetricsExportSuccesses(Datadog.Trace.Telemetry.Metrics.MetricTags.Protocol tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.MetricEncoding tag2, int increment = 1) { - var index = 357 + ((int)tag1 * 2) + (int)tag2; + var index = 358 + ((int)tag1 * 2) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountMetricsExportPartialSuccesses(Datadog.Trace.Telemetry.Metrics.MetricTags.Protocol tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.MetricEncoding tag2, int increment = 1) { - var index = 361 + ((int)tag1 * 2) + (int)tag2; + var index = 362 + ((int)tag1 * 2) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountMetricsExportFailures(Datadog.Trace.Telemetry.Metrics.MetricTags.Protocol tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.MetricEncoding tag2, int increment = 1) { - var index = 365 + ((int)tag1 * 2) + (int)tag2; + var index = 366 + ((int)tag1 * 2) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTelemetryApiRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag, int increment = 1) { - var index = 369 + (int)tag; + var index = 370 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTelemetryApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag2, int increment = 1) { - var index = 371 + ((int)tag1 * 22) + (int)tag2; + var index = 372 + ((int)tag1 * 22) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTelemetryApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag2, int increment = 1) { - var index = 415 + ((int)tag1 * 3) + (int)tag2; + var index = 416 + ((int)tag1 * 3) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountVersionConflictTracerCreated(int increment = 1) { - Interlocked.Add(ref _buffer.Count[421], increment); + Interlocked.Add(ref _buffer.Count[422], increment); } public void RecordCountUnsupportedCustomInstrumentationServices(int increment = 1) { - Interlocked.Add(ref _buffer.Count[422], increment); + Interlocked.Add(ref _buffer.Count[423], increment); } public void RecordCountDirectLogLogs(Datadog.Trace.Telemetry.Metrics.MetricTags.IntegrationName tag, int increment = 1) { - var index = 423 + (int)tag; + var index = 424 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountDirectLogApiRequests(int increment = 1) { - Interlocked.Add(ref _buffer.Count[507], increment); + Interlocked.Add(ref _buffer.Count[509], increment); } public void RecordCountDirectLogApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag, int increment = 1) { - var index = 508 + (int)tag; + var index = 510 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountDirectLogApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1) { - var index = 530 + (int)tag; + var index = 532 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountWafInit(Datadog.Trace.Telemetry.Metrics.MetricTags.WafStatus tag, int increment = 1) { - var index = 533 + (int)tag; + var index = 535 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountWafUpdates(Datadog.Trace.Telemetry.Metrics.MetricTags.WafStatus tag, int increment = 1) { - var index = 535 + (int)tag; + var index = 537 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountWafRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.WafAnalysis tag, int increment = 1) { - var index = 537 + (int)tag; + var index = 539 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountInputTruncated(Datadog.Trace.Telemetry.Metrics.MetricTags.TruncationReason tag, int increment = 1) { - var index = 545 + (int)tag; + var index = 547 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountRaspRuleEval(Datadog.Trace.Telemetry.Metrics.MetricTags.RaspRuleType tag, int increment = 1) { - var index = 548 + (int)tag; + var index = 550 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountRaspRuleMatch(Datadog.Trace.Telemetry.Metrics.MetricTags.RaspRuleTypeMatch tag, int increment = 1) { - var index = 553 + (int)tag; + var index = 555 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountRaspTimeout(Datadog.Trace.Telemetry.Metrics.MetricTags.RaspRuleType tag, int increment = 1) { - var index = 568 + (int)tag; + var index = 570 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountMissingUserId(Datadog.Trace.Telemetry.Metrics.MetricTags.AuthenticationFrameworkWithEventType tag, int increment = 1) { - var index = 573 + (int)tag; + var index = 575 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountMissingUserLogin(Datadog.Trace.Telemetry.Metrics.MetricTags.AuthenticationFrameworkWithEventType tag, int increment = 1) { - var index = 577 + (int)tag; + var index = 579 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountUserEventSdk(Datadog.Trace.Telemetry.Metrics.MetricTags.UserEventSdk tag, int increment = 1) { - var index = 581 + (int)tag; + var index = 583 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastExecutedSources(Datadog.Trace.Telemetry.Metrics.MetricTags.IastSourceType tag, int increment = 1) { - var index = 586 + (int)tag; + var index = 588 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastExecutedPropagations(int increment = 1) { - Interlocked.Add(ref _buffer.Count[600], increment); + Interlocked.Add(ref _buffer.Count[602], increment); } public void RecordCountIastExecutedSinks(Datadog.Trace.Telemetry.Metrics.MetricTags.IastVulnerabilityType tag, int increment = 1) { - var index = 601 + (int)tag; + var index = 603 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastRequestTainted(int increment = 1) { - Interlocked.Add(ref _buffer.Count[628], increment); + Interlocked.Add(ref _buffer.Count[630], increment); } public void RecordCountIastSuppressedVulnerabilities(Datadog.Trace.Telemetry.Metrics.MetricTags.IastVulnerabilityType tag, int increment = 1) { - var index = 629 + (int)tag; + var index = 631 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } } \ No newline at end of file diff --git a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs index d60501e4f45d..82355f89f551 100644 --- a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs @@ -11,7 +11,7 @@ namespace Datadog.Trace.Telemetry; internal sealed partial class MetricsTelemetryCollector { - private const int CountSharedLength = 336; + private const int CountSharedLength = 340; /// /// Creates the buffer for the values. @@ -356,6 +356,10 @@ private static AggregatedMetric[] GetCountSharedBuffer() new(new[] { "integration_name:hangfire", "error_type:invoker" }), new(new[] { "integration_name:hangfire", "error_type:execution" }), new(new[] { "integration_name:hangfire", "error_type:missing_member" }), + new(new[] { "integration_name:serverlesscompat", "error_type:duck_typing" }), + new(new[] { "integration_name:serverlesscompat", "error_type:invoker" }), + new(new[] { "integration_name:serverlesscompat", "error_type:execution" }), + new(new[] { "integration_name:serverlesscompat", "error_type:missing_member" }), }; /// @@ -364,7 +368,7 @@ private static AggregatedMetric[] GetCountSharedBuffer() /// It is equal to the cardinality of the tag combinations (or 1 if there are no tags) /// private static int[] CountSharedEntryCounts { get; } - = new int[]{ 336, }; + = new int[]{ 340, }; public void RecordCountSharedIntegrationsError(Datadog.Trace.Telemetry.Metrics.MetricTags.IntegrationName tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.InstrumentationError tag2, int increment = 1) { diff --git a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/ConfigurationKeysGenerator/ConfigurationKeys.g.cs b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/ConfigurationKeysGenerator/ConfigurationKeys.g.cs index 1926eaef1500..04a795504c87 100644 --- a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/ConfigurationKeysGenerator/ConfigurationKeys.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/ConfigurationKeysGenerator/ConfigurationKeys.g.cs @@ -242,6 +242,13 @@ internal static partial class ConfigurationKeys /// public const string RuntimeMetricsEnabled = "DD_RUNTIME_METRICS_ENABLED"; + /// + /// Overrides the default path to the serverless compatibility layer binary. + /// Default value in windows is C:\home\site\wwwroot\datadog\bin\windows-amd64\datadog-serverless-compat.exe. + /// Default value in linux is /bin/linux-amd64/datadog-serverless-compat. + /// + public const string ServerlessCompatPath = "DD_SERVERLESS_COMPAT_PATH"; + /// /// Configuration key for the application's default service name. /// Used as the service name for top-level spans, diff --git a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs index 3c9c56bf7d70..cfc3e86ece7b 100644 --- a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs @@ -17,7 +17,7 @@ internal static partial class IntegrationIdExtensions /// The number of members in the enum. /// This is a non-distinct count of defined names. /// - public const int Length = 79; + public const int Length = 80; /// /// Returns the string representation of the value. @@ -109,6 +109,7 @@ public static string ToStringFast(this Datadog.Trace.Configuration.IntegrationId Datadog.Trace.Configuration.IntegrationId.DatadogTraceVersionConflict => nameof(Datadog.Trace.Configuration.IntegrationId.DatadogTraceVersionConflict), Datadog.Trace.Configuration.IntegrationId.Hangfire => nameof(Datadog.Trace.Configuration.IntegrationId.Hangfire), Datadog.Trace.Configuration.IntegrationId.OpenFeature => nameof(Datadog.Trace.Configuration.IntegrationId.OpenFeature), + Datadog.Trace.Configuration.IntegrationId.ServerlessCompat => nameof(Datadog.Trace.Configuration.IntegrationId.ServerlessCompat), _ => value.ToString(), }; @@ -201,6 +202,7 @@ public static Datadog.Trace.Configuration.IntegrationId[] GetValues() Datadog.Trace.Configuration.IntegrationId.DatadogTraceVersionConflict, Datadog.Trace.Configuration.IntegrationId.Hangfire, Datadog.Trace.Configuration.IntegrationId.OpenFeature, + Datadog.Trace.Configuration.IntegrationId.ServerlessCompat, }; /// @@ -293,5 +295,6 @@ public static string[] GetNames() nameof(Datadog.Trace.Configuration.IntegrationId.DatadogTraceVersionConflict), nameof(Datadog.Trace.Configuration.IntegrationId.Hangfire), nameof(Datadog.Trace.Configuration.IntegrationId.OpenFeature), + nameof(Datadog.Trace.Configuration.IntegrationId.ServerlessCompat), }; } \ No newline at end of file diff --git a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationNameToKeys.g.cs b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationNameToKeys.g.cs index 937b0fffb12c..1082a62da2ba 100644 --- a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationNameToKeys.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationNameToKeys.g.cs @@ -259,6 +259,9 @@ public static string[] GetAllIntegrationEnabledKeys() => "DD_TRACE_OPENFEATURE_ENABLED", "DD_TRACE_OpenFeature_ENABLED", "DD_OpenFeature_ENABLED", "DD_TRACE_OPENFEATURE_ANALYTICS_ENABLED", "DD_TRACE_OpenFeature_ANALYTICS_ENABLED", "DD_OpenFeature_ANALYTICS_ENABLED", "DD_TRACE_OPENFEATURE_ANALYTICS_SAMPLE_RATE", "DD_TRACE_OpenFeature_ANALYTICS_SAMPLE_RATE", "DD_OpenFeature_ANALYTICS_SAMPLE_RATE", + "DD_TRACE_SERVERLESSCOMPAT_ENABLED", "DD_TRACE_ServerlessCompat_ENABLED", "DD_ServerlessCompat_ENABLED", + "DD_TRACE_SERVERLESSCOMPAT_ANALYTICS_ENABLED", "DD_TRACE_ServerlessCompat_ANALYTICS_ENABLED", "DD_ServerlessCompat_ANALYTICS_ENABLED", + "DD_TRACE_SERVERLESSCOMPAT_ANALYTICS_SAMPLE_RATE", "DD_TRACE_ServerlessCompat_ANALYTICS_SAMPLE_RATE", "DD_ServerlessCompat_ANALYTICS_SAMPLE_RATE", ]; /// /// Gets the configuration keys for the specified integration name. @@ -348,6 +351,7 @@ public static System.Collections.Generic.KeyValuePair GetInteg "DatadogTraceVersionConflict" => new("DD_TRACE_DATADOGTRACEVERSIONCONFLICT_ENABLED", ["DD_TRACE_DatadogTraceVersionConflict_ENABLED", "DD_DatadogTraceVersionConflict_ENABLED"]), "Hangfire" => new("DD_TRACE_HANGFIRE_ENABLED", ["DD_TRACE_Hangfire_ENABLED", "DD_Hangfire_ENABLED"]), "OpenFeature" => new("DD_TRACE_OPENFEATURE_ENABLED", ["DD_TRACE_OpenFeature_ENABLED", "DD_OpenFeature_ENABLED"]), + "ServerlessCompat" => new("DD_TRACE_SERVERLESSCOMPAT_ENABLED", ["DD_TRACE_ServerlessCompat_ENABLED", "DD_ServerlessCompat_ENABLED"]), _ => GetIntegrationEnabledKeysFallback(integrationName) // we should never get here }; /// @@ -439,6 +443,7 @@ public static System.Collections.Generic.KeyValuePair GetInteg "DatadogTraceVersionConflict" => new("DD_TRACE_DATADOGTRACEVERSIONCONFLICT_ANALYTICS_ENABLED", ["DD_TRACE_DatadogTraceVersionConflict_ANALYTICS_ENABLED", "DD_DatadogTraceVersionConflict_ANALYTICS_ENABLED"]), "Hangfire" => new("DD_TRACE_HANGFIRE_ANALYTICS_ENABLED", ["DD_TRACE_Hangfire_ANALYTICS_ENABLED", "DD_Hangfire_ANALYTICS_ENABLED"]), "OpenFeature" => new("DD_TRACE_OPENFEATURE_ANALYTICS_ENABLED", ["DD_TRACE_OpenFeature_ANALYTICS_ENABLED", "DD_OpenFeature_ANALYTICS_ENABLED"]), + "ServerlessCompat" => new("DD_TRACE_SERVERLESSCOMPAT_ANALYTICS_ENABLED", ["DD_TRACE_ServerlessCompat_ANALYTICS_ENABLED", "DD_ServerlessCompat_ANALYTICS_ENABLED"]), _ => GetIntegrationAnalyticsEnabledKeysFallback(integrationName) // we should never get here }; /// @@ -530,6 +535,7 @@ public static System.Collections.Generic.KeyValuePair GetInteg "DatadogTraceVersionConflict" => new("DD_TRACE_DATADOGTRACEVERSIONCONFLICT_ANALYTICS_SAMPLE_RATE", ["DD_TRACE_DatadogTraceVersionConflict_ANALYTICS_SAMPLE_RATE", "DD_DatadogTraceVersionConflict_ANALYTICS_SAMPLE_RATE"]), "Hangfire" => new("DD_TRACE_HANGFIRE_ANALYTICS_SAMPLE_RATE", ["DD_TRACE_Hangfire_ANALYTICS_SAMPLE_RATE", "DD_Hangfire_ANALYTICS_SAMPLE_RATE"]), "OpenFeature" => new("DD_TRACE_OPENFEATURE_ANALYTICS_SAMPLE_RATE", ["DD_TRACE_OpenFeature_ANALYTICS_SAMPLE_RATE", "DD_OpenFeature_ANALYTICS_SAMPLE_RATE"]), + "ServerlessCompat" => new("DD_TRACE_SERVERLESSCOMPAT_ANALYTICS_SAMPLE_RATE", ["DD_TRACE_ServerlessCompat_ANALYTICS_SAMPLE_RATE", "DD_ServerlessCompat_ANALYTICS_SAMPLE_RATE"]), _ => GetIntegrationAnalyticsSampleRateKeysFallback(integrationName) // we should never get here }; diff --git a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs index 378f71fa6a43..12685db7a87e 100644 --- a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs @@ -624,6 +624,9 @@ internal static bool IsInstrumentedAssembly(string assemblyName) or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Logging.Serilog.LogsInjection.LoggerDispatchInstrumentation" or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Logging.Serilog.DirectSubmission.LoggerConfigurationInstrumentation" => Datadog.Trace.Configuration.IntegrationId.Serilog, + "Datadog.Trace.ClrProfiler.AutoInstrumentation.Serverless.CompatibilityLayer_CalculateDogStatsDPipeName_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Serverless.CompatibilityLayer_CalculateTracePipeName_Integration" + => Datadog.Trace.Configuration.IntegrationId.ServerlessCompat, "Datadog.Trace.ClrProfiler.AutoInstrumentation.Redis.ServiceStack.RedisNativeClientSendReceiveIntegration" or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Redis.ServiceStack.RedisNativeClientSendReceiveIntegration_6_2_0" => Datadog.Trace.Configuration.IntegrationId.ServiceStackRedis, diff --git a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs index bfaf729c064b..074a939c1ce9 100644 --- a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs @@ -11,7 +11,7 @@ namespace Datadog.Trace.Telemetry; internal sealed partial class CiVisibilityMetricsTelemetryCollector { - private const int CountSharedLength = 336; + private const int CountSharedLength = 340; /// /// Creates the buffer for the values. @@ -356,6 +356,10 @@ private static AggregatedMetric[] GetCountSharedBuffer() new(new[] { "integration_name:hangfire", "error_type:invoker" }), new(new[] { "integration_name:hangfire", "error_type:execution" }), new(new[] { "integration_name:hangfire", "error_type:missing_member" }), + new(new[] { "integration_name:serverlesscompat", "error_type:duck_typing" }), + new(new[] { "integration_name:serverlesscompat", "error_type:invoker" }), + new(new[] { "integration_name:serverlesscompat", "error_type:execution" }), + new(new[] { "integration_name:serverlesscompat", "error_type:missing_member" }), }; /// @@ -364,7 +368,7 @@ private static AggregatedMetric[] GetCountSharedBuffer() /// It is equal to the cardinality of the tag combinations (or 1 if there are no tags) /// private static int[] CountSharedEntryCounts { get; } - = new int[]{ 336, }; + = new int[]{ 340, }; public void RecordCountSharedIntegrationsError(Datadog.Trace.Telemetry.Metrics.MetricTags.IntegrationName tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.InstrumentationError tag2, int increment = 1) { diff --git a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs index e382010a658c..8cc8110fcc6a 100644 --- a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs @@ -11,7 +11,7 @@ namespace Datadog.Trace.Telemetry; internal sealed partial class MetricsTelemetryCollector { - private const int CountLength = 656; + private const int CountLength = 658; /// /// Creates the buffer for the values. @@ -109,35 +109,36 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "integration_name:emailhtmlinjection" }), new(new[] { "integration_name:protobuf" }), new(new[] { "integration_name:hangfire" }), - // spans_finished, index = 88 + new(new[] { "integration_name:serverlesscompat" }), + // spans_finished, index = 89 new(null), - // spans_enqueued_for_serialization, index = 89 + // spans_enqueued_for_serialization, index = 90 new(new[] { "reason:p0_keep" }), new(new[] { "reason:single_span_sampling" }), new(new[] { "reason:default" }), - // spans_dropped, index = 92 + // spans_dropped, index = 93 new(new[] { "reason:p0_drop" }), new(new[] { "reason:overfull_buffer" }), new(new[] { "reason:serialization_error" }), new(new[] { "reason:api_error" }), - // trace_segments_created, index = 96 + // trace_segments_created, index = 97 new(new[] { "new_continued:new" }), new(new[] { "new_continued:continued" }), - // trace_chunks_enqueued_for_serialization, index = 98 + // trace_chunks_enqueued_for_serialization, index = 99 new(new[] { "reason:p0_keep" }), new(new[] { "reason:default" }), - // trace_chunks_dropped, index = 100 + // trace_chunks_dropped, index = 101 new(new[] { "reason:p0_drop" }), new(new[] { "reason:overfull_buffer" }), new(new[] { "reason:serialization_error" }), new(new[] { "reason:api_error" }), - // trace_chunks_sent, index = 104 + // trace_chunks_sent, index = 105 new(null), - // trace_segments_closed, index = 105 + // trace_segments_closed, index = 106 new(null), - // trace_api.requests, index = 106 + // trace_api.requests, index = 107 new(null), - // trace_api.responses, index = 107 + // trace_api.responses, index = 108 new(new[] { "status_code:200" }), new(new[] { "status_code:201" }), new(new[] { "status_code:202" }), @@ -160,33 +161,33 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "status_code:503" }), new(new[] { "status_code:504" }), new(new[] { "status_code:5xx" }), - // trace_api.errors, index = 129 + // trace_api.errors, index = 130 new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // trace_partial_flush.count, index = 132 + // trace_partial_flush.count, index = 133 new(new[] { "reason:large_trace" }), new(new[] { "reason:single_span_ingestion" }), - // context_header_style.injected, index = 134 + // context_header_style.injected, index = 135 new(new[] { "header_style:tracecontext" }), new(new[] { "header_style:datadog" }), new(new[] { "header_style:b3multi" }), new(new[] { "header_style:b3single" }), new(new[] { "header_style:baggage" }), - // context_header_style.extracted, index = 139 + // context_header_style.extracted, index = 140 new(new[] { "header_style:tracecontext" }), new(new[] { "header_style:datadog" }), new(new[] { "header_style:b3multi" }), new(new[] { "header_style:b3single" }), new(new[] { "header_style:baggage" }), - // context_header.truncated, index = 144 + // context_header.truncated, index = 145 new(new[] { "truncation_reason:baggage_item_count_exceeded" }), new(new[] { "truncation_reason:baggage_byte_count_exceeded" }), - // context_header_style.malformed, index = 146 + // context_header_style.malformed, index = 147 new(new[] { "header_style:baggage" }), - // stats_api.requests, index = 147 + // stats_api.requests, index = 148 new(null), - // stats_api.responses, index = 148 + // stats_api.responses, index = 149 new(new[] { "status_code:200" }), new(new[] { "status_code:201" }), new(new[] { "status_code:202" }), @@ -209,11 +210,11 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "status_code:503" }), new(new[] { "status_code:504" }), new(new[] { "status_code:5xx" }), - // stats_api.errors, index = 170 + // stats_api.errors, index = 171 new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // otel.env.hiding, index = 173 + // otel.env.hiding, index = 174 new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_log_level" }), new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_metrics_exporter" }), new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_propagators" }), @@ -304,7 +305,7 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_traces_sampler" }), new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_traces_sampler_arg" }), new(new[] { "config_datadog:unknown", "config_opentelemetry:unknown" }), - // otel.env.invalid, index = 263 + // otel.env.invalid, index = 264 new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_log_level" }), new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_metrics_exporter" }), new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_propagators" }), @@ -395,30 +396,30 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_traces_sampler" }), new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_traces_sampler_arg" }), new(new[] { "config_datadog:unknown", "config_opentelemetry:unknown" }), - // otel.metrics_export_attempts, index = 353 + // otel.metrics_export_attempts, index = 354 new(new[] { "protocol:grpc", "encoding:protobuf" }), new(new[] { "protocol:grpc", "encoding:json" }), new(new[] { "protocol:http", "encoding:protobuf" }), new(new[] { "protocol:http", "encoding:json" }), - // otel.metrics_export_successes, index = 357 + // otel.metrics_export_successes, index = 358 new(new[] { "protocol:grpc", "encoding:protobuf" }), new(new[] { "protocol:grpc", "encoding:json" }), new(new[] { "protocol:http", "encoding:protobuf" }), new(new[] { "protocol:http", "encoding:json" }), - // otel.metrics_export_partial_successes, index = 361 + // otel.metrics_export_partial_successes, index = 362 new(new[] { "protocol:grpc", "encoding:protobuf" }), new(new[] { "protocol:grpc", "encoding:json" }), new(new[] { "protocol:http", "encoding:protobuf" }), new(new[] { "protocol:http", "encoding:json" }), - // otel.metrics_export_failures, index = 365 + // otel.metrics_export_failures, index = 366 new(new[] { "protocol:grpc", "encoding:protobuf" }), new(new[] { "protocol:grpc", "encoding:json" }), new(new[] { "protocol:http", "encoding:protobuf" }), new(new[] { "protocol:http", "encoding:json" }), - // telemetry_api.requests, index = 369 + // telemetry_api.requests, index = 370 new(new[] { "endpoint:agent" }), new(new[] { "endpoint:agentless" }), - // telemetry_api.responses, index = 371 + // telemetry_api.responses, index = 372 new(new[] { "endpoint:agent", "status_code:200" }), new(new[] { "endpoint:agent", "status_code:201" }), new(new[] { "endpoint:agent", "status_code:202" }), @@ -463,18 +464,18 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "endpoint:agentless", "status_code:503" }), new(new[] { "endpoint:agentless", "status_code:504" }), new(new[] { "endpoint:agentless", "status_code:5xx" }), - // telemetry_api.errors, index = 415 + // telemetry_api.errors, index = 416 new(new[] { "endpoint:agent", "type:timeout" }), new(new[] { "endpoint:agent", "type:network" }), new(new[] { "endpoint:agent", "type:status_code" }), new(new[] { "endpoint:agentless", "type:timeout" }), new(new[] { "endpoint:agentless", "type:network" }), new(new[] { "endpoint:agentless", "type:status_code" }), - // version_conflict_tracers_created, index = 421 + // version_conflict_tracers_created, index = 422 new(null), - // unsupported_custom_instrumentation_services, index = 422 + // unsupported_custom_instrumentation_services, index = 423 new(null), - // direct_log_logs, index = 423 + // direct_log_logs, index = 424 new(new[] { "integration_name:datadog" }), new(new[] { "integration_name:opentracing" }), new(new[] { "integration_name:version_conflict" }), @@ -559,9 +560,10 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "integration_name:emailhtmlinjection" }), new(new[] { "integration_name:protobuf" }), new(new[] { "integration_name:hangfire" }), - // direct_log_api.requests, index = 507 + new(new[] { "integration_name:serverlesscompat" }), + // direct_log_api.requests, index = 509 new(null), - // direct_log_api.responses, index = 508 + // direct_log_api.responses, index = 510 new(new[] { "status_code:200" }), new(new[] { "status_code:201" }), new(new[] { "status_code:202" }), @@ -584,17 +586,17 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "status_code:503" }), new(new[] { "status_code:504" }), new(new[] { "status_code:5xx" }), - // direct_log_api.errors, index = 530 + // direct_log_api.errors, index = 532 new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // waf.init, index = 533 + // waf.init, index = 535 new(new[] { "waf_version", "event_rules_version", "success:true" }), new(new[] { "waf_version", "event_rules_version", "success:false" }), - // waf.updates, index = 535 + // waf.updates, index = 537 new(new[] { "waf_version", "event_rules_version", "success:true" }), new(new[] { "waf_version", "event_rules_version", "success:false" }), - // waf.requests, index = 537 + // waf.requests, index = 539 new(new[] { "waf_version", "event_rules_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:false", "block_failure:false", "rate_limited:false", "input_truncated:false" }), new(new[] { "waf_version", "event_rules_version", "rule_triggered:true", "request_blocked:false", "waf_timeout:false", "block_failure:false", "rate_limited:false", "input_truncated:false" }), new(new[] { "waf_version", "event_rules_version", "rule_triggered:true", "request_blocked:true", "waf_timeout:false", "block_failure:false", "rate_limited:false", "input_truncated:false" }), @@ -603,17 +605,17 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "waf_version", "event_rules_version", "rule_triggered:true", "request_blocked:false", "waf_timeout:false", "block_failure:false", "rate_limited:false", "input_truncated:true" }), new(new[] { "waf_version", "event_rules_version", "rule_triggered:true", "request_blocked:true", "waf_timeout:false", "block_failure:false", "rate_limited:false", "input_truncated:true" }), new(new[] { "waf_version", "event_rules_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:true", "block_failure:false", "rate_limited:false", "input_truncated:true" }), - // waf.input_truncated, index = 545 + // waf.input_truncated, index = 547 new(new[] { "truncation_reason:string_too_long" }), new(new[] { "truncation_reason:list_or_map_too_large" }), new(new[] { "truncation_reason:object_too_deep" }), - // rasp.rule.eval, index = 548 + // rasp.rule.eval, index = 550 new(new[] { "waf_version", "event_rules_version", "rule_type:lfi" }), new(new[] { "waf_version", "event_rules_version", "rule_type:ssrf" }), new(new[] { "waf_version", "event_rules_version", "rule_type:sql_injection" }), new(new[] { "waf_version", "event_rules_version", "rule_type:command_injection", "rule_variant:shell" }), new(new[] { "waf_version", "event_rules_version", "rule_type:command_injection", "rule_variant:exec" }), - // rasp.rule.match, index = 553 + // rasp.rule.match, index = 555 new(new[] { "waf_version", "event_rules_version", "block:success", "rule_type:lfi" }), new(new[] { "waf_version", "event_rules_version", "block:success", "rule_type:ssrf" }), new(new[] { "waf_version", "event_rules_version", "block:success", "rule_type:sql_injection" }), @@ -629,29 +631,29 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "waf_version", "event_rules_version", "block:irrelevant", "rule_type:sql_injection" }), new(new[] { "waf_version", "event_rules_version", "block:irrelevant", "rule_type:command_injection", "rule_variant:shell" }), new(new[] { "waf_version", "event_rules_version", "block:irrelevant", "rule_type:command_injection", "rule_variant:exec" }), - // rasp.timeout, index = 568 + // rasp.timeout, index = 570 new(new[] { "waf_version", "event_rules_version", "rule_type:lfi" }), new(new[] { "waf_version", "event_rules_version", "rule_type:ssrf" }), new(new[] { "waf_version", "event_rules_version", "rule_type:sql_injection" }), new(new[] { "waf_version", "event_rules_version", "rule_type:command_injection", "rule_variant:shell" }), new(new[] { "waf_version", "event_rules_version", "rule_type:command_injection", "rule_variant:exec" }), - // instrum.user_auth.missing_user_id, index = 573 + // instrum.user_auth.missing_user_id, index = 575 new(new[] { "framework:aspnetcore_identity", "event_type:login_success" }), new(new[] { "framework:aspnetcore_identity", "event_type:login_failure" }), new(new[] { "framework:aspnetcore_identity", "event_type:signup" }), new(new[] { "framework:unknown", "event_type:signup" }), - // instrum.user_auth.missing_user_login, index = 577 + // instrum.user_auth.missing_user_login, index = 579 new(new[] { "framework:aspnetcore_identity", "event_type:login_success" }), new(new[] { "framework:aspnetcore_identity", "event_type:login_failure" }), new(new[] { "framework:aspnetcore_identity", "event_type:signup" }), new(new[] { "framework:unknown", "event_type:signup" }), - // sdk.event, index = 581 + // sdk.event, index = 583 new(new[] { "event_type:login_success", "sdk_version:v1" }), new(new[] { "event_type:login_success", "sdk_version:v2" }), new(new[] { "event_type:login_failure", "sdk_version:v1" }), new(new[] { "event_type:login_failure", "sdk_version:v2" }), new(new[] { "event_type:custom", "sdk_version:v1" }), - // executed.source, index = 586 + // executed.source, index = 588 new(new[] { "source_type:http.request.body" }), new(new[] { "source_type:http.request.path" }), new(new[] { "source_type:http.request.parameter.name" }), @@ -666,9 +668,9 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "source_type:http.request.uri" }), new(new[] { "source_type:grpc.request.body" }), new(new[] { "source_type:sql.row.value" }), - // executed.propagation, index = 600 + // executed.propagation, index = 602 new(null), - // executed.sink, index = 601 + // executed.sink, index = 603 new(new[] { "vulnerability_type:none" }), new(new[] { "vulnerability_type:weak_cipher" }), new(new[] { "vulnerability_type:weak_hash" }), @@ -696,9 +698,9 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "vulnerability_type:directory_listing_leak" }), new(new[] { "vulnerability_type:session_timeout" }), new(new[] { "vulnerability_type:email_html_injection" }), - // request.tainted, index = 628 + // request.tainted, index = 630 new(null), - // suppressed.vulnerabilities, index = 629 + // suppressed.vulnerabilities, index = 631 new(new[] { "vulnerability_type:none" }), new(new[] { "vulnerability_type:weak_cipher" }), new(new[] { "vulnerability_type:weak_hash" }), @@ -734,7 +736,7 @@ private static AggregatedMetric[] GetCountBuffer() /// It is equal to the cardinality of the tag combinations (or 1 if there are no tags) /// private static int[] CountEntryCounts { get; } - = new int[]{ 4, 84, 1, 3, 4, 2, 2, 4, 1, 1, 1, 22, 3, 2, 5, 5, 2, 1, 1, 22, 3, 90, 90, 4, 4, 4, 4, 2, 44, 6, 1, 1, 84, 1, 22, 3, 2, 2, 8, 3, 5, 15, 5, 4, 4, 5, 14, 1, 27, 1, 27, }; + = new int[]{ 4, 85, 1, 3, 4, 2, 2, 4, 1, 1, 1, 22, 3, 2, 5, 5, 2, 1, 1, 22, 3, 90, 90, 4, 4, 4, 4, 2, 44, 6, 1, 1, 85, 1, 22, 3, 2, 2, 8, 3, 5, 15, 5, 4, 4, 5, 14, 1, 27, 1, 27, }; public void RecordCountLogCreated(Datadog.Trace.Telemetry.Metrics.MetricTags.LogLevel tag, int increment = 1) { @@ -750,285 +752,285 @@ public void RecordCountSpanCreated(Datadog.Trace.Telemetry.Metrics.MetricTags.In public void RecordCountSpanFinished(int increment = 1) { - Interlocked.Add(ref _buffer.Count[88], increment); + Interlocked.Add(ref _buffer.Count[89], increment); } public void RecordCountSpanEnqueuedForSerialization(Datadog.Trace.Telemetry.Metrics.MetricTags.SpanEnqueueReason tag, int increment = 1) { - var index = 89 + (int)tag; + var index = 90 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountSpanDropped(Datadog.Trace.Telemetry.Metrics.MetricTags.DropReason tag, int increment = 1) { - var index = 92 + (int)tag; + var index = 93 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceSegmentCreated(Datadog.Trace.Telemetry.Metrics.MetricTags.TraceContinuation tag, int increment = 1) { - var index = 96 + (int)tag; + var index = 97 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceChunkEnqueued(Datadog.Trace.Telemetry.Metrics.MetricTags.TraceChunkEnqueueReason tag, int increment = 1) { - var index = 98 + (int)tag; + var index = 99 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceChunkDropped(Datadog.Trace.Telemetry.Metrics.MetricTags.DropReason tag, int increment = 1) { - var index = 100 + (int)tag; + var index = 101 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceChunkSent(int increment = 1) { - Interlocked.Add(ref _buffer.Count[104], increment); + Interlocked.Add(ref _buffer.Count[105], increment); } public void RecordCountTraceSegmentsClosed(int increment = 1) { - Interlocked.Add(ref _buffer.Count[105], increment); + Interlocked.Add(ref _buffer.Count[106], increment); } public void RecordCountTraceApiRequests(int increment = 1) { - Interlocked.Add(ref _buffer.Count[106], increment); + Interlocked.Add(ref _buffer.Count[107], increment); } public void RecordCountTraceApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag, int increment = 1) { - var index = 107 + (int)tag; + var index = 108 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1) { - var index = 129 + (int)tag; + var index = 130 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTracePartialFlush(Datadog.Trace.Telemetry.Metrics.MetricTags.PartialFlushReason tag, int increment = 1) { - var index = 132 + (int)tag; + var index = 133 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountContextHeaderStyleInjected(Datadog.Trace.Telemetry.Metrics.MetricTags.ContextHeaderStyle tag, int increment = 1) { - var index = 134 + (int)tag; + var index = 135 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountContextHeaderStyleExtracted(Datadog.Trace.Telemetry.Metrics.MetricTags.ContextHeaderStyle tag, int increment = 1) { - var index = 139 + (int)tag; + var index = 140 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountContextHeaderTruncated(Datadog.Trace.Telemetry.Metrics.MetricTags.ContextHeaderTruncationReason tag, int increment = 1) { - var index = 144 + (int)tag; + var index = 145 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountContextHeaderMalformed(Datadog.Trace.Telemetry.Metrics.MetricTags.ContextHeaderMalformed tag, int increment = 1) { - var index = 146 + (int)tag; + var index = 147 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountStatsApiRequests(int increment = 1) { - Interlocked.Add(ref _buffer.Count[147], increment); + Interlocked.Add(ref _buffer.Count[148], increment); } public void RecordCountStatsApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag, int increment = 1) { - var index = 148 + (int)tag; + var index = 149 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountStatsApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1) { - var index = 170 + (int)tag; + var index = 171 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountOpenTelemetryConfigHiddenByDatadogConfig(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1) { - var index = 173 + ((int)tag1 * 10) + (int)tag2; + var index = 174 + ((int)tag1 * 10) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountOpenTelemetryConfigInvalid(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1) { - var index = 263 + ((int)tag1 * 10) + (int)tag2; + var index = 264 + ((int)tag1 * 10) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountMetricsExportAttempts(Datadog.Trace.Telemetry.Metrics.MetricTags.Protocol tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.MetricEncoding tag2, int increment = 1) { - var index = 353 + ((int)tag1 * 2) + (int)tag2; + var index = 354 + ((int)tag1 * 2) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountMetricsExportSuccesses(Datadog.Trace.Telemetry.Metrics.MetricTags.Protocol tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.MetricEncoding tag2, int increment = 1) { - var index = 357 + ((int)tag1 * 2) + (int)tag2; + var index = 358 + ((int)tag1 * 2) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountMetricsExportPartialSuccesses(Datadog.Trace.Telemetry.Metrics.MetricTags.Protocol tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.MetricEncoding tag2, int increment = 1) { - var index = 361 + ((int)tag1 * 2) + (int)tag2; + var index = 362 + ((int)tag1 * 2) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountMetricsExportFailures(Datadog.Trace.Telemetry.Metrics.MetricTags.Protocol tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.MetricEncoding tag2, int increment = 1) { - var index = 365 + ((int)tag1 * 2) + (int)tag2; + var index = 366 + ((int)tag1 * 2) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTelemetryApiRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag, int increment = 1) { - var index = 369 + (int)tag; + var index = 370 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTelemetryApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag2, int increment = 1) { - var index = 371 + ((int)tag1 * 22) + (int)tag2; + var index = 372 + ((int)tag1 * 22) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTelemetryApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag2, int increment = 1) { - var index = 415 + ((int)tag1 * 3) + (int)tag2; + var index = 416 + ((int)tag1 * 3) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountVersionConflictTracerCreated(int increment = 1) { - Interlocked.Add(ref _buffer.Count[421], increment); + Interlocked.Add(ref _buffer.Count[422], increment); } public void RecordCountUnsupportedCustomInstrumentationServices(int increment = 1) { - Interlocked.Add(ref _buffer.Count[422], increment); + Interlocked.Add(ref _buffer.Count[423], increment); } public void RecordCountDirectLogLogs(Datadog.Trace.Telemetry.Metrics.MetricTags.IntegrationName tag, int increment = 1) { - var index = 423 + (int)tag; + var index = 424 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountDirectLogApiRequests(int increment = 1) { - Interlocked.Add(ref _buffer.Count[507], increment); + Interlocked.Add(ref _buffer.Count[509], increment); } public void RecordCountDirectLogApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag, int increment = 1) { - var index = 508 + (int)tag; + var index = 510 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountDirectLogApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1) { - var index = 530 + (int)tag; + var index = 532 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountWafInit(Datadog.Trace.Telemetry.Metrics.MetricTags.WafStatus tag, int increment = 1) { - var index = 533 + (int)tag; + var index = 535 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountWafUpdates(Datadog.Trace.Telemetry.Metrics.MetricTags.WafStatus tag, int increment = 1) { - var index = 535 + (int)tag; + var index = 537 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountWafRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.WafAnalysis tag, int increment = 1) { - var index = 537 + (int)tag; + var index = 539 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountInputTruncated(Datadog.Trace.Telemetry.Metrics.MetricTags.TruncationReason tag, int increment = 1) { - var index = 545 + (int)tag; + var index = 547 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountRaspRuleEval(Datadog.Trace.Telemetry.Metrics.MetricTags.RaspRuleType tag, int increment = 1) { - var index = 548 + (int)tag; + var index = 550 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountRaspRuleMatch(Datadog.Trace.Telemetry.Metrics.MetricTags.RaspRuleTypeMatch tag, int increment = 1) { - var index = 553 + (int)tag; + var index = 555 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountRaspTimeout(Datadog.Trace.Telemetry.Metrics.MetricTags.RaspRuleType tag, int increment = 1) { - var index = 568 + (int)tag; + var index = 570 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountMissingUserId(Datadog.Trace.Telemetry.Metrics.MetricTags.AuthenticationFrameworkWithEventType tag, int increment = 1) { - var index = 573 + (int)tag; + var index = 575 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountMissingUserLogin(Datadog.Trace.Telemetry.Metrics.MetricTags.AuthenticationFrameworkWithEventType tag, int increment = 1) { - var index = 577 + (int)tag; + var index = 579 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountUserEventSdk(Datadog.Trace.Telemetry.Metrics.MetricTags.UserEventSdk tag, int increment = 1) { - var index = 581 + (int)tag; + var index = 583 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastExecutedSources(Datadog.Trace.Telemetry.Metrics.MetricTags.IastSourceType tag, int increment = 1) { - var index = 586 + (int)tag; + var index = 588 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastExecutedPropagations(int increment = 1) { - Interlocked.Add(ref _buffer.Count[600], increment); + Interlocked.Add(ref _buffer.Count[602], increment); } public void RecordCountIastExecutedSinks(Datadog.Trace.Telemetry.Metrics.MetricTags.IastVulnerabilityType tag, int increment = 1) { - var index = 601 + (int)tag; + var index = 603 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastRequestTainted(int increment = 1) { - Interlocked.Add(ref _buffer.Count[628], increment); + Interlocked.Add(ref _buffer.Count[630], increment); } public void RecordCountIastSuppressedVulnerabilities(Datadog.Trace.Telemetry.Metrics.MetricTags.IastVulnerabilityType tag, int increment = 1) { - var index = 629 + (int)tag; + var index = 631 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } } \ No newline at end of file diff --git a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs index d60501e4f45d..82355f89f551 100644 --- a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs @@ -11,7 +11,7 @@ namespace Datadog.Trace.Telemetry; internal sealed partial class MetricsTelemetryCollector { - private const int CountSharedLength = 336; + private const int CountSharedLength = 340; /// /// Creates the buffer for the values. @@ -356,6 +356,10 @@ private static AggregatedMetric[] GetCountSharedBuffer() new(new[] { "integration_name:hangfire", "error_type:invoker" }), new(new[] { "integration_name:hangfire", "error_type:execution" }), new(new[] { "integration_name:hangfire", "error_type:missing_member" }), + new(new[] { "integration_name:serverlesscompat", "error_type:duck_typing" }), + new(new[] { "integration_name:serverlesscompat", "error_type:invoker" }), + new(new[] { "integration_name:serverlesscompat", "error_type:execution" }), + new(new[] { "integration_name:serverlesscompat", "error_type:missing_member" }), }; /// @@ -364,7 +368,7 @@ private static AggregatedMetric[] GetCountSharedBuffer() /// It is equal to the cardinality of the tag combinations (or 1 if there are no tags) /// private static int[] CountSharedEntryCounts { get; } - = new int[]{ 336, }; + = new int[]{ 340, }; public void RecordCountSharedIntegrationsError(Datadog.Trace.Telemetry.Metrics.MetricTags.IntegrationName tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.InstrumentationError tag2, int increment = 1) { diff --git a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/ConfigurationKeysGenerator/ConfigurationKeys.g.cs b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/ConfigurationKeysGenerator/ConfigurationKeys.g.cs index 1926eaef1500..04a795504c87 100644 --- a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/ConfigurationKeysGenerator/ConfigurationKeys.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/ConfigurationKeysGenerator/ConfigurationKeys.g.cs @@ -242,6 +242,13 @@ internal static partial class ConfigurationKeys /// public const string RuntimeMetricsEnabled = "DD_RUNTIME_METRICS_ENABLED"; + /// + /// Overrides the default path to the serverless compatibility layer binary. + /// Default value in windows is C:\home\site\wwwroot\datadog\bin\windows-amd64\datadog-serverless-compat.exe. + /// Default value in linux is /bin/linux-amd64/datadog-serverless-compat. + /// + public const string ServerlessCompatPath = "DD_SERVERLESS_COMPAT_PATH"; + /// /// Configuration key for the application's default service name. /// Used as the service name for top-level spans, diff --git a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs index 3c9c56bf7d70..cfc3e86ece7b 100644 --- a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs @@ -17,7 +17,7 @@ internal static partial class IntegrationIdExtensions /// The number of members in the enum. /// This is a non-distinct count of defined names. /// - public const int Length = 79; + public const int Length = 80; /// /// Returns the string representation of the value. @@ -109,6 +109,7 @@ public static string ToStringFast(this Datadog.Trace.Configuration.IntegrationId Datadog.Trace.Configuration.IntegrationId.DatadogTraceVersionConflict => nameof(Datadog.Trace.Configuration.IntegrationId.DatadogTraceVersionConflict), Datadog.Trace.Configuration.IntegrationId.Hangfire => nameof(Datadog.Trace.Configuration.IntegrationId.Hangfire), Datadog.Trace.Configuration.IntegrationId.OpenFeature => nameof(Datadog.Trace.Configuration.IntegrationId.OpenFeature), + Datadog.Trace.Configuration.IntegrationId.ServerlessCompat => nameof(Datadog.Trace.Configuration.IntegrationId.ServerlessCompat), _ => value.ToString(), }; @@ -201,6 +202,7 @@ public static Datadog.Trace.Configuration.IntegrationId[] GetValues() Datadog.Trace.Configuration.IntegrationId.DatadogTraceVersionConflict, Datadog.Trace.Configuration.IntegrationId.Hangfire, Datadog.Trace.Configuration.IntegrationId.OpenFeature, + Datadog.Trace.Configuration.IntegrationId.ServerlessCompat, }; /// @@ -293,5 +295,6 @@ public static string[] GetNames() nameof(Datadog.Trace.Configuration.IntegrationId.DatadogTraceVersionConflict), nameof(Datadog.Trace.Configuration.IntegrationId.Hangfire), nameof(Datadog.Trace.Configuration.IntegrationId.OpenFeature), + nameof(Datadog.Trace.Configuration.IntegrationId.ServerlessCompat), }; } \ No newline at end of file diff --git a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationNameToKeys.g.cs b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationNameToKeys.g.cs index 937b0fffb12c..1082a62da2ba 100644 --- a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationNameToKeys.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationNameToKeys.g.cs @@ -259,6 +259,9 @@ public static string[] GetAllIntegrationEnabledKeys() => "DD_TRACE_OPENFEATURE_ENABLED", "DD_TRACE_OpenFeature_ENABLED", "DD_OpenFeature_ENABLED", "DD_TRACE_OPENFEATURE_ANALYTICS_ENABLED", "DD_TRACE_OpenFeature_ANALYTICS_ENABLED", "DD_OpenFeature_ANALYTICS_ENABLED", "DD_TRACE_OPENFEATURE_ANALYTICS_SAMPLE_RATE", "DD_TRACE_OpenFeature_ANALYTICS_SAMPLE_RATE", "DD_OpenFeature_ANALYTICS_SAMPLE_RATE", + "DD_TRACE_SERVERLESSCOMPAT_ENABLED", "DD_TRACE_ServerlessCompat_ENABLED", "DD_ServerlessCompat_ENABLED", + "DD_TRACE_SERVERLESSCOMPAT_ANALYTICS_ENABLED", "DD_TRACE_ServerlessCompat_ANALYTICS_ENABLED", "DD_ServerlessCompat_ANALYTICS_ENABLED", + "DD_TRACE_SERVERLESSCOMPAT_ANALYTICS_SAMPLE_RATE", "DD_TRACE_ServerlessCompat_ANALYTICS_SAMPLE_RATE", "DD_ServerlessCompat_ANALYTICS_SAMPLE_RATE", ]; /// /// Gets the configuration keys for the specified integration name. @@ -348,6 +351,7 @@ public static System.Collections.Generic.KeyValuePair GetInteg "DatadogTraceVersionConflict" => new("DD_TRACE_DATADOGTRACEVERSIONCONFLICT_ENABLED", ["DD_TRACE_DatadogTraceVersionConflict_ENABLED", "DD_DatadogTraceVersionConflict_ENABLED"]), "Hangfire" => new("DD_TRACE_HANGFIRE_ENABLED", ["DD_TRACE_Hangfire_ENABLED", "DD_Hangfire_ENABLED"]), "OpenFeature" => new("DD_TRACE_OPENFEATURE_ENABLED", ["DD_TRACE_OpenFeature_ENABLED", "DD_OpenFeature_ENABLED"]), + "ServerlessCompat" => new("DD_TRACE_SERVERLESSCOMPAT_ENABLED", ["DD_TRACE_ServerlessCompat_ENABLED", "DD_ServerlessCompat_ENABLED"]), _ => GetIntegrationEnabledKeysFallback(integrationName) // we should never get here }; /// @@ -439,6 +443,7 @@ public static System.Collections.Generic.KeyValuePair GetInteg "DatadogTraceVersionConflict" => new("DD_TRACE_DATADOGTRACEVERSIONCONFLICT_ANALYTICS_ENABLED", ["DD_TRACE_DatadogTraceVersionConflict_ANALYTICS_ENABLED", "DD_DatadogTraceVersionConflict_ANALYTICS_ENABLED"]), "Hangfire" => new("DD_TRACE_HANGFIRE_ANALYTICS_ENABLED", ["DD_TRACE_Hangfire_ANALYTICS_ENABLED", "DD_Hangfire_ANALYTICS_ENABLED"]), "OpenFeature" => new("DD_TRACE_OPENFEATURE_ANALYTICS_ENABLED", ["DD_TRACE_OpenFeature_ANALYTICS_ENABLED", "DD_OpenFeature_ANALYTICS_ENABLED"]), + "ServerlessCompat" => new("DD_TRACE_SERVERLESSCOMPAT_ANALYTICS_ENABLED", ["DD_TRACE_ServerlessCompat_ANALYTICS_ENABLED", "DD_ServerlessCompat_ANALYTICS_ENABLED"]), _ => GetIntegrationAnalyticsEnabledKeysFallback(integrationName) // we should never get here }; /// @@ -530,6 +535,7 @@ public static System.Collections.Generic.KeyValuePair GetInteg "DatadogTraceVersionConflict" => new("DD_TRACE_DATADOGTRACEVERSIONCONFLICT_ANALYTICS_SAMPLE_RATE", ["DD_TRACE_DatadogTraceVersionConflict_ANALYTICS_SAMPLE_RATE", "DD_DatadogTraceVersionConflict_ANALYTICS_SAMPLE_RATE"]), "Hangfire" => new("DD_TRACE_HANGFIRE_ANALYTICS_SAMPLE_RATE", ["DD_TRACE_Hangfire_ANALYTICS_SAMPLE_RATE", "DD_Hangfire_ANALYTICS_SAMPLE_RATE"]), "OpenFeature" => new("DD_TRACE_OPENFEATURE_ANALYTICS_SAMPLE_RATE", ["DD_TRACE_OpenFeature_ANALYTICS_SAMPLE_RATE", "DD_OpenFeature_ANALYTICS_SAMPLE_RATE"]), + "ServerlessCompat" => new("DD_TRACE_SERVERLESSCOMPAT_ANALYTICS_SAMPLE_RATE", ["DD_TRACE_ServerlessCompat_ANALYTICS_SAMPLE_RATE", "DD_ServerlessCompat_ANALYTICS_SAMPLE_RATE"]), _ => GetIntegrationAnalyticsSampleRateKeysFallback(integrationName) // we should never get here }; diff --git a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs index 81a152372fb7..9af0c3b70e9d 100644 --- a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs @@ -619,6 +619,9 @@ internal static bool IsInstrumentedAssembly(string assemblyName) or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Logging.Serilog.LogsInjection.LoggerDispatchInstrumentation" or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Logging.Serilog.DirectSubmission.LoggerConfigurationInstrumentation" => Datadog.Trace.Configuration.IntegrationId.Serilog, + "Datadog.Trace.ClrProfiler.AutoInstrumentation.Serverless.CompatibilityLayer_CalculateDogStatsDPipeName_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Serverless.CompatibilityLayer_CalculateTracePipeName_Integration" + => Datadog.Trace.Configuration.IntegrationId.ServerlessCompat, "Datadog.Trace.ClrProfiler.AutoInstrumentation.Redis.ServiceStack.RedisNativeClientSendReceiveIntegration" or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Redis.ServiceStack.RedisNativeClientSendReceiveIntegration_6_2_0" => Datadog.Trace.Configuration.IntegrationId.ServiceStackRedis, diff --git a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs index bfaf729c064b..074a939c1ce9 100644 --- a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs @@ -11,7 +11,7 @@ namespace Datadog.Trace.Telemetry; internal sealed partial class CiVisibilityMetricsTelemetryCollector { - private const int CountSharedLength = 336; + private const int CountSharedLength = 340; /// /// Creates the buffer for the values. @@ -356,6 +356,10 @@ private static AggregatedMetric[] GetCountSharedBuffer() new(new[] { "integration_name:hangfire", "error_type:invoker" }), new(new[] { "integration_name:hangfire", "error_type:execution" }), new(new[] { "integration_name:hangfire", "error_type:missing_member" }), + new(new[] { "integration_name:serverlesscompat", "error_type:duck_typing" }), + new(new[] { "integration_name:serverlesscompat", "error_type:invoker" }), + new(new[] { "integration_name:serverlesscompat", "error_type:execution" }), + new(new[] { "integration_name:serverlesscompat", "error_type:missing_member" }), }; /// @@ -364,7 +368,7 @@ private static AggregatedMetric[] GetCountSharedBuffer() /// It is equal to the cardinality of the tag combinations (or 1 if there are no tags) /// private static int[] CountSharedEntryCounts { get; } - = new int[]{ 336, }; + = new int[]{ 340, }; public void RecordCountSharedIntegrationsError(Datadog.Trace.Telemetry.Metrics.MetricTags.IntegrationName tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.InstrumentationError tag2, int increment = 1) { diff --git a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs index e382010a658c..8cc8110fcc6a 100644 --- a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs @@ -11,7 +11,7 @@ namespace Datadog.Trace.Telemetry; internal sealed partial class MetricsTelemetryCollector { - private const int CountLength = 656; + private const int CountLength = 658; /// /// Creates the buffer for the values. @@ -109,35 +109,36 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "integration_name:emailhtmlinjection" }), new(new[] { "integration_name:protobuf" }), new(new[] { "integration_name:hangfire" }), - // spans_finished, index = 88 + new(new[] { "integration_name:serverlesscompat" }), + // spans_finished, index = 89 new(null), - // spans_enqueued_for_serialization, index = 89 + // spans_enqueued_for_serialization, index = 90 new(new[] { "reason:p0_keep" }), new(new[] { "reason:single_span_sampling" }), new(new[] { "reason:default" }), - // spans_dropped, index = 92 + // spans_dropped, index = 93 new(new[] { "reason:p0_drop" }), new(new[] { "reason:overfull_buffer" }), new(new[] { "reason:serialization_error" }), new(new[] { "reason:api_error" }), - // trace_segments_created, index = 96 + // trace_segments_created, index = 97 new(new[] { "new_continued:new" }), new(new[] { "new_continued:continued" }), - // trace_chunks_enqueued_for_serialization, index = 98 + // trace_chunks_enqueued_for_serialization, index = 99 new(new[] { "reason:p0_keep" }), new(new[] { "reason:default" }), - // trace_chunks_dropped, index = 100 + // trace_chunks_dropped, index = 101 new(new[] { "reason:p0_drop" }), new(new[] { "reason:overfull_buffer" }), new(new[] { "reason:serialization_error" }), new(new[] { "reason:api_error" }), - // trace_chunks_sent, index = 104 + // trace_chunks_sent, index = 105 new(null), - // trace_segments_closed, index = 105 + // trace_segments_closed, index = 106 new(null), - // trace_api.requests, index = 106 + // trace_api.requests, index = 107 new(null), - // trace_api.responses, index = 107 + // trace_api.responses, index = 108 new(new[] { "status_code:200" }), new(new[] { "status_code:201" }), new(new[] { "status_code:202" }), @@ -160,33 +161,33 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "status_code:503" }), new(new[] { "status_code:504" }), new(new[] { "status_code:5xx" }), - // trace_api.errors, index = 129 + // trace_api.errors, index = 130 new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // trace_partial_flush.count, index = 132 + // trace_partial_flush.count, index = 133 new(new[] { "reason:large_trace" }), new(new[] { "reason:single_span_ingestion" }), - // context_header_style.injected, index = 134 + // context_header_style.injected, index = 135 new(new[] { "header_style:tracecontext" }), new(new[] { "header_style:datadog" }), new(new[] { "header_style:b3multi" }), new(new[] { "header_style:b3single" }), new(new[] { "header_style:baggage" }), - // context_header_style.extracted, index = 139 + // context_header_style.extracted, index = 140 new(new[] { "header_style:tracecontext" }), new(new[] { "header_style:datadog" }), new(new[] { "header_style:b3multi" }), new(new[] { "header_style:b3single" }), new(new[] { "header_style:baggage" }), - // context_header.truncated, index = 144 + // context_header.truncated, index = 145 new(new[] { "truncation_reason:baggage_item_count_exceeded" }), new(new[] { "truncation_reason:baggage_byte_count_exceeded" }), - // context_header_style.malformed, index = 146 + // context_header_style.malformed, index = 147 new(new[] { "header_style:baggage" }), - // stats_api.requests, index = 147 + // stats_api.requests, index = 148 new(null), - // stats_api.responses, index = 148 + // stats_api.responses, index = 149 new(new[] { "status_code:200" }), new(new[] { "status_code:201" }), new(new[] { "status_code:202" }), @@ -209,11 +210,11 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "status_code:503" }), new(new[] { "status_code:504" }), new(new[] { "status_code:5xx" }), - // stats_api.errors, index = 170 + // stats_api.errors, index = 171 new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // otel.env.hiding, index = 173 + // otel.env.hiding, index = 174 new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_log_level" }), new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_metrics_exporter" }), new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_propagators" }), @@ -304,7 +305,7 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_traces_sampler" }), new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_traces_sampler_arg" }), new(new[] { "config_datadog:unknown", "config_opentelemetry:unknown" }), - // otel.env.invalid, index = 263 + // otel.env.invalid, index = 264 new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_log_level" }), new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_metrics_exporter" }), new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_propagators" }), @@ -395,30 +396,30 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_traces_sampler" }), new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_traces_sampler_arg" }), new(new[] { "config_datadog:unknown", "config_opentelemetry:unknown" }), - // otel.metrics_export_attempts, index = 353 + // otel.metrics_export_attempts, index = 354 new(new[] { "protocol:grpc", "encoding:protobuf" }), new(new[] { "protocol:grpc", "encoding:json" }), new(new[] { "protocol:http", "encoding:protobuf" }), new(new[] { "protocol:http", "encoding:json" }), - // otel.metrics_export_successes, index = 357 + // otel.metrics_export_successes, index = 358 new(new[] { "protocol:grpc", "encoding:protobuf" }), new(new[] { "protocol:grpc", "encoding:json" }), new(new[] { "protocol:http", "encoding:protobuf" }), new(new[] { "protocol:http", "encoding:json" }), - // otel.metrics_export_partial_successes, index = 361 + // otel.metrics_export_partial_successes, index = 362 new(new[] { "protocol:grpc", "encoding:protobuf" }), new(new[] { "protocol:grpc", "encoding:json" }), new(new[] { "protocol:http", "encoding:protobuf" }), new(new[] { "protocol:http", "encoding:json" }), - // otel.metrics_export_failures, index = 365 + // otel.metrics_export_failures, index = 366 new(new[] { "protocol:grpc", "encoding:protobuf" }), new(new[] { "protocol:grpc", "encoding:json" }), new(new[] { "protocol:http", "encoding:protobuf" }), new(new[] { "protocol:http", "encoding:json" }), - // telemetry_api.requests, index = 369 + // telemetry_api.requests, index = 370 new(new[] { "endpoint:agent" }), new(new[] { "endpoint:agentless" }), - // telemetry_api.responses, index = 371 + // telemetry_api.responses, index = 372 new(new[] { "endpoint:agent", "status_code:200" }), new(new[] { "endpoint:agent", "status_code:201" }), new(new[] { "endpoint:agent", "status_code:202" }), @@ -463,18 +464,18 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "endpoint:agentless", "status_code:503" }), new(new[] { "endpoint:agentless", "status_code:504" }), new(new[] { "endpoint:agentless", "status_code:5xx" }), - // telemetry_api.errors, index = 415 + // telemetry_api.errors, index = 416 new(new[] { "endpoint:agent", "type:timeout" }), new(new[] { "endpoint:agent", "type:network" }), new(new[] { "endpoint:agent", "type:status_code" }), new(new[] { "endpoint:agentless", "type:timeout" }), new(new[] { "endpoint:agentless", "type:network" }), new(new[] { "endpoint:agentless", "type:status_code" }), - // version_conflict_tracers_created, index = 421 + // version_conflict_tracers_created, index = 422 new(null), - // unsupported_custom_instrumentation_services, index = 422 + // unsupported_custom_instrumentation_services, index = 423 new(null), - // direct_log_logs, index = 423 + // direct_log_logs, index = 424 new(new[] { "integration_name:datadog" }), new(new[] { "integration_name:opentracing" }), new(new[] { "integration_name:version_conflict" }), @@ -559,9 +560,10 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "integration_name:emailhtmlinjection" }), new(new[] { "integration_name:protobuf" }), new(new[] { "integration_name:hangfire" }), - // direct_log_api.requests, index = 507 + new(new[] { "integration_name:serverlesscompat" }), + // direct_log_api.requests, index = 509 new(null), - // direct_log_api.responses, index = 508 + // direct_log_api.responses, index = 510 new(new[] { "status_code:200" }), new(new[] { "status_code:201" }), new(new[] { "status_code:202" }), @@ -584,17 +586,17 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "status_code:503" }), new(new[] { "status_code:504" }), new(new[] { "status_code:5xx" }), - // direct_log_api.errors, index = 530 + // direct_log_api.errors, index = 532 new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // waf.init, index = 533 + // waf.init, index = 535 new(new[] { "waf_version", "event_rules_version", "success:true" }), new(new[] { "waf_version", "event_rules_version", "success:false" }), - // waf.updates, index = 535 + // waf.updates, index = 537 new(new[] { "waf_version", "event_rules_version", "success:true" }), new(new[] { "waf_version", "event_rules_version", "success:false" }), - // waf.requests, index = 537 + // waf.requests, index = 539 new(new[] { "waf_version", "event_rules_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:false", "block_failure:false", "rate_limited:false", "input_truncated:false" }), new(new[] { "waf_version", "event_rules_version", "rule_triggered:true", "request_blocked:false", "waf_timeout:false", "block_failure:false", "rate_limited:false", "input_truncated:false" }), new(new[] { "waf_version", "event_rules_version", "rule_triggered:true", "request_blocked:true", "waf_timeout:false", "block_failure:false", "rate_limited:false", "input_truncated:false" }), @@ -603,17 +605,17 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "waf_version", "event_rules_version", "rule_triggered:true", "request_blocked:false", "waf_timeout:false", "block_failure:false", "rate_limited:false", "input_truncated:true" }), new(new[] { "waf_version", "event_rules_version", "rule_triggered:true", "request_blocked:true", "waf_timeout:false", "block_failure:false", "rate_limited:false", "input_truncated:true" }), new(new[] { "waf_version", "event_rules_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:true", "block_failure:false", "rate_limited:false", "input_truncated:true" }), - // waf.input_truncated, index = 545 + // waf.input_truncated, index = 547 new(new[] { "truncation_reason:string_too_long" }), new(new[] { "truncation_reason:list_or_map_too_large" }), new(new[] { "truncation_reason:object_too_deep" }), - // rasp.rule.eval, index = 548 + // rasp.rule.eval, index = 550 new(new[] { "waf_version", "event_rules_version", "rule_type:lfi" }), new(new[] { "waf_version", "event_rules_version", "rule_type:ssrf" }), new(new[] { "waf_version", "event_rules_version", "rule_type:sql_injection" }), new(new[] { "waf_version", "event_rules_version", "rule_type:command_injection", "rule_variant:shell" }), new(new[] { "waf_version", "event_rules_version", "rule_type:command_injection", "rule_variant:exec" }), - // rasp.rule.match, index = 553 + // rasp.rule.match, index = 555 new(new[] { "waf_version", "event_rules_version", "block:success", "rule_type:lfi" }), new(new[] { "waf_version", "event_rules_version", "block:success", "rule_type:ssrf" }), new(new[] { "waf_version", "event_rules_version", "block:success", "rule_type:sql_injection" }), @@ -629,29 +631,29 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "waf_version", "event_rules_version", "block:irrelevant", "rule_type:sql_injection" }), new(new[] { "waf_version", "event_rules_version", "block:irrelevant", "rule_type:command_injection", "rule_variant:shell" }), new(new[] { "waf_version", "event_rules_version", "block:irrelevant", "rule_type:command_injection", "rule_variant:exec" }), - // rasp.timeout, index = 568 + // rasp.timeout, index = 570 new(new[] { "waf_version", "event_rules_version", "rule_type:lfi" }), new(new[] { "waf_version", "event_rules_version", "rule_type:ssrf" }), new(new[] { "waf_version", "event_rules_version", "rule_type:sql_injection" }), new(new[] { "waf_version", "event_rules_version", "rule_type:command_injection", "rule_variant:shell" }), new(new[] { "waf_version", "event_rules_version", "rule_type:command_injection", "rule_variant:exec" }), - // instrum.user_auth.missing_user_id, index = 573 + // instrum.user_auth.missing_user_id, index = 575 new(new[] { "framework:aspnetcore_identity", "event_type:login_success" }), new(new[] { "framework:aspnetcore_identity", "event_type:login_failure" }), new(new[] { "framework:aspnetcore_identity", "event_type:signup" }), new(new[] { "framework:unknown", "event_type:signup" }), - // instrum.user_auth.missing_user_login, index = 577 + // instrum.user_auth.missing_user_login, index = 579 new(new[] { "framework:aspnetcore_identity", "event_type:login_success" }), new(new[] { "framework:aspnetcore_identity", "event_type:login_failure" }), new(new[] { "framework:aspnetcore_identity", "event_type:signup" }), new(new[] { "framework:unknown", "event_type:signup" }), - // sdk.event, index = 581 + // sdk.event, index = 583 new(new[] { "event_type:login_success", "sdk_version:v1" }), new(new[] { "event_type:login_success", "sdk_version:v2" }), new(new[] { "event_type:login_failure", "sdk_version:v1" }), new(new[] { "event_type:login_failure", "sdk_version:v2" }), new(new[] { "event_type:custom", "sdk_version:v1" }), - // executed.source, index = 586 + // executed.source, index = 588 new(new[] { "source_type:http.request.body" }), new(new[] { "source_type:http.request.path" }), new(new[] { "source_type:http.request.parameter.name" }), @@ -666,9 +668,9 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "source_type:http.request.uri" }), new(new[] { "source_type:grpc.request.body" }), new(new[] { "source_type:sql.row.value" }), - // executed.propagation, index = 600 + // executed.propagation, index = 602 new(null), - // executed.sink, index = 601 + // executed.sink, index = 603 new(new[] { "vulnerability_type:none" }), new(new[] { "vulnerability_type:weak_cipher" }), new(new[] { "vulnerability_type:weak_hash" }), @@ -696,9 +698,9 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "vulnerability_type:directory_listing_leak" }), new(new[] { "vulnerability_type:session_timeout" }), new(new[] { "vulnerability_type:email_html_injection" }), - // request.tainted, index = 628 + // request.tainted, index = 630 new(null), - // suppressed.vulnerabilities, index = 629 + // suppressed.vulnerabilities, index = 631 new(new[] { "vulnerability_type:none" }), new(new[] { "vulnerability_type:weak_cipher" }), new(new[] { "vulnerability_type:weak_hash" }), @@ -734,7 +736,7 @@ private static AggregatedMetric[] GetCountBuffer() /// It is equal to the cardinality of the tag combinations (or 1 if there are no tags) /// private static int[] CountEntryCounts { get; } - = new int[]{ 4, 84, 1, 3, 4, 2, 2, 4, 1, 1, 1, 22, 3, 2, 5, 5, 2, 1, 1, 22, 3, 90, 90, 4, 4, 4, 4, 2, 44, 6, 1, 1, 84, 1, 22, 3, 2, 2, 8, 3, 5, 15, 5, 4, 4, 5, 14, 1, 27, 1, 27, }; + = new int[]{ 4, 85, 1, 3, 4, 2, 2, 4, 1, 1, 1, 22, 3, 2, 5, 5, 2, 1, 1, 22, 3, 90, 90, 4, 4, 4, 4, 2, 44, 6, 1, 1, 85, 1, 22, 3, 2, 2, 8, 3, 5, 15, 5, 4, 4, 5, 14, 1, 27, 1, 27, }; public void RecordCountLogCreated(Datadog.Trace.Telemetry.Metrics.MetricTags.LogLevel tag, int increment = 1) { @@ -750,285 +752,285 @@ public void RecordCountSpanCreated(Datadog.Trace.Telemetry.Metrics.MetricTags.In public void RecordCountSpanFinished(int increment = 1) { - Interlocked.Add(ref _buffer.Count[88], increment); + Interlocked.Add(ref _buffer.Count[89], increment); } public void RecordCountSpanEnqueuedForSerialization(Datadog.Trace.Telemetry.Metrics.MetricTags.SpanEnqueueReason tag, int increment = 1) { - var index = 89 + (int)tag; + var index = 90 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountSpanDropped(Datadog.Trace.Telemetry.Metrics.MetricTags.DropReason tag, int increment = 1) { - var index = 92 + (int)tag; + var index = 93 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceSegmentCreated(Datadog.Trace.Telemetry.Metrics.MetricTags.TraceContinuation tag, int increment = 1) { - var index = 96 + (int)tag; + var index = 97 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceChunkEnqueued(Datadog.Trace.Telemetry.Metrics.MetricTags.TraceChunkEnqueueReason tag, int increment = 1) { - var index = 98 + (int)tag; + var index = 99 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceChunkDropped(Datadog.Trace.Telemetry.Metrics.MetricTags.DropReason tag, int increment = 1) { - var index = 100 + (int)tag; + var index = 101 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceChunkSent(int increment = 1) { - Interlocked.Add(ref _buffer.Count[104], increment); + Interlocked.Add(ref _buffer.Count[105], increment); } public void RecordCountTraceSegmentsClosed(int increment = 1) { - Interlocked.Add(ref _buffer.Count[105], increment); + Interlocked.Add(ref _buffer.Count[106], increment); } public void RecordCountTraceApiRequests(int increment = 1) { - Interlocked.Add(ref _buffer.Count[106], increment); + Interlocked.Add(ref _buffer.Count[107], increment); } public void RecordCountTraceApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag, int increment = 1) { - var index = 107 + (int)tag; + var index = 108 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1) { - var index = 129 + (int)tag; + var index = 130 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTracePartialFlush(Datadog.Trace.Telemetry.Metrics.MetricTags.PartialFlushReason tag, int increment = 1) { - var index = 132 + (int)tag; + var index = 133 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountContextHeaderStyleInjected(Datadog.Trace.Telemetry.Metrics.MetricTags.ContextHeaderStyle tag, int increment = 1) { - var index = 134 + (int)tag; + var index = 135 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountContextHeaderStyleExtracted(Datadog.Trace.Telemetry.Metrics.MetricTags.ContextHeaderStyle tag, int increment = 1) { - var index = 139 + (int)tag; + var index = 140 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountContextHeaderTruncated(Datadog.Trace.Telemetry.Metrics.MetricTags.ContextHeaderTruncationReason tag, int increment = 1) { - var index = 144 + (int)tag; + var index = 145 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountContextHeaderMalformed(Datadog.Trace.Telemetry.Metrics.MetricTags.ContextHeaderMalformed tag, int increment = 1) { - var index = 146 + (int)tag; + var index = 147 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountStatsApiRequests(int increment = 1) { - Interlocked.Add(ref _buffer.Count[147], increment); + Interlocked.Add(ref _buffer.Count[148], increment); } public void RecordCountStatsApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag, int increment = 1) { - var index = 148 + (int)tag; + var index = 149 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountStatsApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1) { - var index = 170 + (int)tag; + var index = 171 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountOpenTelemetryConfigHiddenByDatadogConfig(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1) { - var index = 173 + ((int)tag1 * 10) + (int)tag2; + var index = 174 + ((int)tag1 * 10) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountOpenTelemetryConfigInvalid(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1) { - var index = 263 + ((int)tag1 * 10) + (int)tag2; + var index = 264 + ((int)tag1 * 10) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountMetricsExportAttempts(Datadog.Trace.Telemetry.Metrics.MetricTags.Protocol tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.MetricEncoding tag2, int increment = 1) { - var index = 353 + ((int)tag1 * 2) + (int)tag2; + var index = 354 + ((int)tag1 * 2) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountMetricsExportSuccesses(Datadog.Trace.Telemetry.Metrics.MetricTags.Protocol tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.MetricEncoding tag2, int increment = 1) { - var index = 357 + ((int)tag1 * 2) + (int)tag2; + var index = 358 + ((int)tag1 * 2) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountMetricsExportPartialSuccesses(Datadog.Trace.Telemetry.Metrics.MetricTags.Protocol tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.MetricEncoding tag2, int increment = 1) { - var index = 361 + ((int)tag1 * 2) + (int)tag2; + var index = 362 + ((int)tag1 * 2) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountMetricsExportFailures(Datadog.Trace.Telemetry.Metrics.MetricTags.Protocol tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.MetricEncoding tag2, int increment = 1) { - var index = 365 + ((int)tag1 * 2) + (int)tag2; + var index = 366 + ((int)tag1 * 2) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTelemetryApiRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag, int increment = 1) { - var index = 369 + (int)tag; + var index = 370 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTelemetryApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag2, int increment = 1) { - var index = 371 + ((int)tag1 * 22) + (int)tag2; + var index = 372 + ((int)tag1 * 22) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTelemetryApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag2, int increment = 1) { - var index = 415 + ((int)tag1 * 3) + (int)tag2; + var index = 416 + ((int)tag1 * 3) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountVersionConflictTracerCreated(int increment = 1) { - Interlocked.Add(ref _buffer.Count[421], increment); + Interlocked.Add(ref _buffer.Count[422], increment); } public void RecordCountUnsupportedCustomInstrumentationServices(int increment = 1) { - Interlocked.Add(ref _buffer.Count[422], increment); + Interlocked.Add(ref _buffer.Count[423], increment); } public void RecordCountDirectLogLogs(Datadog.Trace.Telemetry.Metrics.MetricTags.IntegrationName tag, int increment = 1) { - var index = 423 + (int)tag; + var index = 424 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountDirectLogApiRequests(int increment = 1) { - Interlocked.Add(ref _buffer.Count[507], increment); + Interlocked.Add(ref _buffer.Count[509], increment); } public void RecordCountDirectLogApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag, int increment = 1) { - var index = 508 + (int)tag; + var index = 510 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountDirectLogApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1) { - var index = 530 + (int)tag; + var index = 532 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountWafInit(Datadog.Trace.Telemetry.Metrics.MetricTags.WafStatus tag, int increment = 1) { - var index = 533 + (int)tag; + var index = 535 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountWafUpdates(Datadog.Trace.Telemetry.Metrics.MetricTags.WafStatus tag, int increment = 1) { - var index = 535 + (int)tag; + var index = 537 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountWafRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.WafAnalysis tag, int increment = 1) { - var index = 537 + (int)tag; + var index = 539 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountInputTruncated(Datadog.Trace.Telemetry.Metrics.MetricTags.TruncationReason tag, int increment = 1) { - var index = 545 + (int)tag; + var index = 547 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountRaspRuleEval(Datadog.Trace.Telemetry.Metrics.MetricTags.RaspRuleType tag, int increment = 1) { - var index = 548 + (int)tag; + var index = 550 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountRaspRuleMatch(Datadog.Trace.Telemetry.Metrics.MetricTags.RaspRuleTypeMatch tag, int increment = 1) { - var index = 553 + (int)tag; + var index = 555 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountRaspTimeout(Datadog.Trace.Telemetry.Metrics.MetricTags.RaspRuleType tag, int increment = 1) { - var index = 568 + (int)tag; + var index = 570 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountMissingUserId(Datadog.Trace.Telemetry.Metrics.MetricTags.AuthenticationFrameworkWithEventType tag, int increment = 1) { - var index = 573 + (int)tag; + var index = 575 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountMissingUserLogin(Datadog.Trace.Telemetry.Metrics.MetricTags.AuthenticationFrameworkWithEventType tag, int increment = 1) { - var index = 577 + (int)tag; + var index = 579 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountUserEventSdk(Datadog.Trace.Telemetry.Metrics.MetricTags.UserEventSdk tag, int increment = 1) { - var index = 581 + (int)tag; + var index = 583 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastExecutedSources(Datadog.Trace.Telemetry.Metrics.MetricTags.IastSourceType tag, int increment = 1) { - var index = 586 + (int)tag; + var index = 588 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastExecutedPropagations(int increment = 1) { - Interlocked.Add(ref _buffer.Count[600], increment); + Interlocked.Add(ref _buffer.Count[602], increment); } public void RecordCountIastExecutedSinks(Datadog.Trace.Telemetry.Metrics.MetricTags.IastVulnerabilityType tag, int increment = 1) { - var index = 601 + (int)tag; + var index = 603 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastRequestTainted(int increment = 1) { - Interlocked.Add(ref _buffer.Count[628], increment); + Interlocked.Add(ref _buffer.Count[630], increment); } public void RecordCountIastSuppressedVulnerabilities(Datadog.Trace.Telemetry.Metrics.MetricTags.IastVulnerabilityType tag, int increment = 1) { - var index = 629 + (int)tag; + var index = 631 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } } \ No newline at end of file diff --git a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs index d60501e4f45d..82355f89f551 100644 --- a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs @@ -11,7 +11,7 @@ namespace Datadog.Trace.Telemetry; internal sealed partial class MetricsTelemetryCollector { - private const int CountSharedLength = 336; + private const int CountSharedLength = 340; /// /// Creates the buffer for the values. @@ -356,6 +356,10 @@ private static AggregatedMetric[] GetCountSharedBuffer() new(new[] { "integration_name:hangfire", "error_type:invoker" }), new(new[] { "integration_name:hangfire", "error_type:execution" }), new(new[] { "integration_name:hangfire", "error_type:missing_member" }), + new(new[] { "integration_name:serverlesscompat", "error_type:duck_typing" }), + new(new[] { "integration_name:serverlesscompat", "error_type:invoker" }), + new(new[] { "integration_name:serverlesscompat", "error_type:execution" }), + new(new[] { "integration_name:serverlesscompat", "error_type:missing_member" }), }; /// @@ -364,7 +368,7 @@ private static AggregatedMetric[] GetCountSharedBuffer() /// It is equal to the cardinality of the tag combinations (or 1 if there are no tags) /// private static int[] CountSharedEntryCounts { get; } - = new int[]{ 336, }; + = new int[]{ 340, }; public void RecordCountSharedIntegrationsError(Datadog.Trace.Telemetry.Metrics.MetricTags.IntegrationName tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.InstrumentationError tag2, int increment = 1) { diff --git a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/ConfigurationKeysGenerator/ConfigurationKeys.g.cs b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/ConfigurationKeysGenerator/ConfigurationKeys.g.cs index 1926eaef1500..04a795504c87 100644 --- a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/ConfigurationKeysGenerator/ConfigurationKeys.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/ConfigurationKeysGenerator/ConfigurationKeys.g.cs @@ -242,6 +242,13 @@ internal static partial class ConfigurationKeys /// public const string RuntimeMetricsEnabled = "DD_RUNTIME_METRICS_ENABLED"; + /// + /// Overrides the default path to the serverless compatibility layer binary. + /// Default value in windows is C:\home\site\wwwroot\datadog\bin\windows-amd64\datadog-serverless-compat.exe. + /// Default value in linux is /bin/linux-amd64/datadog-serverless-compat. + /// + public const string ServerlessCompatPath = "DD_SERVERLESS_COMPAT_PATH"; + /// /// Configuration key for the application's default service name. /// Used as the service name for top-level spans, diff --git a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs index 3c9c56bf7d70..cfc3e86ece7b 100644 --- a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationIdExtensions_EnumExtensions.g.cs @@ -17,7 +17,7 @@ internal static partial class IntegrationIdExtensions /// The number of members in the enum. /// This is a non-distinct count of defined names. /// - public const int Length = 79; + public const int Length = 80; /// /// Returns the string representation of the value. @@ -109,6 +109,7 @@ public static string ToStringFast(this Datadog.Trace.Configuration.IntegrationId Datadog.Trace.Configuration.IntegrationId.DatadogTraceVersionConflict => nameof(Datadog.Trace.Configuration.IntegrationId.DatadogTraceVersionConflict), Datadog.Trace.Configuration.IntegrationId.Hangfire => nameof(Datadog.Trace.Configuration.IntegrationId.Hangfire), Datadog.Trace.Configuration.IntegrationId.OpenFeature => nameof(Datadog.Trace.Configuration.IntegrationId.OpenFeature), + Datadog.Trace.Configuration.IntegrationId.ServerlessCompat => nameof(Datadog.Trace.Configuration.IntegrationId.ServerlessCompat), _ => value.ToString(), }; @@ -201,6 +202,7 @@ public static Datadog.Trace.Configuration.IntegrationId[] GetValues() Datadog.Trace.Configuration.IntegrationId.DatadogTraceVersionConflict, Datadog.Trace.Configuration.IntegrationId.Hangfire, Datadog.Trace.Configuration.IntegrationId.OpenFeature, + Datadog.Trace.Configuration.IntegrationId.ServerlessCompat, }; /// @@ -293,5 +295,6 @@ public static string[] GetNames() nameof(Datadog.Trace.Configuration.IntegrationId.DatadogTraceVersionConflict), nameof(Datadog.Trace.Configuration.IntegrationId.Hangfire), nameof(Datadog.Trace.Configuration.IntegrationId.OpenFeature), + nameof(Datadog.Trace.Configuration.IntegrationId.ServerlessCompat), }; } \ No newline at end of file diff --git a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationNameToKeys.g.cs b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationNameToKeys.g.cs index 937b0fffb12c..1082a62da2ba 100644 --- a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationNameToKeys.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/EnumExtensionsGenerator/IntegrationNameToKeys.g.cs @@ -259,6 +259,9 @@ public static string[] GetAllIntegrationEnabledKeys() => "DD_TRACE_OPENFEATURE_ENABLED", "DD_TRACE_OpenFeature_ENABLED", "DD_OpenFeature_ENABLED", "DD_TRACE_OPENFEATURE_ANALYTICS_ENABLED", "DD_TRACE_OpenFeature_ANALYTICS_ENABLED", "DD_OpenFeature_ANALYTICS_ENABLED", "DD_TRACE_OPENFEATURE_ANALYTICS_SAMPLE_RATE", "DD_TRACE_OpenFeature_ANALYTICS_SAMPLE_RATE", "DD_OpenFeature_ANALYTICS_SAMPLE_RATE", + "DD_TRACE_SERVERLESSCOMPAT_ENABLED", "DD_TRACE_ServerlessCompat_ENABLED", "DD_ServerlessCompat_ENABLED", + "DD_TRACE_SERVERLESSCOMPAT_ANALYTICS_ENABLED", "DD_TRACE_ServerlessCompat_ANALYTICS_ENABLED", "DD_ServerlessCompat_ANALYTICS_ENABLED", + "DD_TRACE_SERVERLESSCOMPAT_ANALYTICS_SAMPLE_RATE", "DD_TRACE_ServerlessCompat_ANALYTICS_SAMPLE_RATE", "DD_ServerlessCompat_ANALYTICS_SAMPLE_RATE", ]; /// /// Gets the configuration keys for the specified integration name. @@ -348,6 +351,7 @@ public static System.Collections.Generic.KeyValuePair GetInteg "DatadogTraceVersionConflict" => new("DD_TRACE_DATADOGTRACEVERSIONCONFLICT_ENABLED", ["DD_TRACE_DatadogTraceVersionConflict_ENABLED", "DD_DatadogTraceVersionConflict_ENABLED"]), "Hangfire" => new("DD_TRACE_HANGFIRE_ENABLED", ["DD_TRACE_Hangfire_ENABLED", "DD_Hangfire_ENABLED"]), "OpenFeature" => new("DD_TRACE_OPENFEATURE_ENABLED", ["DD_TRACE_OpenFeature_ENABLED", "DD_OpenFeature_ENABLED"]), + "ServerlessCompat" => new("DD_TRACE_SERVERLESSCOMPAT_ENABLED", ["DD_TRACE_ServerlessCompat_ENABLED", "DD_ServerlessCompat_ENABLED"]), _ => GetIntegrationEnabledKeysFallback(integrationName) // we should never get here }; /// @@ -439,6 +443,7 @@ public static System.Collections.Generic.KeyValuePair GetInteg "DatadogTraceVersionConflict" => new("DD_TRACE_DATADOGTRACEVERSIONCONFLICT_ANALYTICS_ENABLED", ["DD_TRACE_DatadogTraceVersionConflict_ANALYTICS_ENABLED", "DD_DatadogTraceVersionConflict_ANALYTICS_ENABLED"]), "Hangfire" => new("DD_TRACE_HANGFIRE_ANALYTICS_ENABLED", ["DD_TRACE_Hangfire_ANALYTICS_ENABLED", "DD_Hangfire_ANALYTICS_ENABLED"]), "OpenFeature" => new("DD_TRACE_OPENFEATURE_ANALYTICS_ENABLED", ["DD_TRACE_OpenFeature_ANALYTICS_ENABLED", "DD_OpenFeature_ANALYTICS_ENABLED"]), + "ServerlessCompat" => new("DD_TRACE_SERVERLESSCOMPAT_ANALYTICS_ENABLED", ["DD_TRACE_ServerlessCompat_ANALYTICS_ENABLED", "DD_ServerlessCompat_ANALYTICS_ENABLED"]), _ => GetIntegrationAnalyticsEnabledKeysFallback(integrationName) // we should never get here }; /// @@ -530,6 +535,7 @@ public static System.Collections.Generic.KeyValuePair GetInteg "DatadogTraceVersionConflict" => new("DD_TRACE_DATADOGTRACEVERSIONCONFLICT_ANALYTICS_SAMPLE_RATE", ["DD_TRACE_DatadogTraceVersionConflict_ANALYTICS_SAMPLE_RATE", "DD_DatadogTraceVersionConflict_ANALYTICS_SAMPLE_RATE"]), "Hangfire" => new("DD_TRACE_HANGFIRE_ANALYTICS_SAMPLE_RATE", ["DD_TRACE_Hangfire_ANALYTICS_SAMPLE_RATE", "DD_Hangfire_ANALYTICS_SAMPLE_RATE"]), "OpenFeature" => new("DD_TRACE_OPENFEATURE_ANALYTICS_SAMPLE_RATE", ["DD_TRACE_OpenFeature_ANALYTICS_SAMPLE_RATE", "DD_OpenFeature_ANALYTICS_SAMPLE_RATE"]), + "ServerlessCompat" => new("DD_TRACE_SERVERLESSCOMPAT_ANALYTICS_SAMPLE_RATE", ["DD_TRACE_ServerlessCompat_ANALYTICS_SAMPLE_RATE", "DD_ServerlessCompat_ANALYTICS_SAMPLE_RATE"]), _ => GetIntegrationAnalyticsSampleRateKeysFallback(integrationName) // we should never get here }; diff --git a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs index 81a152372fb7..9af0c3b70e9d 100644 --- a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs @@ -619,6 +619,9 @@ internal static bool IsInstrumentedAssembly(string assemblyName) or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Logging.Serilog.LogsInjection.LoggerDispatchInstrumentation" or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Logging.Serilog.DirectSubmission.LoggerConfigurationInstrumentation" => Datadog.Trace.Configuration.IntegrationId.Serilog, + "Datadog.Trace.ClrProfiler.AutoInstrumentation.Serverless.CompatibilityLayer_CalculateDogStatsDPipeName_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Serverless.CompatibilityLayer_CalculateTracePipeName_Integration" + => Datadog.Trace.Configuration.IntegrationId.ServerlessCompat, "Datadog.Trace.ClrProfiler.AutoInstrumentation.Redis.ServiceStack.RedisNativeClientSendReceiveIntegration" or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Redis.ServiceStack.RedisNativeClientSendReceiveIntegration_6_2_0" => Datadog.Trace.Configuration.IntegrationId.ServiceStackRedis, diff --git a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs index bfaf729c064b..074a939c1ce9 100644 --- a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_CountShared.g.cs @@ -11,7 +11,7 @@ namespace Datadog.Trace.Telemetry; internal sealed partial class CiVisibilityMetricsTelemetryCollector { - private const int CountSharedLength = 336; + private const int CountSharedLength = 340; /// /// Creates the buffer for the values. @@ -356,6 +356,10 @@ private static AggregatedMetric[] GetCountSharedBuffer() new(new[] { "integration_name:hangfire", "error_type:invoker" }), new(new[] { "integration_name:hangfire", "error_type:execution" }), new(new[] { "integration_name:hangfire", "error_type:missing_member" }), + new(new[] { "integration_name:serverlesscompat", "error_type:duck_typing" }), + new(new[] { "integration_name:serverlesscompat", "error_type:invoker" }), + new(new[] { "integration_name:serverlesscompat", "error_type:execution" }), + new(new[] { "integration_name:serverlesscompat", "error_type:missing_member" }), }; /// @@ -364,7 +368,7 @@ private static AggregatedMetric[] GetCountSharedBuffer() /// It is equal to the cardinality of the tag combinations (or 1 if there are no tags) /// private static int[] CountSharedEntryCounts { get; } - = new int[]{ 336, }; + = new int[]{ 340, }; public void RecordCountSharedIntegrationsError(Datadog.Trace.Telemetry.Metrics.MetricTags.IntegrationName tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.InstrumentationError tag2, int increment = 1) { diff --git a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs index e382010a658c..8cc8110fcc6a 100644 --- a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_Count.g.cs @@ -11,7 +11,7 @@ namespace Datadog.Trace.Telemetry; internal sealed partial class MetricsTelemetryCollector { - private const int CountLength = 656; + private const int CountLength = 658; /// /// Creates the buffer for the values. @@ -109,35 +109,36 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "integration_name:emailhtmlinjection" }), new(new[] { "integration_name:protobuf" }), new(new[] { "integration_name:hangfire" }), - // spans_finished, index = 88 + new(new[] { "integration_name:serverlesscompat" }), + // spans_finished, index = 89 new(null), - // spans_enqueued_for_serialization, index = 89 + // spans_enqueued_for_serialization, index = 90 new(new[] { "reason:p0_keep" }), new(new[] { "reason:single_span_sampling" }), new(new[] { "reason:default" }), - // spans_dropped, index = 92 + // spans_dropped, index = 93 new(new[] { "reason:p0_drop" }), new(new[] { "reason:overfull_buffer" }), new(new[] { "reason:serialization_error" }), new(new[] { "reason:api_error" }), - // trace_segments_created, index = 96 + // trace_segments_created, index = 97 new(new[] { "new_continued:new" }), new(new[] { "new_continued:continued" }), - // trace_chunks_enqueued_for_serialization, index = 98 + // trace_chunks_enqueued_for_serialization, index = 99 new(new[] { "reason:p0_keep" }), new(new[] { "reason:default" }), - // trace_chunks_dropped, index = 100 + // trace_chunks_dropped, index = 101 new(new[] { "reason:p0_drop" }), new(new[] { "reason:overfull_buffer" }), new(new[] { "reason:serialization_error" }), new(new[] { "reason:api_error" }), - // trace_chunks_sent, index = 104 + // trace_chunks_sent, index = 105 new(null), - // trace_segments_closed, index = 105 + // trace_segments_closed, index = 106 new(null), - // trace_api.requests, index = 106 + // trace_api.requests, index = 107 new(null), - // trace_api.responses, index = 107 + // trace_api.responses, index = 108 new(new[] { "status_code:200" }), new(new[] { "status_code:201" }), new(new[] { "status_code:202" }), @@ -160,33 +161,33 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "status_code:503" }), new(new[] { "status_code:504" }), new(new[] { "status_code:5xx" }), - // trace_api.errors, index = 129 + // trace_api.errors, index = 130 new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // trace_partial_flush.count, index = 132 + // trace_partial_flush.count, index = 133 new(new[] { "reason:large_trace" }), new(new[] { "reason:single_span_ingestion" }), - // context_header_style.injected, index = 134 + // context_header_style.injected, index = 135 new(new[] { "header_style:tracecontext" }), new(new[] { "header_style:datadog" }), new(new[] { "header_style:b3multi" }), new(new[] { "header_style:b3single" }), new(new[] { "header_style:baggage" }), - // context_header_style.extracted, index = 139 + // context_header_style.extracted, index = 140 new(new[] { "header_style:tracecontext" }), new(new[] { "header_style:datadog" }), new(new[] { "header_style:b3multi" }), new(new[] { "header_style:b3single" }), new(new[] { "header_style:baggage" }), - // context_header.truncated, index = 144 + // context_header.truncated, index = 145 new(new[] { "truncation_reason:baggage_item_count_exceeded" }), new(new[] { "truncation_reason:baggage_byte_count_exceeded" }), - // context_header_style.malformed, index = 146 + // context_header_style.malformed, index = 147 new(new[] { "header_style:baggage" }), - // stats_api.requests, index = 147 + // stats_api.requests, index = 148 new(null), - // stats_api.responses, index = 148 + // stats_api.responses, index = 149 new(new[] { "status_code:200" }), new(new[] { "status_code:201" }), new(new[] { "status_code:202" }), @@ -209,11 +210,11 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "status_code:503" }), new(new[] { "status_code:504" }), new(new[] { "status_code:5xx" }), - // stats_api.errors, index = 170 + // stats_api.errors, index = 171 new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // otel.env.hiding, index = 173 + // otel.env.hiding, index = 174 new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_log_level" }), new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_metrics_exporter" }), new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_propagators" }), @@ -304,7 +305,7 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_traces_sampler" }), new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_traces_sampler_arg" }), new(new[] { "config_datadog:unknown", "config_opentelemetry:unknown" }), - // otel.env.invalid, index = 263 + // otel.env.invalid, index = 264 new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_log_level" }), new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_metrics_exporter" }), new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_propagators" }), @@ -395,30 +396,30 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_traces_sampler" }), new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_traces_sampler_arg" }), new(new[] { "config_datadog:unknown", "config_opentelemetry:unknown" }), - // otel.metrics_export_attempts, index = 353 + // otel.metrics_export_attempts, index = 354 new(new[] { "protocol:grpc", "encoding:protobuf" }), new(new[] { "protocol:grpc", "encoding:json" }), new(new[] { "protocol:http", "encoding:protobuf" }), new(new[] { "protocol:http", "encoding:json" }), - // otel.metrics_export_successes, index = 357 + // otel.metrics_export_successes, index = 358 new(new[] { "protocol:grpc", "encoding:protobuf" }), new(new[] { "protocol:grpc", "encoding:json" }), new(new[] { "protocol:http", "encoding:protobuf" }), new(new[] { "protocol:http", "encoding:json" }), - // otel.metrics_export_partial_successes, index = 361 + // otel.metrics_export_partial_successes, index = 362 new(new[] { "protocol:grpc", "encoding:protobuf" }), new(new[] { "protocol:grpc", "encoding:json" }), new(new[] { "protocol:http", "encoding:protobuf" }), new(new[] { "protocol:http", "encoding:json" }), - // otel.metrics_export_failures, index = 365 + // otel.metrics_export_failures, index = 366 new(new[] { "protocol:grpc", "encoding:protobuf" }), new(new[] { "protocol:grpc", "encoding:json" }), new(new[] { "protocol:http", "encoding:protobuf" }), new(new[] { "protocol:http", "encoding:json" }), - // telemetry_api.requests, index = 369 + // telemetry_api.requests, index = 370 new(new[] { "endpoint:agent" }), new(new[] { "endpoint:agentless" }), - // telemetry_api.responses, index = 371 + // telemetry_api.responses, index = 372 new(new[] { "endpoint:agent", "status_code:200" }), new(new[] { "endpoint:agent", "status_code:201" }), new(new[] { "endpoint:agent", "status_code:202" }), @@ -463,18 +464,18 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "endpoint:agentless", "status_code:503" }), new(new[] { "endpoint:agentless", "status_code:504" }), new(new[] { "endpoint:agentless", "status_code:5xx" }), - // telemetry_api.errors, index = 415 + // telemetry_api.errors, index = 416 new(new[] { "endpoint:agent", "type:timeout" }), new(new[] { "endpoint:agent", "type:network" }), new(new[] { "endpoint:agent", "type:status_code" }), new(new[] { "endpoint:agentless", "type:timeout" }), new(new[] { "endpoint:agentless", "type:network" }), new(new[] { "endpoint:agentless", "type:status_code" }), - // version_conflict_tracers_created, index = 421 + // version_conflict_tracers_created, index = 422 new(null), - // unsupported_custom_instrumentation_services, index = 422 + // unsupported_custom_instrumentation_services, index = 423 new(null), - // direct_log_logs, index = 423 + // direct_log_logs, index = 424 new(new[] { "integration_name:datadog" }), new(new[] { "integration_name:opentracing" }), new(new[] { "integration_name:version_conflict" }), @@ -559,9 +560,10 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "integration_name:emailhtmlinjection" }), new(new[] { "integration_name:protobuf" }), new(new[] { "integration_name:hangfire" }), - // direct_log_api.requests, index = 507 + new(new[] { "integration_name:serverlesscompat" }), + // direct_log_api.requests, index = 509 new(null), - // direct_log_api.responses, index = 508 + // direct_log_api.responses, index = 510 new(new[] { "status_code:200" }), new(new[] { "status_code:201" }), new(new[] { "status_code:202" }), @@ -584,17 +586,17 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "status_code:503" }), new(new[] { "status_code:504" }), new(new[] { "status_code:5xx" }), - // direct_log_api.errors, index = 530 + // direct_log_api.errors, index = 532 new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // waf.init, index = 533 + // waf.init, index = 535 new(new[] { "waf_version", "event_rules_version", "success:true" }), new(new[] { "waf_version", "event_rules_version", "success:false" }), - // waf.updates, index = 535 + // waf.updates, index = 537 new(new[] { "waf_version", "event_rules_version", "success:true" }), new(new[] { "waf_version", "event_rules_version", "success:false" }), - // waf.requests, index = 537 + // waf.requests, index = 539 new(new[] { "waf_version", "event_rules_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:false", "block_failure:false", "rate_limited:false", "input_truncated:false" }), new(new[] { "waf_version", "event_rules_version", "rule_triggered:true", "request_blocked:false", "waf_timeout:false", "block_failure:false", "rate_limited:false", "input_truncated:false" }), new(new[] { "waf_version", "event_rules_version", "rule_triggered:true", "request_blocked:true", "waf_timeout:false", "block_failure:false", "rate_limited:false", "input_truncated:false" }), @@ -603,17 +605,17 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "waf_version", "event_rules_version", "rule_triggered:true", "request_blocked:false", "waf_timeout:false", "block_failure:false", "rate_limited:false", "input_truncated:true" }), new(new[] { "waf_version", "event_rules_version", "rule_triggered:true", "request_blocked:true", "waf_timeout:false", "block_failure:false", "rate_limited:false", "input_truncated:true" }), new(new[] { "waf_version", "event_rules_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:true", "block_failure:false", "rate_limited:false", "input_truncated:true" }), - // waf.input_truncated, index = 545 + // waf.input_truncated, index = 547 new(new[] { "truncation_reason:string_too_long" }), new(new[] { "truncation_reason:list_or_map_too_large" }), new(new[] { "truncation_reason:object_too_deep" }), - // rasp.rule.eval, index = 548 + // rasp.rule.eval, index = 550 new(new[] { "waf_version", "event_rules_version", "rule_type:lfi" }), new(new[] { "waf_version", "event_rules_version", "rule_type:ssrf" }), new(new[] { "waf_version", "event_rules_version", "rule_type:sql_injection" }), new(new[] { "waf_version", "event_rules_version", "rule_type:command_injection", "rule_variant:shell" }), new(new[] { "waf_version", "event_rules_version", "rule_type:command_injection", "rule_variant:exec" }), - // rasp.rule.match, index = 553 + // rasp.rule.match, index = 555 new(new[] { "waf_version", "event_rules_version", "block:success", "rule_type:lfi" }), new(new[] { "waf_version", "event_rules_version", "block:success", "rule_type:ssrf" }), new(new[] { "waf_version", "event_rules_version", "block:success", "rule_type:sql_injection" }), @@ -629,29 +631,29 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "waf_version", "event_rules_version", "block:irrelevant", "rule_type:sql_injection" }), new(new[] { "waf_version", "event_rules_version", "block:irrelevant", "rule_type:command_injection", "rule_variant:shell" }), new(new[] { "waf_version", "event_rules_version", "block:irrelevant", "rule_type:command_injection", "rule_variant:exec" }), - // rasp.timeout, index = 568 + // rasp.timeout, index = 570 new(new[] { "waf_version", "event_rules_version", "rule_type:lfi" }), new(new[] { "waf_version", "event_rules_version", "rule_type:ssrf" }), new(new[] { "waf_version", "event_rules_version", "rule_type:sql_injection" }), new(new[] { "waf_version", "event_rules_version", "rule_type:command_injection", "rule_variant:shell" }), new(new[] { "waf_version", "event_rules_version", "rule_type:command_injection", "rule_variant:exec" }), - // instrum.user_auth.missing_user_id, index = 573 + // instrum.user_auth.missing_user_id, index = 575 new(new[] { "framework:aspnetcore_identity", "event_type:login_success" }), new(new[] { "framework:aspnetcore_identity", "event_type:login_failure" }), new(new[] { "framework:aspnetcore_identity", "event_type:signup" }), new(new[] { "framework:unknown", "event_type:signup" }), - // instrum.user_auth.missing_user_login, index = 577 + // instrum.user_auth.missing_user_login, index = 579 new(new[] { "framework:aspnetcore_identity", "event_type:login_success" }), new(new[] { "framework:aspnetcore_identity", "event_type:login_failure" }), new(new[] { "framework:aspnetcore_identity", "event_type:signup" }), new(new[] { "framework:unknown", "event_type:signup" }), - // sdk.event, index = 581 + // sdk.event, index = 583 new(new[] { "event_type:login_success", "sdk_version:v1" }), new(new[] { "event_type:login_success", "sdk_version:v2" }), new(new[] { "event_type:login_failure", "sdk_version:v1" }), new(new[] { "event_type:login_failure", "sdk_version:v2" }), new(new[] { "event_type:custom", "sdk_version:v1" }), - // executed.source, index = 586 + // executed.source, index = 588 new(new[] { "source_type:http.request.body" }), new(new[] { "source_type:http.request.path" }), new(new[] { "source_type:http.request.parameter.name" }), @@ -666,9 +668,9 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "source_type:http.request.uri" }), new(new[] { "source_type:grpc.request.body" }), new(new[] { "source_type:sql.row.value" }), - // executed.propagation, index = 600 + // executed.propagation, index = 602 new(null), - // executed.sink, index = 601 + // executed.sink, index = 603 new(new[] { "vulnerability_type:none" }), new(new[] { "vulnerability_type:weak_cipher" }), new(new[] { "vulnerability_type:weak_hash" }), @@ -696,9 +698,9 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "vulnerability_type:directory_listing_leak" }), new(new[] { "vulnerability_type:session_timeout" }), new(new[] { "vulnerability_type:email_html_injection" }), - // request.tainted, index = 628 + // request.tainted, index = 630 new(null), - // suppressed.vulnerabilities, index = 629 + // suppressed.vulnerabilities, index = 631 new(new[] { "vulnerability_type:none" }), new(new[] { "vulnerability_type:weak_cipher" }), new(new[] { "vulnerability_type:weak_hash" }), @@ -734,7 +736,7 @@ private static AggregatedMetric[] GetCountBuffer() /// It is equal to the cardinality of the tag combinations (or 1 if there are no tags) /// private static int[] CountEntryCounts { get; } - = new int[]{ 4, 84, 1, 3, 4, 2, 2, 4, 1, 1, 1, 22, 3, 2, 5, 5, 2, 1, 1, 22, 3, 90, 90, 4, 4, 4, 4, 2, 44, 6, 1, 1, 84, 1, 22, 3, 2, 2, 8, 3, 5, 15, 5, 4, 4, 5, 14, 1, 27, 1, 27, }; + = new int[]{ 4, 85, 1, 3, 4, 2, 2, 4, 1, 1, 1, 22, 3, 2, 5, 5, 2, 1, 1, 22, 3, 90, 90, 4, 4, 4, 4, 2, 44, 6, 1, 1, 85, 1, 22, 3, 2, 2, 8, 3, 5, 15, 5, 4, 4, 5, 14, 1, 27, 1, 27, }; public void RecordCountLogCreated(Datadog.Trace.Telemetry.Metrics.MetricTags.LogLevel tag, int increment = 1) { @@ -750,285 +752,285 @@ public void RecordCountSpanCreated(Datadog.Trace.Telemetry.Metrics.MetricTags.In public void RecordCountSpanFinished(int increment = 1) { - Interlocked.Add(ref _buffer.Count[88], increment); + Interlocked.Add(ref _buffer.Count[89], increment); } public void RecordCountSpanEnqueuedForSerialization(Datadog.Trace.Telemetry.Metrics.MetricTags.SpanEnqueueReason tag, int increment = 1) { - var index = 89 + (int)tag; + var index = 90 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountSpanDropped(Datadog.Trace.Telemetry.Metrics.MetricTags.DropReason tag, int increment = 1) { - var index = 92 + (int)tag; + var index = 93 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceSegmentCreated(Datadog.Trace.Telemetry.Metrics.MetricTags.TraceContinuation tag, int increment = 1) { - var index = 96 + (int)tag; + var index = 97 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceChunkEnqueued(Datadog.Trace.Telemetry.Metrics.MetricTags.TraceChunkEnqueueReason tag, int increment = 1) { - var index = 98 + (int)tag; + var index = 99 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceChunkDropped(Datadog.Trace.Telemetry.Metrics.MetricTags.DropReason tag, int increment = 1) { - var index = 100 + (int)tag; + var index = 101 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceChunkSent(int increment = 1) { - Interlocked.Add(ref _buffer.Count[104], increment); + Interlocked.Add(ref _buffer.Count[105], increment); } public void RecordCountTraceSegmentsClosed(int increment = 1) { - Interlocked.Add(ref _buffer.Count[105], increment); + Interlocked.Add(ref _buffer.Count[106], increment); } public void RecordCountTraceApiRequests(int increment = 1) { - Interlocked.Add(ref _buffer.Count[106], increment); + Interlocked.Add(ref _buffer.Count[107], increment); } public void RecordCountTraceApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag, int increment = 1) { - var index = 107 + (int)tag; + var index = 108 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTraceApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1) { - var index = 129 + (int)tag; + var index = 130 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTracePartialFlush(Datadog.Trace.Telemetry.Metrics.MetricTags.PartialFlushReason tag, int increment = 1) { - var index = 132 + (int)tag; + var index = 133 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountContextHeaderStyleInjected(Datadog.Trace.Telemetry.Metrics.MetricTags.ContextHeaderStyle tag, int increment = 1) { - var index = 134 + (int)tag; + var index = 135 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountContextHeaderStyleExtracted(Datadog.Trace.Telemetry.Metrics.MetricTags.ContextHeaderStyle tag, int increment = 1) { - var index = 139 + (int)tag; + var index = 140 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountContextHeaderTruncated(Datadog.Trace.Telemetry.Metrics.MetricTags.ContextHeaderTruncationReason tag, int increment = 1) { - var index = 144 + (int)tag; + var index = 145 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountContextHeaderMalformed(Datadog.Trace.Telemetry.Metrics.MetricTags.ContextHeaderMalformed tag, int increment = 1) { - var index = 146 + (int)tag; + var index = 147 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountStatsApiRequests(int increment = 1) { - Interlocked.Add(ref _buffer.Count[147], increment); + Interlocked.Add(ref _buffer.Count[148], increment); } public void RecordCountStatsApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag, int increment = 1) { - var index = 148 + (int)tag; + var index = 149 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountStatsApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1) { - var index = 170 + (int)tag; + var index = 171 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountOpenTelemetryConfigHiddenByDatadogConfig(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1) { - var index = 173 + ((int)tag1 * 10) + (int)tag2; + var index = 174 + ((int)tag1 * 10) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountOpenTelemetryConfigInvalid(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1) { - var index = 263 + ((int)tag1 * 10) + (int)tag2; + var index = 264 + ((int)tag1 * 10) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountMetricsExportAttempts(Datadog.Trace.Telemetry.Metrics.MetricTags.Protocol tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.MetricEncoding tag2, int increment = 1) { - var index = 353 + ((int)tag1 * 2) + (int)tag2; + var index = 354 + ((int)tag1 * 2) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountMetricsExportSuccesses(Datadog.Trace.Telemetry.Metrics.MetricTags.Protocol tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.MetricEncoding tag2, int increment = 1) { - var index = 357 + ((int)tag1 * 2) + (int)tag2; + var index = 358 + ((int)tag1 * 2) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountMetricsExportPartialSuccesses(Datadog.Trace.Telemetry.Metrics.MetricTags.Protocol tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.MetricEncoding tag2, int increment = 1) { - var index = 361 + ((int)tag1 * 2) + (int)tag2; + var index = 362 + ((int)tag1 * 2) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountMetricsExportFailures(Datadog.Trace.Telemetry.Metrics.MetricTags.Protocol tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.MetricEncoding tag2, int increment = 1) { - var index = 365 + ((int)tag1 * 2) + (int)tag2; + var index = 366 + ((int)tag1 * 2) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTelemetryApiRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag, int increment = 1) { - var index = 369 + (int)tag; + var index = 370 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTelemetryApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag2, int increment = 1) { - var index = 371 + ((int)tag1 * 22) + (int)tag2; + var index = 372 + ((int)tag1 * 22) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountTelemetryApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag2, int increment = 1) { - var index = 415 + ((int)tag1 * 3) + (int)tag2; + var index = 416 + ((int)tag1 * 3) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountVersionConflictTracerCreated(int increment = 1) { - Interlocked.Add(ref _buffer.Count[421], increment); + Interlocked.Add(ref _buffer.Count[422], increment); } public void RecordCountUnsupportedCustomInstrumentationServices(int increment = 1) { - Interlocked.Add(ref _buffer.Count[422], increment); + Interlocked.Add(ref _buffer.Count[423], increment); } public void RecordCountDirectLogLogs(Datadog.Trace.Telemetry.Metrics.MetricTags.IntegrationName tag, int increment = 1) { - var index = 423 + (int)tag; + var index = 424 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountDirectLogApiRequests(int increment = 1) { - Interlocked.Add(ref _buffer.Count[507], increment); + Interlocked.Add(ref _buffer.Count[509], increment); } public void RecordCountDirectLogApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag, int increment = 1) { - var index = 508 + (int)tag; + var index = 510 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountDirectLogApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1) { - var index = 530 + (int)tag; + var index = 532 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountWafInit(Datadog.Trace.Telemetry.Metrics.MetricTags.WafStatus tag, int increment = 1) { - var index = 533 + (int)tag; + var index = 535 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountWafUpdates(Datadog.Trace.Telemetry.Metrics.MetricTags.WafStatus tag, int increment = 1) { - var index = 535 + (int)tag; + var index = 537 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountWafRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.WafAnalysis tag, int increment = 1) { - var index = 537 + (int)tag; + var index = 539 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountInputTruncated(Datadog.Trace.Telemetry.Metrics.MetricTags.TruncationReason tag, int increment = 1) { - var index = 545 + (int)tag; + var index = 547 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountRaspRuleEval(Datadog.Trace.Telemetry.Metrics.MetricTags.RaspRuleType tag, int increment = 1) { - var index = 548 + (int)tag; + var index = 550 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountRaspRuleMatch(Datadog.Trace.Telemetry.Metrics.MetricTags.RaspRuleTypeMatch tag, int increment = 1) { - var index = 553 + (int)tag; + var index = 555 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountRaspTimeout(Datadog.Trace.Telemetry.Metrics.MetricTags.RaspRuleType tag, int increment = 1) { - var index = 568 + (int)tag; + var index = 570 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountMissingUserId(Datadog.Trace.Telemetry.Metrics.MetricTags.AuthenticationFrameworkWithEventType tag, int increment = 1) { - var index = 573 + (int)tag; + var index = 575 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountMissingUserLogin(Datadog.Trace.Telemetry.Metrics.MetricTags.AuthenticationFrameworkWithEventType tag, int increment = 1) { - var index = 577 + (int)tag; + var index = 579 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountUserEventSdk(Datadog.Trace.Telemetry.Metrics.MetricTags.UserEventSdk tag, int increment = 1) { - var index = 581 + (int)tag; + var index = 583 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastExecutedSources(Datadog.Trace.Telemetry.Metrics.MetricTags.IastSourceType tag, int increment = 1) { - var index = 586 + (int)tag; + var index = 588 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastExecutedPropagations(int increment = 1) { - Interlocked.Add(ref _buffer.Count[600], increment); + Interlocked.Add(ref _buffer.Count[602], increment); } public void RecordCountIastExecutedSinks(Datadog.Trace.Telemetry.Metrics.MetricTags.IastVulnerabilityType tag, int increment = 1) { - var index = 601 + (int)tag; + var index = 603 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastRequestTainted(int increment = 1) { - Interlocked.Add(ref _buffer.Count[628], increment); + Interlocked.Add(ref _buffer.Count[630], increment); } public void RecordCountIastSuppressedVulnerabilities(Datadog.Trace.Telemetry.Metrics.MetricTags.IastVulnerabilityType tag, int increment = 1) { - var index = 629 + (int)tag; + var index = 631 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } } \ No newline at end of file diff --git a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs index d60501e4f45d..82355f89f551 100644 --- a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/MetricsTelemetryCollector_CountShared.g.cs @@ -11,7 +11,7 @@ namespace Datadog.Trace.Telemetry; internal sealed partial class MetricsTelemetryCollector { - private const int CountSharedLength = 336; + private const int CountSharedLength = 340; /// /// Creates the buffer for the values. @@ -356,6 +356,10 @@ private static AggregatedMetric[] GetCountSharedBuffer() new(new[] { "integration_name:hangfire", "error_type:invoker" }), new(new[] { "integration_name:hangfire", "error_type:execution" }), new(new[] { "integration_name:hangfire", "error_type:missing_member" }), + new(new[] { "integration_name:serverlesscompat", "error_type:duck_typing" }), + new(new[] { "integration_name:serverlesscompat", "error_type:invoker" }), + new(new[] { "integration_name:serverlesscompat", "error_type:execution" }), + new(new[] { "integration_name:serverlesscompat", "error_type:missing_member" }), }; /// @@ -364,7 +368,7 @@ private static AggregatedMetric[] GetCountSharedBuffer() /// It is equal to the cardinality of the tag combinations (or 1 if there are no tags) /// private static int[] CountSharedEntryCounts { get; } - = new int[]{ 336, }; + = new int[]{ 340, }; public void RecordCountSharedIntegrationsError(Datadog.Trace.Telemetry.Metrics.MetricTags.IntegrationName tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.InstrumentationError tag2, int increment = 1) { diff --git a/tracer/src/Datadog.Trace/Serverless/ServerlessCompatPipeNameHelper.cs b/tracer/src/Datadog.Trace/Serverless/ServerlessCompatPipeNameHelper.cs new file mode 100644 index 000000000000..922a52fa1a54 --- /dev/null +++ b/tracer/src/Datadog.Trace/Serverless/ServerlessCompatPipeNameHelper.cs @@ -0,0 +1,120 @@ +// +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc. +// + +#nullable enable + +using System; +using System.IO; +using System.Reflection; +using System.Runtime.InteropServices; +using Datadog.Trace.Logging; + +namespace Datadog.Trace.Serverless +{ + /// + /// Helper class for generating unique pipe names for serverless compat layer coordination. + /// Shared logic for both trace and metrics pipe name generation. + /// + internal static class ServerlessCompatPipeNameHelper + { + private static readonly IDatadogLogger Log = DatadogLogging.GetLoggerFor(typeof(ServerlessCompatPipeNameHelper)); + + /// + /// Generates a unique pipe name by appending a GUID to the base name. + /// Validates and truncates the base name if necessary to ensure the full pipe path stays within Windows limits. + /// + /// The base name for the pipe + /// The type of pipe for logging (e.g., "trace" or "DogStatsD") + /// A unique pipe name in the format {base}_{guid} + internal static string GenerateUniquePipeName(string baseName, string pipeType) + { + // Validate base pipe name length before appending GUID + // Windows pipe path format: \\.\pipe\{base}_{guid} + // Max total: 256 - 9 (\\.\pipe\) - 1 (underscore) - 32 (GUID) = 214 + const int maxBaseLength = 214; + + if (baseName.Length > maxBaseLength) + { + Log.Warning("{PipeType} pipe base name exceeds {MaxLength} characters ({ActualLength}). Truncating to allow for GUID suffix.", pipeType, maxBaseLength, baseName.Length); + baseName = baseName.Substring(0, maxBaseLength); + } + + // "N" format removes hyphens (32 chars) + var uniqueName = $"{baseName}_{Guid.NewGuid():N}"; + + return uniqueName; + } + + /// + /// Checks whether the Datadog Serverless Compat layer is deployed and has a version + /// that supports named pipe transport. This is called during ExporterSettings construction + /// (before the compat assembly is loaded) so it checks files on disk rather than + /// loaded assemblies. + /// + internal static bool IsCompatLayerAvailableWithPipeSupport() + => IsCompatLayerAvailableWithPipeSupport(File.Exists, path => AssemblyName.GetAssemblyName(path).Version); + + /// + /// Testable overload that accepts I/O dependencies as delegates. + /// + internal static bool IsCompatLayerAvailableWithPipeSupport( + Func fileExists, + Func getAssemblyVersion) + { + try + { + // Named pipes are Windows-only +#if !NETFRAMEWORK + if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + return false; + } +#endif + + // Check that the compat binary exists — it's what actually listens on the named pipe. + // DD_SERVERLESS_COMPAT_PATH overrides the default binary location + // (matches CompatibilityLayer.cs in datadog-serverless-compat-dotnet). + const string defaultCompatBinaryPath = @"C:\home\site\wwwroot\datadog\bin\windows-amd64\datadog-serverless-compat.exe"; + var compatBinaryPath = Util.EnvironmentHelpers.GetEnvironmentVariable(Configuration.ConfigurationKeys.ServerlessCompatPath) + ?? defaultCompatBinaryPath; + + // Check that the compat DLL exists and has a version that supports named pipes. + // Named pipe support was added in compat version 1.4.0 (dev builds use 0.0.0). + var compatDllPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory ?? string.Empty, "Datadog.Serverless.Compat.dll"); + if (!fileExists(compatBinaryPath) || !fileExists(compatDllPath)) + { + Log.Debug("Did not find Serverless Compatibility Layer or related DLLs."); + return false; + } + + var version = getAssemblyVersion(compatDllPath); + + if (version is null) + { + Log.Warning("Could not read Serverless Compatibility Layer details at {Path}, using fallback agent communication methods. (No Named Pipes)", compatDllPath); + return false; + } + + // Allow 0.0.0 (dev builds) or >= 1.4.0 (first release with pipe support) + var isDevBuild = version.Major == 0 && version.Minor == 0 && version.Build == 0; + var isSupported = version.Major > 1 || (version.Major == 1 && version.Minor >= 4); + + if (isDevBuild || isSupported) + { + Log.Debug("Compat layer version {Version} supports named pipes.", version); + return true; + } + + Log.Debug("Compat layer version {Version} does not support named pipes (requires v1.4.0 or greater. Using fallback communication methods.)", version); + return false; + } + catch (Exception ex) + { + Log.Warning(ex, "Failed to determine Serverless Compatibility layer availability or Named Pipe Support."); + return false; + } + } + } +} diff --git a/tracer/src/Datadog.Trace/Telemetry/Metrics/IntegrationIdExtensions.cs b/tracer/src/Datadog.Trace/Telemetry/Metrics/IntegrationIdExtensions.cs index 9fe5ee486075..3e2d7e976cab 100644 --- a/tracer/src/Datadog.Trace/Telemetry/Metrics/IntegrationIdExtensions.cs +++ b/tracer/src/Datadog.Trace/Telemetry/Metrics/IntegrationIdExtensions.cs @@ -92,6 +92,7 @@ public static MetricTags.IntegrationName GetMetricTag(this IntegrationId integra IntegrationId.Hangfire => MetricTags.IntegrationName.Hangfire, IntegrationId.DatadogTraceVersionConflict => MetricTags.IntegrationName.VersionConflict, IntegrationId.OpenFeature => MetricTags.IntegrationName.OpenFeature, + IntegrationId.ServerlessCompat => MetricTags.IntegrationName.ServerlessCompat, _ => throw new InvalidOperationException($"Unknown IntegrationID {integrationId}"), // dangerous, but we test it will never be called }; } diff --git a/tracer/src/Datadog.Trace/Telemetry/Metrics/MetricTags.cs b/tracer/src/Datadog.Trace/Telemetry/Metrics/MetricTags.cs index 5a48f96cab4e..aabd0713525d 100644 --- a/tracer/src/Datadog.Trace/Telemetry/Metrics/MetricTags.cs +++ b/tracer/src/Datadog.Trace/Telemetry/Metrics/MetricTags.cs @@ -277,7 +277,8 @@ internal enum IntegrationName [Description("integration_name:datadogtracemanual")] DatadogTraceManual, [Description("integration_name:emailhtmlinjection")] EmailHtmlInjection, [Description("integration_name:protobuf")] Protobuf, - [Description("integration_name:hangfire")] Hangfire + [Description("integration_name:hangfire")] Hangfire, + [Description("integration_name:serverlesscompat")] ServerlessCompat } public enum InstrumentationError diff --git a/tracer/src/Datadog.Tracer.Native/Generated/generated_calltargets.g.cpp b/tracer/src/Datadog.Tracer.Native/Generated/generated_calltargets.g.cpp index bff0c2b3a9ae..d94a643b4435 100644 --- a/tracer/src/Datadog.Tracer.Native/Generated/generated_calltargets.g.cpp +++ b/tracer/src/Datadog.Tracer.Native/Generated/generated_calltargets.g.cpp @@ -1100,6 +1100,8 @@ std::vector callTargets = {(WCHAR*)WStr("Serilog"),(WCHAR*)WStr("Serilog.Core.Logger"),(WCHAR*)WStr("Dispatch"),sig345,2,2,0,0,4,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.Logging.Serilog.LogsInjection.LoggerDispatchInstrumentation"),CallTargetKind::Default,1,15}, {(WCHAR*)WStr("Serilog"),(WCHAR*)WStr("Serilog.Core.Pipeline.Logger"),(WCHAR*)WStr("Dispatch"),sig345,2,1,4,0,1,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.Logging.Serilog.LogsInjection.LoggerDispatchInstrumentation"),CallTargetKind::Default,1,15}, {(WCHAR*)WStr("Serilog"),(WCHAR*)WStr("Serilog.LoggerConfiguration"),(WCHAR*)WStr("CreateLogger"),sig124,1,1,0,0,4,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.Logging.Serilog.DirectSubmission.LoggerConfigurationInstrumentation"),CallTargetKind::Default,1,15}, +{(WCHAR*)WStr("Datadog.Serverless.Compat"),(WCHAR*)WStr("Datadog.Serverless.CompatibilityLayer"),(WCHAR*)WStr("CalculateDogStatsDPipeName"),sig173,1,0,0,0,1,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.Serverless.CompatibilityLayer_CalculateDogStatsDPipeName_Integration"),CallTargetKind::Default,1,14}, +{(WCHAR*)WStr("Datadog.Serverless.Compat"),(WCHAR*)WStr("Datadog.Serverless.CompatibilityLayer"),(WCHAR*)WStr("CalculateTracePipeName"),sig173,1,0,0,0,1,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.Serverless.CompatibilityLayer_CalculateTracePipeName_Integration"),CallTargetKind::Default,1,14}, {(WCHAR*)WStr("ServiceStack.Redis"),(WCHAR*)WStr("ServiceStack.Redis.RedisNativeClient"),(WCHAR*)WStr("SendReceive"),sig002,5,4,0,0,6,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.Redis.ServiceStack.RedisNativeClientSendReceiveIntegration"),CallTargetKind::Default,1,15}, {(WCHAR*)WStr("ServiceStack.Redis"),(WCHAR*)WStr("ServiceStack.Redis.RedisNativeClient"),(WCHAR*)WStr("SendReceive"),sig003,6,6,0,0,10,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.Redis.ServiceStack.RedisNativeClientSendReceiveIntegration_6_2_0"),CallTargetKind::Default,1,15}, {(WCHAR*)WStr("Microsoft.Data.SqlClient"),(WCHAR*)WStr("Microsoft.Data.SqlClient.SqlCommand"),(WCHAR*)WStr("ExecuteDbDataReader"),sig140,2,1,0,0,7,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.AdoNet.CommandExecuteReaderWithBehaviorIntegration"),CallTargetKind::Default,1,15}, diff --git a/tracer/test/Datadog.Trace.ClrProfiler.Managed.Tests/AutoInstrumentation/Serverless/ServerlessCompatIntegrationTests.cs b/tracer/test/Datadog.Trace.ClrProfiler.Managed.Tests/AutoInstrumentation/Serverless/ServerlessCompatIntegrationTests.cs new file mode 100644 index 000000000000..6592d261ee91 --- /dev/null +++ b/tracer/test/Datadog.Trace.ClrProfiler.Managed.Tests/AutoInstrumentation/Serverless/ServerlessCompatIntegrationTests.cs @@ -0,0 +1,48 @@ +// +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc. +// + +#nullable enable + +#if !NETFRAMEWORK +using System; +using Datadog.Trace.ClrProfiler.AutoInstrumentation.Serverless; +using Datadog.Trace.ClrProfiler.CallTarget; +using FluentAssertions; +using Xunit; + +namespace Datadog.Trace.Tests.ClrProfiler.AutoInstrumentation.Serverless; + +public class ServerlessCompatIntegrationTests +{ + [Theory] + [InlineData("trace")] + [InlineData("dogstatsd")] + public void OnMethodEnd_WithException_PassesThroughOriginalValue(string pipeType) + { + const string originalValue = "original_pipe_name"; + var exception = new InvalidOperationException("Test exception"); + + CallTargetReturn result = pipeType == "trace" + ? CompatibilityLayer_CalculateTracePipeName_Integration.OnMethodEnd(null!, originalValue, exception, default) + : CompatibilityLayer_CalculateDogStatsDPipeName_Integration.OnMethodEnd(null!, originalValue, exception, default); + + result.GetReturnValue().Should().Be(originalValue); + } + + [Theory] + [InlineData("trace", "dd_trace_from_compat_layer")] + [InlineData("dogstatsd", "dd_dogstatsd_from_compat_layer")] + public void OnMethodEnd_WhenTracerHasNoPipeName_FallsBackToReturnValue(string pipeType, string compatLayerName) + { + // In a unit test environment, Tracer.Instance won't have pipe names configured, + // so the integration should fall back to the compat layer's own calculated name. + CallTargetReturn result = pipeType == "trace" + ? CompatibilityLayer_CalculateTracePipeName_Integration.OnMethodEnd(null!, compatLayerName, null!, default) + : CompatibilityLayer_CalculateDogStatsDPipeName_Integration.OnMethodEnd(null!, compatLayerName, null!, default); + + result.GetReturnValue().Should().Be(compatLayerName); + } +} +#endif diff --git a/tracer/test/Datadog.Trace.Tests/Configuration/ExporterSettingsAzureFunctionsPipeTests.cs b/tracer/test/Datadog.Trace.Tests/Configuration/ExporterSettingsAzureFunctionsPipeTests.cs new file mode 100644 index 000000000000..7a6ceae89df2 --- /dev/null +++ b/tracer/test/Datadog.Trace.Tests/Configuration/ExporterSettingsAzureFunctionsPipeTests.cs @@ -0,0 +1,80 @@ +// +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc. +// + +#nullable enable + +using System.Collections.Specialized; +using Datadog.Trace.Agent; +using Datadog.Trace.Configuration; +using Datadog.Trace.Configuration.Telemetry; +using FluentAssertions; +using Xunit; +using MetricsTransportType = Datadog.Trace.Vendors.StatsdClient.Transport.TransportType; + +namespace Datadog.Trace.Tests.Configuration +{ + public class ExporterSettingsAzureFunctionsPipeTests + { + [Theory] + [InlineData("my_explicit_pipe", "my_explicit_pipe")] + [InlineData("", null)] + [InlineData(null, null)] + public void Constructor_SelectsCorrectTracesPipeName(string? explicitPipeName, string? expectedPipeName) + { + var config = new NameValueCollection(); + if (explicitPipeName is not null) + { + config.Add(ConfigurationKeys.TracesPipeName, explicitPipeName); + } + + var source = new NameValueConfigurationSource(config); + var settings = new ExporterSettings(source, _ => false, NullConfigurationTelemetry.Instance); + + if (expectedPipeName is not null) + { + settings.TracesPipeName.Should().Be(expectedPipeName); + settings.TracesTransport.Should().Be(TracesTransportType.WindowsNamedPipe); + } + else + { + // When no explicit pipe name is configured and not in Azure Functions, + // pipe transport is not used so TracesPipeName should be null. + // In Azure Functions, the constructor generates a unique name which + // is covered by integration tests. + settings.TracesPipeName.Should().BeNull(); + } + } + + [Theory] + [InlineData("my_explicit_pipe", "my_explicit_pipe")] + [InlineData("", null)] + [InlineData(null, null)] + public void Constructor_SelectsCorrectMetricsPipeName(string? explicitPipeName, string? expectedPipeName) + { + var config = new NameValueCollection(); + if (explicitPipeName is not null) + { + config.Add(ConfigurationKeys.MetricsPipeName, explicitPipeName); + } + + var source = new NameValueConfigurationSource(config); + var settings = new ExporterSettings(source, _ => false, NullConfigurationTelemetry.Instance); + + if (expectedPipeName is not null) + { + settings.MetricsPipeName.Should().Be(expectedPipeName); + settings.MetricsTransport.Should().Be(MetricsTransportType.NamedPipe); + } + else + { + // When no explicit pipe name is configured and not in Azure Functions, + // pipe transport is not used so MetricsPipeName should be null. + // In Azure Functions, the constructor generates a unique name which + // is covered by integration tests. + settings.MetricsPipeName.Should().BeNull(); + } + } + } +} diff --git a/tracer/test/Datadog.Trace.Tests/Serverless/ServerlessCompatPipeNameHelperTests.cs b/tracer/test/Datadog.Trace.Tests/Serverless/ServerlessCompatPipeNameHelperTests.cs new file mode 100644 index 000000000000..49deff467bd5 --- /dev/null +++ b/tracer/test/Datadog.Trace.Tests/Serverless/ServerlessCompatPipeNameHelperTests.cs @@ -0,0 +1,165 @@ +// +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc. +// + +#nullable enable + +using System; +using Datadog.Trace.Serverless; +using Datadog.Trace.TestHelpers; +using FluentAssertions; +using Xunit; + +namespace Datadog.Trace.Tests.Serverless +{ + public class ServerlessCompatPipeNameHelperTests + { + [Theory] + [InlineData("")] + [InlineData("x")] + [InlineData("dd_trace")] + [InlineData("dd_dogstatsd")] + public void GenerateUniquePipeName_ReturnsCorrectFormat(string baseName) + { + var result = ServerlessCompatPipeNameHelper.GenerateUniquePipeName(baseName, "test"); + + // Format: {baseName}_{32-char-hex-guid} + result.Should().StartWith(baseName + "_"); + var guidPart = result.Substring(baseName.Length + 1); + guidPart.Should().HaveLength(32); + Guid.TryParse(guidPart, out _).Should().BeTrue(); + } + + [Fact] + public void GenerateUniquePipeName_TruncatesBaseNameExceeding214Chars() + { + var longBase = new string('a', 215); + + var result = ServerlessCompatPipeNameHelper.GenerateUniquePipeName(longBase, "test"); + + // Truncated to 214 + "_" + 32-char guid = 247 total + result.Should().HaveLength(214 + 1 + 32); + } + + [Fact] + public void GenerateUniquePipeName_BaseNameAtLimit_IsNotTruncated() + { + var exactBase = new string('a', 214); + + var result = ServerlessCompatPipeNameHelper.GenerateUniquePipeName(exactBase, "test"); + + result.Should().StartWith(exactBase + "_"); + result.Should().HaveLength(214 + 1 + 32); + } + + [Fact] + public void GenerateUniquePipeName_ProducesDifferentNamesPerCall() + { + var first = ServerlessCompatPipeNameHelper.GenerateUniquePipeName("dd_trace", "test"); + var second = ServerlessCompatPipeNameHelper.GenerateUniquePipeName("dd_trace", "test"); + + first.Should().NotBe(second); + } + + [Fact] + public void IsCompatLayerAvailableWithPipeSupport_DoesNotThrow() + { + // Should never throw regardless of environment — errors are caught internally + var act = () => ServerlessCompatPipeNameHelper.IsCompatLayerAvailableWithPipeSupport(); + + act.Should().NotThrow(); + } + + [SkippableFact] + public void IsCompatLayerAvailableWithPipeSupport_ReturnsFalse_WhenNotOnWindows() + { + SkipOn.Platform(SkipOn.PlatformValue.Windows); + + var result = ServerlessCompatPipeNameHelper.IsCompatLayerAvailableWithPipeSupport(); + + result.Should().BeFalse(); + } + + [SkippableFact] + public void IsCompatLayerAvailableWithPipeSupport_ReturnsFalse_WhenCompatBinaryMissing() + { + SkipOn.AllExcept(SkipOn.PlatformValue.Windows); + + // Binary missing, DLL present + var result = ServerlessCompatPipeNameHelper.IsCompatLayerAvailableWithPipeSupport( + fileExists: path => !path.EndsWith(".exe"), + getAssemblyVersion: _ => new Version(1, 4, 0)); + + result.Should().BeFalse(); + } + + [SkippableFact] + public void IsCompatLayerAvailableWithPipeSupport_ReturnsFalse_WhenCompatDllMissing() + { + SkipOn.AllExcept(SkipOn.PlatformValue.Windows); + + // Binary present, DLL missing + var result = ServerlessCompatPipeNameHelper.IsCompatLayerAvailableWithPipeSupport( + fileExists: path => !path.EndsWith(".dll"), + getAssemblyVersion: _ => new Version(1, 4, 0)); + + result.Should().BeFalse(); + } + + [SkippableFact] + public void IsCompatLayerAvailableWithPipeSupport_ReturnsFalse_WhenVersionIsNull() + { + SkipOn.AllExcept(SkipOn.PlatformValue.Windows); + + var result = ServerlessCompatPipeNameHelper.IsCompatLayerAvailableWithPipeSupport( + fileExists: _ => true, + getAssemblyVersion: _ => null); + + result.Should().BeFalse(); + } + + [SkippableTheory] + [InlineData(1, 3, 0)] + [InlineData(1, 0, 0)] + [InlineData(0, 1, 0)] + public void IsCompatLayerAvailableWithPipeSupport_ReturnsFalse_WhenVersionTooOld(int major, int minor, int build) + { + SkipOn.AllExcept(SkipOn.PlatformValue.Windows); + + var result = ServerlessCompatPipeNameHelper.IsCompatLayerAvailableWithPipeSupport( + fileExists: _ => true, + getAssemblyVersion: _ => new Version(major, minor, build)); + + result.Should().BeFalse(); + } + + [SkippableTheory] + [InlineData(0, 0, 0)] // dev build + [InlineData(1, 4, 0)] // minimum supported + [InlineData(1, 5, 0)] // above minimum + [InlineData(2, 0, 0)] // major version bump + public void IsCompatLayerAvailableWithPipeSupport_ReturnsTrue_WhenVersionSupported(int major, int minor, int build) + { + SkipOn.AllExcept(SkipOn.PlatformValue.Windows); + + var result = ServerlessCompatPipeNameHelper.IsCompatLayerAvailableWithPipeSupport( + fileExists: _ => true, + getAssemblyVersion: _ => new Version(major, minor, build)); + + result.Should().BeTrue(); + } + + [SkippableFact] + public void IsCompatLayerAvailableWithPipeSupport_ReturnsFalse_WhenGetVersionThrows() + { + SkipOn.AllExcept(SkipOn.PlatformValue.Windows); + + var result = ServerlessCompatPipeNameHelper.IsCompatLayerAvailableWithPipeSupport( + fileExists: _ => true, + getAssemblyVersion: _ => throw new BadImageFormatException("not a valid assembly")); + + result.Should().BeFalse(); + } + } +} diff --git a/tracer/test/Datadog.Trace.Tests/Telemetry/config_norm_rules.json b/tracer/test/Datadog.Trace.Tests/Telemetry/config_norm_rules.json index aa138013be49..5fbae23a78c6 100644 --- a/tracer/test/Datadog.Trace.Tests/Telemetry/config_norm_rules.json +++ b/tracer/test/Datadog.Trace.Tests/Telemetry/config_norm_rules.json @@ -346,6 +346,7 @@ "DD_DOGSTATSD_ARGS": "agent_dogstatsd_executable_args", "DD_DIAGNOSTIC_SOURCE_ENABLED": "trace_diagnostic_source_enabled", "DD_SITE": "site", + "DD_SERVERLESS_COMPAT_PATH": "serverless_compat_path", "DD_TRACE_HTTP_CLIENT_EXCLUDED_URL_SUBSTRINGS": "trace_http_client_excluded_urls", "DD_HTTP_SERVER_ERROR_STATUSES": "trace_http_server_error_statuses", "DD_HTTP_CLIENT_ERROR_STATUSES": "trace_http_client_error_statuses",