diff --git a/tracer/src/Datadog.Trace.Tools.Runner/Utils.cs b/tracer/src/Datadog.Trace.Tools.Runner/Utils.cs index 1211114bf25d..f64b3e712a7c 100644 --- a/tracer/src/Datadog.Trace.Tools.Runner/Utils.cs +++ b/tracer/src/Datadog.Trace.Tools.Runner/Utils.cs @@ -17,6 +17,7 @@ using System.Xml; using Datadog.Trace.Agent.DiscoveryService; using Datadog.Trace.Configuration; +using Datadog.Trace.Configuration.ConfigurationSources.Telemetry; using Datadog.Trace.Configuration.Telemetry; using Datadog.Trace.Logging; using Datadog.Trace.Util; @@ -405,7 +406,7 @@ public static string GetEnvironmentVariable(string key, string defaultValue = nu configurationSource.AddInternal(new NameValueConfigurationSource(env, ConfigurationOrigins.EnvVars)); configurationSource.AddInternal(GlobalConfigurationSource.Instance); - var tracerSettings = new TracerSettings(configurationSource, new ConfigurationTelemetry()); + var tracerSettings = new TracerSettings(configurationSource, new ConfigurationTelemetry(), new OverrideErrorLog()); var settings = new ImmutableTracerSettings(tracerSettings, unusedParamNotToUsePublicApi: true); Log.Debug("Creating DiscoveryService for: {AgentUriInternal}", settings.ExporterInternal.AgentUriInternal); diff --git a/tracer/src/Datadog.Trace/Ci/Configuration/CIVisibilitySettings.cs b/tracer/src/Datadog.Trace/Ci/Configuration/CIVisibilitySettings.cs index 26eebfb77b8f..54d6899b9d06 100644 --- a/tracer/src/Datadog.Trace/Ci/Configuration/CIVisibilitySettings.cs +++ b/tracer/src/Datadog.Trace/Ci/Configuration/CIVisibilitySettings.cs @@ -8,6 +8,7 @@ using System.Collections.Specialized; using System.Threading; using Datadog.Trace.Configuration; +using Datadog.Trace.Configuration.ConfigurationSources.Telemetry; using Datadog.Trace.Configuration.Telemetry; using Datadog.Trace.Telemetry; using Datadog.Trace.Util; @@ -231,7 +232,7 @@ private TracerSettings InitializeTracerSettings() }, ConfigurationOrigins.Calculated)); - var tracerSettings = new TracerSettings(source, new ConfigurationTelemetry()); + var tracerSettings = new TracerSettings(source, new ConfigurationTelemetry(), new OverrideErrorLog()); if (Logs) { diff --git a/tracer/src/Datadog.Trace/Configuration/ConfigurationSources/Telemetry/ConfigurationBuilder.cs b/tracer/src/Datadog.Trace/Configuration/ConfigurationSources/Telemetry/ConfigurationBuilder.cs index fde8ac55d1f1..ca620c125801 100644 --- a/tracer/src/Datadog.Trace/Configuration/ConfigurationSources/Telemetry/ConfigurationBuilder.cs +++ b/tracer/src/Datadog.Trace/Configuration/ConfigurationSources/Telemetry/ConfigurationBuilder.cs @@ -59,32 +59,6 @@ public ConfigurationBuilder(IConfigurationSource source, IConfigurationTelemetry public HasKeys WithKeys(string key, string fallbackKey1, string fallbackKey2, string fallbackKey3) => new(_source, _telemetry, key, fallbackKey1, fallbackKey2, fallbackKey3); - private static bool TryHandleOverrides( - ConfigurationResult datadogConfigResult, - ConfigurationResult otelConfigResult, - [NotNullWhen(true)] out T? value) - { - if (datadogConfigResult.IsPresent && otelConfigResult.IsPresent) - { - // TODO Log to user and report "otel.env.hiding" telemetry metric - } - else if (otelConfigResult is { IsPresent: true } config) - { - if (config is { Result: { } openTelemetryValue, IsValid: true }) - { - { - value = openTelemetryValue; - return true; - } - } - - // TODO Log to user and report "otel.env.invalid" telemetry metric - } - - value = default; - return false; - } - private static bool TryHandleResult( IConfigurationTelemetry telemetry, string key, @@ -526,19 +500,19 @@ public T WithDefault(Func> getDefaultValue) return default; // should never be invoked because we have a value for getDefaultValue } - public T? OverrideWith(in StructConfigurationResultWithKey otelConfig) - => CalculateOverrides(in otelConfig, getDefaultValue: null); + public T? OverrideWith(in StructConfigurationResultWithKey otelConfig, IConfigurationOverrideHandler overrideHandler) + => CalculateOverrides(in otelConfig, overrideHandler, getDefaultValue: null); - public T OverrideWith(in StructConfigurationResultWithKey otelConfig, T defaultValue) - => CalculateOverrides(in otelConfig, getDefaultValue: () => defaultValue).Value; + public T OverrideWith(in StructConfigurationResultWithKey otelConfig, IConfigurationOverrideHandler overrideHandler, T defaultValue) + => CalculateOverrides(in otelConfig, overrideHandler, getDefaultValue: () => defaultValue).Value; - public T OverrideWith(in StructConfigurationResultWithKey otelConfig, Func> getDefaultValue) - => CalculateOverrides(in otelConfig, getDefaultValue).Value; + public T OverrideWith(in StructConfigurationResultWithKey otelConfig, IConfigurationOverrideHandler overrideHandler, Func> getDefaultValue) + => CalculateOverrides(in otelConfig, overrideHandler, getDefaultValue).Value; [return: NotNullIfNotNull(nameof(getDefaultValue))] - private T? CalculateOverrides(in StructConfigurationResultWithKey otelConfig, Func>? getDefaultValue) + private T? CalculateOverrides(in StructConfigurationResultWithKey otelConfig, IConfigurationOverrideHandler overrideHandler, Func>? getDefaultValue) { - if (TryHandleOverrides(ConfigurationResult, otelConfig.ConfigurationResult, out var overridden)) + if (overrideHandler.TryHandleOverrides(Key, ConfigurationResult, otelConfig.Key, otelConfig.ConfigurationResult, out var overridden)) { return overridden; } @@ -574,19 +548,19 @@ public T WithDefault(Func> getDefaultValue) return default!; // should never be invoked because we have a value for getDefaultValue } - public T? OverrideWith(in ClassConfigurationResultWithKey otelConfig) - => CalculateOverrides(in otelConfig, getDefaultValue: null); + public T? OverrideWith(in ClassConfigurationResultWithKey otelConfig, IConfigurationOverrideHandler overrideHandler) + => CalculateOverrides(in otelConfig, overrideHandler, getDefaultValue: null); - public T OverrideWith(in ClassConfigurationResultWithKey otelConfig, T defaultValue) - => CalculateOverrides(in otelConfig, getDefaultValue: () => defaultValue); + public T OverrideWith(in ClassConfigurationResultWithKey otelConfig, IConfigurationOverrideHandler overrideHandler, T defaultValue) + => CalculateOverrides(in otelConfig, overrideHandler, getDefaultValue: () => defaultValue); - public T OverrideWith(in ClassConfigurationResultWithKey otelConfig, Func> getDefaultValue) - => CalculateOverrides(in otelConfig, getDefaultValue); + public T OverrideWith(in ClassConfigurationResultWithKey otelConfig, IConfigurationOverrideHandler overrideHandler, Func> getDefaultValue) + => CalculateOverrides(in otelConfig, overrideHandler, getDefaultValue); [return: NotNullIfNotNull(nameof(getDefaultValue))] - private T? CalculateOverrides(in ClassConfigurationResultWithKey otelConfig, Func>? getDefaultValue) + private T? CalculateOverrides(in ClassConfigurationResultWithKey otelConfig, IConfigurationOverrideHandler overrideHandler, Func>? getDefaultValue) { - if (TryHandleOverrides(ConfigurationResult, otelConfig.ConfigurationResult, out var overridden)) + if (overrideHandler.TryHandleOverrides(Key, ConfigurationResult, otelConfig.Key, otelConfig.ConfigurationResult, out var overridden)) { return overridden; } diff --git a/tracer/src/Datadog.Trace/Configuration/ConfigurationSources/Telemetry/IConfigurationOverrideHandler.cs b/tracer/src/Datadog.Trace/Configuration/ConfigurationSources/Telemetry/IConfigurationOverrideHandler.cs new file mode 100644 index 000000000000..d827b768f681 --- /dev/null +++ b/tracer/src/Datadog.Trace/Configuration/ConfigurationSources/Telemetry/IConfigurationOverrideHandler.cs @@ -0,0 +1,20 @@ +// +// 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.Diagnostics.CodeAnalysis; + +namespace Datadog.Trace.Configuration.ConfigurationSources.Telemetry; + +internal interface IConfigurationOverrideHandler +{ + bool TryHandleOverrides( + string datadogKey, + ConfigurationResult datadogConfigResult, + string otelKey, + ConfigurationResult otelConfigResult, + [NotNullWhen(true)] out T? value); +} diff --git a/tracer/src/Datadog.Trace/Configuration/ConfigurationSources/Telemetry/OpenTelemetryHelpers.cs b/tracer/src/Datadog.Trace/Configuration/ConfigurationSources/Telemetry/OpenTelemetryHelpers.cs new file mode 100644 index 000000000000..4221291714e6 --- /dev/null +++ b/tracer/src/Datadog.Trace/Configuration/ConfigurationSources/Telemetry/OpenTelemetryHelpers.cs @@ -0,0 +1,72 @@ +// +// 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.Telemetry.Metrics; + +namespace Datadog.Trace.Configuration.ConfigurationSources.Telemetry +{ + internal static class OpenTelemetryHelpers + { + public static void GetConfigurationMetricTags( + string openTelemetryKey, + out MetricTags.OpenTelemetryConfiguration openTelemetryConfig, + out MetricTags.DatadogConfiguration datadogConfig) + { + if (string.Equals(openTelemetryKey, "OTEL_SERVICE_NAME", StringComparison.OrdinalIgnoreCase)) + { + openTelemetryConfig = MetricTags.OpenTelemetryConfiguration.ServiceName; + datadogConfig = MetricTags.DatadogConfiguration.Service; + } + else if (string.Equals(openTelemetryKey, "OTEL_LOG_LEVEL", StringComparison.OrdinalIgnoreCase)) + { + openTelemetryConfig = MetricTags.OpenTelemetryConfiguration.LogLevel; + datadogConfig = MetricTags.DatadogConfiguration.DebugEnabled; + } + else if (string.Equals(openTelemetryKey, "OTEL_PROPAGATORS", StringComparison.OrdinalIgnoreCase)) + { + openTelemetryConfig = MetricTags.OpenTelemetryConfiguration.Propagators; + datadogConfig = MetricTags.DatadogConfiguration.PropagationStyle; + } + else if (string.Equals(openTelemetryKey, "OTEL_TRACES_SAMPLER", StringComparison.OrdinalIgnoreCase)) + { + openTelemetryConfig = MetricTags.OpenTelemetryConfiguration.TracesSampler; + datadogConfig = MetricTags.DatadogConfiguration.SampleRate; + } + else if (string.Equals(openTelemetryKey, "OTEL_TRACES_SAMPLER_ARG", StringComparison.OrdinalIgnoreCase)) + { + openTelemetryConfig = MetricTags.OpenTelemetryConfiguration.TracesSamplerArg; + datadogConfig = MetricTags.DatadogConfiguration.SampleRate; + } + else if (string.Equals(openTelemetryKey, "OTEL_TRACES_EXPORTER", StringComparison.OrdinalIgnoreCase)) + { + openTelemetryConfig = MetricTags.OpenTelemetryConfiguration.TracesExporter; + datadogConfig = MetricTags.DatadogConfiguration.TraceEnabled; + } + else if (string.Equals(openTelemetryKey, "OTEL_METRICS_EXPORTER", StringComparison.OrdinalIgnoreCase)) + { + openTelemetryConfig = MetricTags.OpenTelemetryConfiguration.MetricsExporter; + datadogConfig = MetricTags.DatadogConfiguration.RuntimeMetricsEnabled; + } + else if (string.Equals(openTelemetryKey, "OTEL_RESOURCE_ATTRIBUTES", StringComparison.OrdinalIgnoreCase)) + { + openTelemetryConfig = MetricTags.OpenTelemetryConfiguration.ResourceAttributes; + datadogConfig = MetricTags.DatadogConfiguration.Tags; + } + else if (string.Equals(openTelemetryKey, "OTEL_SDK_DISABLED", StringComparison.OrdinalIgnoreCase)) + { + openTelemetryConfig = MetricTags.OpenTelemetryConfiguration.SdkDisabled; + datadogConfig = MetricTags.DatadogConfiguration.OpenTelemetryEnabled; + } + else + { + openTelemetryConfig = MetricTags.OpenTelemetryConfiguration.Unknown; + datadogConfig = MetricTags.DatadogConfiguration.Unknown; + } + } + } +} diff --git a/tracer/src/Datadog.Trace/Configuration/ConfigurationSources/Telemetry/OverrideErrorLog.cs b/tracer/src/Datadog.Trace/Configuration/ConfigurationSources/Telemetry/OverrideErrorLog.cs new file mode 100644 index 000000000000..6bbf24938123 --- /dev/null +++ b/tracer/src/Datadog.Trace/Configuration/ConfigurationSources/Telemetry/OverrideErrorLog.cs @@ -0,0 +1,137 @@ +// +// 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.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; +using System.Threading; +using Datadog.Trace.Logging; +using Datadog.Trace.Telemetry; + +namespace Datadog.Trace.Configuration.ConfigurationSources.Telemetry; + +/// +/// Records cases where configuration was overridden by startup telemetry, +/// so they can be written once the tracer has been fully initialized +/// +internal sealed class OverrideErrorLog : IConfigurationOverrideHandler +{ + private readonly object _lock = new(); + private List>? _actions; + + public static OverrideErrorLog Instance { get; } = new(); + + /// + /// Enqueue an action to be executed + /// + public void EnqueueAction(Action action) + { + lock (_lock) + { + _actions ??= new(); + _actions.Add(action); + } + } + + public void ProcessAndClearActions(IDatadogLogger log, IMetricsTelemetryCollector metrics) + { + List>? actions; + + lock (_lock) + { + actions = _actions; + _actions = null; + } + + if (actions is not null) + { + foreach (var logAction in actions) + { + logAction(log, metrics); + } + } + } + + public OverrideErrorLog Clone() + { + var clone = new OverrideErrorLog(); + lock (_lock) + { + clone._actions = _actions?.ToList(); + } + + return clone; + } + + public void LogDuplicateConfiguration(string datadogKey, string otelKey) + { + EnqueueAction( + (log, metrics) => + { + log.Warning( + "Both Datadog configuration {DatadogConfiguration} and OpenTelemetry configuration {OpenTelemetryConfiguration} are set. The Datadog configuration will be used.", + datadogKey, + otelKey); + OpenTelemetryHelpers.GetConfigurationMetricTags(otelKey, out var openTelemetryConfig, out var datadogConfig); + metrics.RecordCountOpenTelemetryConfigHiddenByDatadogConfig(datadogConfig, openTelemetryConfig); + }); + } + + public void LogInvalidConfiguration(string otelKey) + { + EnqueueAction( + (log, metrics) => + { + log.Warning("OpenTelemetry configuration {OpenTelemetryConfiguration} is invalid.", otelKey); + OpenTelemetryHelpers.GetConfigurationMetricTags(otelKey, out var openTelemetryConfig, out var datadogConfig); + metrics.RecordCountOpenTelemetryConfigInvalid(datadogConfig, openTelemetryConfig); + }); + } + + public void LogUnsupportedConfiguration(string otelKey, string otelValue, string replacementValue) + { + EnqueueAction( + (log, _) => + { + log.Warning( + "OpenTelemetry configuration {OpenTelemetryConfiguration}={OpenTelemetryValue} is not supported. {ModifiedValue} will be used instead.", + otelKey, + otelValue, + replacementValue); + }); + } + + bool IConfigurationOverrideHandler.TryHandleOverrides( + string datadogKey, + ConfigurationResult datadogConfigResult, + string otelKey, + ConfigurationResult otelConfigResult, + [NotNullWhen(true)] out T? value) + where T : default + { + if (datadogConfigResult.IsPresent && otelConfigResult.IsPresent) + { + LogDuplicateConfiguration(datadogKey, otelKey); + } + else if (otelConfigResult is { IsPresent: true } config) + { + if (config is { Result: { } openTelemetryValue, IsValid: true }) + { + { + value = openTelemetryValue; + return true; + } + } + + LogInvalidConfiguration(otelKey); + } + + value = default; + return false; + } +} diff --git a/tracer/src/Datadog.Trace/Configuration/GlobalSettings.cs b/tracer/src/Datadog.Trace/Configuration/GlobalSettings.cs index 068c2dd11e9e..7dd8345ae11c 100644 --- a/tracer/src/Datadog.Trace/Configuration/GlobalSettings.cs +++ b/tracer/src/Datadog.Trace/Configuration/GlobalSettings.cs @@ -27,7 +27,11 @@ public class GlobalSettings /// /// The to use when retrieving configuration values. /// Records the origin of telemetry values - internal GlobalSettings(IConfigurationSource source, IConfigurationTelemetry telemetry) + /// Records any errors + internal GlobalSettings( + IConfigurationSource source, + IConfigurationTelemetry telemetry, + IConfigurationOverrideHandler overrideHandler) { var builder = new ConfigurationBuilder(source, telemetry); @@ -41,7 +45,7 @@ internal GlobalSettings(IConfigurationSource source, IConfigurationTelemetry tel DebugEnabledInternal = builder .WithKeys(ConfigurationKeys.DebugEnabled) .AsBoolResult() - .OverrideWith(in otelConfig, false); + .OverrideWith(in otelConfig, overrideHandler, false); DiagnosticSourceEnabled = builder .WithKeys(ConfigurationKeys.DiagnosticSourceEnabled) @@ -132,6 +136,6 @@ public static GlobalSettings FromDefaultSources() } private static GlobalSettings CreateFromDefaultSources() - => new(GlobalConfigurationSource.Instance, TelemetryFactory.Config); + => new(GlobalConfigurationSource.Instance, TelemetryFactory.Config, OverrideErrorLog.Instance); } } diff --git a/tracer/src/Datadog.Trace/Configuration/ImmutableTracerSettings.cs b/tracer/src/Datadog.Trace/Configuration/ImmutableTracerSettings.cs index 6cb5ff9784ca..2562fb79fe21 100644 --- a/tracer/src/Datadog.Trace/Configuration/ImmutableTracerSettings.cs +++ b/tracer/src/Datadog.Trace/Configuration/ImmutableTracerSettings.cs @@ -13,6 +13,7 @@ using System.Text; using Datadog.Trace.Ci.Tags; using Datadog.Trace.ClrProfiler.ServerlessInstrumentation; +using Datadog.Trace.Configuration.ConfigurationSources.Telemetry; using Datadog.Trace.Configuration.Telemetry; using Datadog.Trace.ExtensionMethods; using Datadog.Trace.Logging.DirectSubmission; @@ -48,7 +49,7 @@ public partial record ImmutableTracerSettings /// The to use when retrieving configuration values. [PublicApi] public ImmutableTracerSettings(IConfigurationSource source) - : this(new TracerSettings(source, new ConfigurationTelemetry()), true) + : this(new TracerSettings(source, new ConfigurationTelemetry(), new OverrideErrorLog()), true) { TelemetryFactory.Metrics.Record(PublicApiUsage.ImmutableTracerSettings_Ctor_Source); } @@ -192,6 +193,8 @@ internal ImmutableTracerSettings(TracerSettings settings, bool unusedParamNotToU Telemetry = new ConfigurationTelemetry(); settings.CollectTelemetry(Telemetry); + ErrorLog = settings.ErrorLog.Clone(); + // Record the final disabled settings values in the telemetry, we can't quite get this information // through the IntegrationTelemetryCollector currently so record it here instead StringBuilder? sb = null; @@ -629,6 +632,11 @@ internal ImmutableTracerSettings(TracerSettings settings, bool unusedParamNotToU /// internal IConfigurationTelemetry Telemetry { get; } + /// + /// Gets the error logs that were collected from when this instance was built + /// + internal OverrideErrorLog ErrorLog { get; } + /// /// Gets a value indicating whether remote configuration is potentially available. /// RCM requires the "full" agent (not just the trace agent), so is not available in some scenarios diff --git a/tracer/src/Datadog.Trace/Configuration/TracerSettings.cs b/tracer/src/Datadog.Trace/Configuration/TracerSettings.cs index 4af450593526..811547f47c81 100644 --- a/tracer/src/Datadog.Trace/Configuration/TracerSettings.cs +++ b/tracer/src/Datadog.Trace/Configuration/TracerSettings.cs @@ -42,7 +42,7 @@ public partial class TracerSettings /// [PublicApi] public TracerSettings() - : this(null, new ConfigurationTelemetry()) + : this(null, new ConfigurationTelemetry(), new OverrideErrorLog()) { TelemetryFactory.Metrics.Record(PublicApiUsage.TracerSettings_Ctor); } @@ -56,7 +56,7 @@ public TracerSettings() /// the default sources such as environment variables etc. If false, uses the default values. [PublicApi] public TracerSettings(bool useDefaultSources) - : this(useDefaultSources ? GlobalConfigurationSource.Instance : null, new ConfigurationTelemetry()) + : this(useDefaultSources ? GlobalConfigurationSource.Instance : null, new ConfigurationTelemetry(), new OverrideErrorLog()) { TelemetryFactory.Metrics.Record(PublicApiUsage.TracerSettings_Ctor_UseDefaultSources); } @@ -73,16 +73,17 @@ public TracerSettings(bool useDefaultSources) /// [PublicApi] public TracerSettings(IConfigurationSource? source) - : this(source, new ConfigurationTelemetry()) + : this(source, new ConfigurationTelemetry(), new OverrideErrorLog()) { TelemetryFactory.Metrics.Record(PublicApiUsage.TracerSettings_Ctor_Source); } - internal TracerSettings(IConfigurationSource? source, IConfigurationTelemetry telemetry) + internal TracerSettings(IConfigurationSource? source, IConfigurationTelemetry telemetry, OverrideErrorLog errorLog) { var commaSeparator = new[] { ',' }; source ??= NullConfigurationSource.Instance; _telemetry = telemetry; + ErrorLog = errorLog; var config = new ConfigurationBuilder(source, _telemetry); GCPFunctionSettings = new ImmutableGCPFunctionSettings(source, _telemetry); @@ -124,7 +125,7 @@ _ when x.ToBoolean() is { } boolean => boolean, ServiceNameInternal = config .WithKeys(ConfigurationKeys.ServiceName, "DD_SERVICE_NAME") .AsStringResult() - .OverrideWith(in otelServiceName); + .OverrideWith(in otelServiceName, ErrorLog); ServiceVersionInternal = config .WithKeys(ConfigurationKeys.ServiceVersion) @@ -151,7 +152,7 @@ _ when x.ToBoolean() is { } boolean => boolean, TraceEnabledInternal = config .WithKeys(ConfigurationKeys.TraceEnabled) .AsBoolResult() - .OverrideWith(in otelTraceEnabled, defaultValue: true); + .OverrideWith(in otelTraceEnabled, ErrorLog, defaultValue: true); AppsecStandaloneEnabledInternal = config .WithKeys(ConfigurationKeys.AppsecStandaloneEnabled) @@ -194,6 +195,7 @@ _ when x.ToBoolean() is { } boolean => boolean, .AsDictionaryResult() .OverrideWith( RemapOtelTags(in otelTags), + ErrorLog, () => new DefaultResult>(new Dictionary(), string.Empty)) // Filter out tags with empty keys or empty values, and trim whitespace .Where(kvp => !string.IsNullOrWhiteSpace(kvp.Key) && !string.IsNullOrWhiteSpace(kvp.Value)) @@ -245,7 +247,7 @@ _ when x.ToBoolean() is { } boolean => boolean, RuntimeMetricsEnabled = config .WithKeys(ConfigurationKeys.RuntimeMetricsEnabled) .AsBoolResult() - .OverrideWith(in otelRuntimeMetricsEnabled, defaultValue: false); + .OverrideWith(in otelRuntimeMetricsEnabled, ErrorLog, defaultValue: false); // We should also be writing telemetry for OTEL_LOGS_EXPORTER similar to OTEL_METRICS_EXPORTER, but we don't have a corresponding Datadog config // When we do, we can insert that here @@ -281,7 +283,7 @@ _ when x.ToBoolean() is { } boolean => boolean, SpanSamplingRules = config.WithKeys(ConfigurationKeys.SpanSamplingRules).AsString(); - GlobalSamplingRateInternal = BuildSampleRate(in config); + GlobalSamplingRateInternal = BuildSampleRate(ErrorLog, in config); // We need to record a default value for configuration reporting // However, we need to keep GlobalSamplingRateInternal null because it changes the behavior of the tracer in subtle ways @@ -366,7 +368,7 @@ _ when x.ToBoolean() is { } boolean => boolean, IsActivityListenerEnabled = config .WithKeys(ConfigurationKeys.FeatureFlags.OpenTelemetryEnabled, "DD_TRACE_ACTIVITY_LISTENER_ENABLED") .AsBoolResult() - .OverrideWith(in otelActivityListenerEnabled, defaultValue: false); + .OverrideWith(in otelActivityListenerEnabled, ErrorLog, defaultValue: false); OpenTelemetryLegacyOperationNameEnabled = config .WithKeys(ConfigurationKeys.FeatureFlags.OpenTelemetryLegacyOperationNameEnabled) @@ -397,14 +399,14 @@ _ when x.ToBoolean() is { } boolean => boolean, .GetAsClassResult( validator: injectionValidator, // invalid individual values are rejected later converter: style => TrimSplitString(style, commaSeparator)) - .OverrideWith(in otelPropagation, getDefaultPropagationHeaders); + .OverrideWith(in otelPropagation, ErrorLog, getDefaultPropagationHeaders); PropagationStyleExtract = config .WithKeys(ConfigurationKeys.PropagationStyleExtract, "DD_PROPAGATION_STYLE_EXTRACT", ConfigurationKeys.PropagationStyle) .GetAsClassResult( validator: injectionValidator, // invalid individual values are rejected later converter: style => TrimSplitString(style, commaSeparator)) - .OverrideWith(in otelPropagation, getDefaultPropagationHeaders); + .OverrideWith(in otelPropagation, ErrorLog, getDefaultPropagationHeaders); PropagationExtractFirstOnly = config .WithKeys(ConfigurationKeys.PropagationExtractFirstOnly) @@ -506,6 +508,8 @@ _ when x.ToBoolean() is { } boolean => boolean, _initialSettings = new TracerSettingsSnapshot(this); } + internal OverrideErrorLog ErrorLog { get; } + #pragma warning disable SA1624 // Documentation summary should begin with "Gets" - the documentation is primarily for public property /// /// Gets or sets the default environment name applied to all spans. @@ -1061,7 +1065,7 @@ public static CompositeConfigurationSource CreateDefaultConfigurationSource() } internal static TracerSettings FromDefaultSourcesInternal() - => new(GlobalConfigurationSource.Instance, new ConfigurationTelemetry()); + => new(GlobalConfigurationSource.Instance, new ConfigurationTelemetry(), new()); /// /// Sets the HTTP status code that should be marked as errors for client integrations. @@ -1268,7 +1272,7 @@ void TrySetValue(int index) } internal static TracerSettings Create(Dictionary settings) - => new(new DictionaryConfigurationSource(settings.ToDictionary(x => x.Key, x => x.Value?.ToString()!)), new ConfigurationTelemetry()); + => new(new DictionaryConfigurationSource(settings.ToDictionary(x => x.Key, x => x.Value?.ToString()!)), new ConfigurationTelemetry(), new()); internal void CollectTelemetry(IConfigurationTelemetry destination) { @@ -1287,9 +1291,9 @@ internal void CollectTelemetry(IConfigurationTelemetry destination) } } - private static double? BuildSampleRate(in ConfigurationBuilder config) + private static double? BuildSampleRate(OverrideErrorLog log, in ConfigurationBuilder config) { - // The "overriding" is complex, so we can't use the usual `OverrideWith(in )` approach + // The "overriding" is complex, so we can't use the usual `OverrideWith()` approach var ddSampleRate = config.WithKeys(ConfigurationKeys.GlobalSamplingRate).AsDoubleResult(); var otelSampleType = config.WithKeys(ConfigurationKeys.OpenTelemetry.TracesSampler).AsStringResult(); var otelSampleRate = config.WithKeys(ConfigurationKeys.OpenTelemetry.TracesSamplerArg).AsDoubleResult(); @@ -1301,12 +1305,12 @@ internal void CollectTelemetry(IConfigurationTelemetry destination) { if (otelSampleType.ConfigurationResult.IsPresent) { - // TODO Log to user and report "otel.env.hiding" telemetry metric + log.LogDuplicateConfiguration(ddSampleRate.Key, otelSampleType.Key); } if (otelSampleRate.ConfigurationResult.IsPresent) { - // TODO Log to user and report "otel.env.hiding" telemetry metric + log.LogDuplicateConfiguration(ddSampleRate.Key, otelSampleRate.Key); } } else if (otelSampleType.ConfigurationResult is { IsValid: true, Result: { } samplerName }) @@ -1328,13 +1332,20 @@ internal void CollectTelemetry(IConfigurationTelemetry destination) if (supportedSamplerName is null) { - // TODO log warning that the OpenTelemetry value is invalid + log.EnqueueAction( + (log, _) => + { + log.Warning( + "OpenTelemetry configuration {OpenTelemetryConfiguration}={OpenTelemetryValue} is not supported. Using default configuration.", + otelSampleType.Key, + samplerName); + }); return ddResult; } if (!string.Equals(samplerName, supportedSamplerName, StringComparison.OrdinalIgnoreCase)) { - // TODO log warning that the configuration is not supported + log.LogUnsupportedConfiguration(otelSampleType.Key, samplerName, supportedSamplerName); } var openTelemetrySampleRateResult = supportedSamplerName switch @@ -1350,7 +1361,7 @@ internal void CollectTelemetry(IConfigurationTelemetry destination) return sampleRateResult; } - // TODO Log to user and report "otel.env.invalid" telemetry metric + log.LogInvalidConfiguration(otelSampleRate.Key); } return ddResult; diff --git a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_Count.g.cs b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_Count.g.cs index 53ed1a03a1da..b2db3e94ba24 100644 --- a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_Count.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_Count.g.cs @@ -88,6 +88,14 @@ public void RecordCountStatsApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags { } + public void RecordCountOpenTelemetryConfigHiddenByDatadogConfig(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1) + { + } + + public void RecordCountOpenTelemetryConfigInvalid(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1) + { + } + public void RecordCountTelemetryApiRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag, int increment = 1) { } diff --git a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CountExtensions.g.cs b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CountExtensions.g.cs index 3033e76c82ad..cacdde79f6d1 100644 --- a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CountExtensions.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CountExtensions.g.cs @@ -12,7 +12,7 @@ internal static partial class CountExtensions /// /// The number of separate metrics in the metric. /// - public const int Length = 39; + public const int Length = 41; /// /// Gets the metric name for the provided metric @@ -41,6 +41,8 @@ public static string GetName(this Datadog.Trace.Telemetry.Metrics.Count metric) Datadog.Trace.Telemetry.Metrics.Count.StatsApiRequests => "stats_api.requests", Datadog.Trace.Telemetry.Metrics.Count.StatsApiResponses => "stats_api.responses", Datadog.Trace.Telemetry.Metrics.Count.StatsApiErrors => "stats_api.errors", + Datadog.Trace.Telemetry.Metrics.Count.OpenTelemetryConfigHiddenByDatadogConfig => "otel.env.hiding", + Datadog.Trace.Telemetry.Metrics.Count.OpenTelemetryConfigInvalid => "otel.env.invalid", Datadog.Trace.Telemetry.Metrics.Count.TelemetryApiRequests => "telemetry_api.requests", Datadog.Trace.Telemetry.Metrics.Count.TelemetryApiResponses => "telemetry_api.responses", Datadog.Trace.Telemetry.Metrics.Count.TelemetryApiErrors => "telemetry_api.errors", @@ -90,6 +92,8 @@ public static bool IsCommon(this Datadog.Trace.Telemetry.Metrics.Count metric) => metric switch { Datadog.Trace.Telemetry.Metrics.Count.LogCreated => "general", + Datadog.Trace.Telemetry.Metrics.Count.OpenTelemetryConfigHiddenByDatadogConfig => "tracers", + Datadog.Trace.Telemetry.Metrics.Count.OpenTelemetryConfigInvalid => "tracers", Datadog.Trace.Telemetry.Metrics.Count.TelemetryApiRequests => "telemetry", Datadog.Trace.Telemetry.Metrics.Count.TelemetryApiResponses => "telemetry", Datadog.Trace.Telemetry.Metrics.Count.TelemetryApiErrors => "telemetry", diff --git a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/IMetricsTelemetryCollector_Count.g.cs b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/IMetricsTelemetryCollector_Count.g.cs index d0de298967da..a1689840e744 100644 --- a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/IMetricsTelemetryCollector_Count.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/IMetricsTelemetryCollector_Count.g.cs @@ -47,6 +47,10 @@ internal partial interface IMetricsTelemetryCollector public void RecordCountStatsApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1); + public void RecordCountOpenTelemetryConfigHiddenByDatadogConfig(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1); + + public void RecordCountOpenTelemetryConfigInvalid(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1); + public void RecordCountTelemetryApiRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag, int increment = 1); public void RecordCountTelemetryApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode 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 0827b43b4535..25fbcb4fcaca 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 partial class MetricsTelemetryCollector { - private const int CountLength = 374; + private const int CountLength = 554; /// /// Creates the buffer for the values. @@ -197,10 +197,192 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // telemetry_api.requests, index = 159 + // otel.env.hiding, index = 159 + 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" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_traces_exporter" }), + 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 = 249 + 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" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_traces_exporter" }), + 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" }), + // telemetry_api.requests, index = 339 new(new[] { "endpoint:agent" }), new(new[] { "endpoint:agentless" }), - // telemetry_api.responses, index = 161 + // telemetry_api.responses, index = 341 new(new[] { "endpoint:agent", "status_code:200" }), new(new[] { "endpoint:agent", "status_code:201" }), new(new[] { "endpoint:agent", "status_code:202" }), @@ -245,18 +427,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 = 205 + // telemetry_api.errors, index = 385 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 = 211 + // version_conflict_tracers_created, index = 391 new(null), - // unsupported_custom_instrumentation_services, index = 212 + // unsupported_custom_instrumentation_services, index = 392 new(null), - // direct_log_logs, index = 213 + // direct_log_logs, index = 393 new(new[] { "integration_name:datadog" }), new(new[] { "integration_name:opentracing" }), new(new[] { "integration_name:ciapp" }), @@ -332,9 +514,9 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "integration_name:directorylistingleak" }), new(new[] { "integration_name:sessiontimeout" }), new(new[] { "integration_name:datadogtracemanual" }), - // direct_log_api.requests, index = 288 + // direct_log_api.requests, index = 468 new(null), - // direct_log_api.responses, index = 289 + // direct_log_api.responses, index = 469 new(new[] { "status_code:200" }), new(new[] { "status_code:201" }), new(new[] { "status_code:202" }), @@ -357,37 +539,37 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "status_code:503" }), new(new[] { "status_code:504" }), new(new[] { "status_code:5xx" }), - // direct_log_api.errors, index = 311 + // direct_log_api.errors, index = 491 new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // waf.init, index = 314 + // waf.init, index = 494 new(null), - // waf.updates, index = 315 + // waf.updates, index = 495 new(null), - // waf.requests, index = 316 + // waf.requests, index = 496 new(new[] { "waf_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:false", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:true", "request_blocked:false", "waf_timeout:false", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:true", "request_blocked:true", "waf_timeout:false", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:true", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:false", "request_excluded:true" }), - // waf.input_truncated, index = 321 + // waf.input_truncated, index = 501 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 = 324 + // rasp.rule.eval, index = 504 new(new[] { "waf_version", "rule_type:lfi" }), new(new[] { "waf_version", "rule_type:ssrf" }), new(new[] { "waf_version", "rule_type:sql_injection" }), - // rasp.rule.match, index = 327 + // rasp.rule.match, index = 507 new(new[] { "waf_version", "rule_type:lfi" }), new(new[] { "waf_version", "rule_type:ssrf" }), new(new[] { "waf_version", "rule_type:sql_injection" }), - // rasp.timeout, index = 330 + // rasp.timeout, index = 510 new(new[] { "waf_version", "rule_type:lfi" }), new(new[] { "waf_version", "rule_type:ssrf" }), new(new[] { "waf_version", "rule_type:sql_injection" }), - // executed.source, index = 333 + // executed.source, index = 513 new(new[] { "source_type:http.request.body" }), new(new[] { "source_type:http.request.path" }), new(new[] { "source_type:http.request.parameter.name" }), @@ -401,9 +583,9 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "source_type:http.request.matrix.parameter" }), new(new[] { "source_type:http.request.uri" }), new(new[] { "source_type:grpc.request.body" }), - // executed.propagation, index = 346 + // executed.propagation, index = 526 new(null), - // executed.sink, index = 347 + // executed.sink, index = 527 new(new[] { "vulnerability_type:none" }), new(new[] { "vulnerability_type:weak_cipher" }), new(new[] { "vulnerability_type:weak_hash" }), @@ -430,7 +612,7 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "vulnerability_type:xss" }), new(new[] { "vulnerability_type:directory_listing_leak" }), new(new[] { "vulnerability_type:session_timeout" }), - // request.tainted, index = 373 + // request.tainted, index = 553 new(null), }; @@ -440,7 +622,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, 75, 1, 3, 4, 2, 2, 4, 1, 1, 1, 22, 3, 2, 4, 4, 1, 22, 3, 2, 44, 6, 1, 1, 75, 1, 22, 3, 1, 1, 5, 3, 3, 3, 3, 13, 1, 26, 1, }; + = new int[]{ 4, 75, 1, 3, 4, 2, 2, 4, 1, 1, 1, 22, 3, 2, 4, 4, 1, 22, 3, 90, 90, 2, 44, 6, 1, 1, 75, 1, 22, 3, 1, 1, 5, 3, 3, 3, 3, 13, 1, 26, 1, }; public void RecordCountLogCreated(Datadog.Trace.Telemetry.Metrics.MetricTags.LogLevel tag, int increment = 1) { @@ -551,116 +733,128 @@ public void RecordCountStatsApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags 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 = 159 + ((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 = 249 + ((int)tag1 * 10) + (int)tag2; + Interlocked.Add(ref _buffer.Count[index], increment); + } + public void RecordCountTelemetryApiRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag, int increment = 1) { - var index = 159 + (int)tag; + var index = 339 + (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 = 161 + ((int)tag1 * 22) + (int)tag2; + var index = 341 + ((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 = 205 + ((int)tag1 * 3) + (int)tag2; + var index = 385 + ((int)tag1 * 3) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountVersionConflictTracerCreated(int increment = 1) { - Interlocked.Add(ref _buffer.Count[211], increment); + Interlocked.Add(ref _buffer.Count[391], increment); } public void RecordCountUnsupportedCustomInstrumentationServices(int increment = 1) { - Interlocked.Add(ref _buffer.Count[212], increment); + Interlocked.Add(ref _buffer.Count[392], increment); } public void RecordCountDirectLogLogs(Datadog.Trace.Telemetry.Metrics.MetricTags.IntegrationName tag, int increment = 1) { - var index = 213 + (int)tag; + var index = 393 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountDirectLogApiRequests(int increment = 1) { - Interlocked.Add(ref _buffer.Count[288], increment); + Interlocked.Add(ref _buffer.Count[468], increment); } public void RecordCountDirectLogApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag, int increment = 1) { - var index = 289 + (int)tag; + var index = 469 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountDirectLogApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1) { - var index = 311 + (int)tag; + var index = 491 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountWafInit(int increment = 1) { - Interlocked.Add(ref _buffer.Count[314], increment); + Interlocked.Add(ref _buffer.Count[494], increment); } public void RecordCountWafUpdates(int increment = 1) { - Interlocked.Add(ref _buffer.Count[315], increment); + Interlocked.Add(ref _buffer.Count[495], increment); } public void RecordCountWafRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.WafAnalysis tag, int increment = 1) { - var index = 316 + (int)tag; + var index = 496 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountInputTruncated(Datadog.Trace.Telemetry.Metrics.MetricTags.TruncationReason tag, int increment = 1) { - var index = 321 + (int)tag; + var index = 501 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountRaspRuleEval(Datadog.Trace.Telemetry.Metrics.MetricTags.RaspRuleType tag, int increment = 1) { - var index = 324 + (int)tag; + var index = 504 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountRaspRuleMatch(Datadog.Trace.Telemetry.Metrics.MetricTags.RaspRuleType tag, int increment = 1) { - var index = 327 + (int)tag; + var index = 507 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountRaspTimeout(Datadog.Trace.Telemetry.Metrics.MetricTags.RaspRuleType tag, int increment = 1) { - var index = 330 + (int)tag; + var index = 510 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastExecutedSources(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSources tag, int increment = 1) { - var index = 333 + (int)tag; + var index = 513 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastExecutedPropagations(int increment = 1) { - Interlocked.Add(ref _buffer.Count[346], increment); + Interlocked.Add(ref _buffer.Count[526], increment); } public void RecordCountIastExecutedSinks(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks tag, int increment = 1) { - var index = 347 + (int)tag; + var index = 527 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastRequestTainted(int increment = 1) { - Interlocked.Add(ref _buffer.Count[373], increment); + Interlocked.Add(ref _buffer.Count[553], increment); } } \ No newline at end of file diff --git a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/NullMetricsTelemetryCollector_Count.g.cs b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/NullMetricsTelemetryCollector_Count.g.cs index a15b00704107..02e22f3735de 100644 --- a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/NullMetricsTelemetryCollector_Count.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/NullMetricsTelemetryCollector_Count.g.cs @@ -88,6 +88,14 @@ public void RecordCountStatsApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags { } + public void RecordCountOpenTelemetryConfigHiddenByDatadogConfig(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1) + { + } + + public void RecordCountOpenTelemetryConfigInvalid(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1) + { + } + public void RecordCountTelemetryApiRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag, int increment = 1) { } diff --git a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_Count.g.cs b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_Count.g.cs index 53ed1a03a1da..b2db3e94ba24 100644 --- a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_Count.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_Count.g.cs @@ -88,6 +88,14 @@ public void RecordCountStatsApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags { } + public void RecordCountOpenTelemetryConfigHiddenByDatadogConfig(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1) + { + } + + public void RecordCountOpenTelemetryConfigInvalid(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1) + { + } + public void RecordCountTelemetryApiRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag, int increment = 1) { } diff --git a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CountExtensions.g.cs b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CountExtensions.g.cs index 3033e76c82ad..cacdde79f6d1 100644 --- a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CountExtensions.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CountExtensions.g.cs @@ -12,7 +12,7 @@ internal static partial class CountExtensions /// /// The number of separate metrics in the metric. /// - public const int Length = 39; + public const int Length = 41; /// /// Gets the metric name for the provided metric @@ -41,6 +41,8 @@ public static string GetName(this Datadog.Trace.Telemetry.Metrics.Count metric) Datadog.Trace.Telemetry.Metrics.Count.StatsApiRequests => "stats_api.requests", Datadog.Trace.Telemetry.Metrics.Count.StatsApiResponses => "stats_api.responses", Datadog.Trace.Telemetry.Metrics.Count.StatsApiErrors => "stats_api.errors", + Datadog.Trace.Telemetry.Metrics.Count.OpenTelemetryConfigHiddenByDatadogConfig => "otel.env.hiding", + Datadog.Trace.Telemetry.Metrics.Count.OpenTelemetryConfigInvalid => "otel.env.invalid", Datadog.Trace.Telemetry.Metrics.Count.TelemetryApiRequests => "telemetry_api.requests", Datadog.Trace.Telemetry.Metrics.Count.TelemetryApiResponses => "telemetry_api.responses", Datadog.Trace.Telemetry.Metrics.Count.TelemetryApiErrors => "telemetry_api.errors", @@ -90,6 +92,8 @@ public static bool IsCommon(this Datadog.Trace.Telemetry.Metrics.Count metric) => metric switch { Datadog.Trace.Telemetry.Metrics.Count.LogCreated => "general", + Datadog.Trace.Telemetry.Metrics.Count.OpenTelemetryConfigHiddenByDatadogConfig => "tracers", + Datadog.Trace.Telemetry.Metrics.Count.OpenTelemetryConfigInvalid => "tracers", Datadog.Trace.Telemetry.Metrics.Count.TelemetryApiRequests => "telemetry", Datadog.Trace.Telemetry.Metrics.Count.TelemetryApiResponses => "telemetry", Datadog.Trace.Telemetry.Metrics.Count.TelemetryApiErrors => "telemetry", diff --git a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/IMetricsTelemetryCollector_Count.g.cs b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/IMetricsTelemetryCollector_Count.g.cs index d0de298967da..a1689840e744 100644 --- a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/IMetricsTelemetryCollector_Count.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/IMetricsTelemetryCollector_Count.g.cs @@ -47,6 +47,10 @@ internal partial interface IMetricsTelemetryCollector public void RecordCountStatsApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1); + public void RecordCountOpenTelemetryConfigHiddenByDatadogConfig(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1); + + public void RecordCountOpenTelemetryConfigInvalid(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1); + public void RecordCountTelemetryApiRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag, int increment = 1); public void RecordCountTelemetryApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode 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 0827b43b4535..25fbcb4fcaca 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 partial class MetricsTelemetryCollector { - private const int CountLength = 374; + private const int CountLength = 554; /// /// Creates the buffer for the values. @@ -197,10 +197,192 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // telemetry_api.requests, index = 159 + // otel.env.hiding, index = 159 + 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" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_traces_exporter" }), + 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 = 249 + 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" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_traces_exporter" }), + 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" }), + // telemetry_api.requests, index = 339 new(new[] { "endpoint:agent" }), new(new[] { "endpoint:agentless" }), - // telemetry_api.responses, index = 161 + // telemetry_api.responses, index = 341 new(new[] { "endpoint:agent", "status_code:200" }), new(new[] { "endpoint:agent", "status_code:201" }), new(new[] { "endpoint:agent", "status_code:202" }), @@ -245,18 +427,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 = 205 + // telemetry_api.errors, index = 385 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 = 211 + // version_conflict_tracers_created, index = 391 new(null), - // unsupported_custom_instrumentation_services, index = 212 + // unsupported_custom_instrumentation_services, index = 392 new(null), - // direct_log_logs, index = 213 + // direct_log_logs, index = 393 new(new[] { "integration_name:datadog" }), new(new[] { "integration_name:opentracing" }), new(new[] { "integration_name:ciapp" }), @@ -332,9 +514,9 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "integration_name:directorylistingleak" }), new(new[] { "integration_name:sessiontimeout" }), new(new[] { "integration_name:datadogtracemanual" }), - // direct_log_api.requests, index = 288 + // direct_log_api.requests, index = 468 new(null), - // direct_log_api.responses, index = 289 + // direct_log_api.responses, index = 469 new(new[] { "status_code:200" }), new(new[] { "status_code:201" }), new(new[] { "status_code:202" }), @@ -357,37 +539,37 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "status_code:503" }), new(new[] { "status_code:504" }), new(new[] { "status_code:5xx" }), - // direct_log_api.errors, index = 311 + // direct_log_api.errors, index = 491 new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // waf.init, index = 314 + // waf.init, index = 494 new(null), - // waf.updates, index = 315 + // waf.updates, index = 495 new(null), - // waf.requests, index = 316 + // waf.requests, index = 496 new(new[] { "waf_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:false", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:true", "request_blocked:false", "waf_timeout:false", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:true", "request_blocked:true", "waf_timeout:false", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:true", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:false", "request_excluded:true" }), - // waf.input_truncated, index = 321 + // waf.input_truncated, index = 501 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 = 324 + // rasp.rule.eval, index = 504 new(new[] { "waf_version", "rule_type:lfi" }), new(new[] { "waf_version", "rule_type:ssrf" }), new(new[] { "waf_version", "rule_type:sql_injection" }), - // rasp.rule.match, index = 327 + // rasp.rule.match, index = 507 new(new[] { "waf_version", "rule_type:lfi" }), new(new[] { "waf_version", "rule_type:ssrf" }), new(new[] { "waf_version", "rule_type:sql_injection" }), - // rasp.timeout, index = 330 + // rasp.timeout, index = 510 new(new[] { "waf_version", "rule_type:lfi" }), new(new[] { "waf_version", "rule_type:ssrf" }), new(new[] { "waf_version", "rule_type:sql_injection" }), - // executed.source, index = 333 + // executed.source, index = 513 new(new[] { "source_type:http.request.body" }), new(new[] { "source_type:http.request.path" }), new(new[] { "source_type:http.request.parameter.name" }), @@ -401,9 +583,9 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "source_type:http.request.matrix.parameter" }), new(new[] { "source_type:http.request.uri" }), new(new[] { "source_type:grpc.request.body" }), - // executed.propagation, index = 346 + // executed.propagation, index = 526 new(null), - // executed.sink, index = 347 + // executed.sink, index = 527 new(new[] { "vulnerability_type:none" }), new(new[] { "vulnerability_type:weak_cipher" }), new(new[] { "vulnerability_type:weak_hash" }), @@ -430,7 +612,7 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "vulnerability_type:xss" }), new(new[] { "vulnerability_type:directory_listing_leak" }), new(new[] { "vulnerability_type:session_timeout" }), - // request.tainted, index = 373 + // request.tainted, index = 553 new(null), }; @@ -440,7 +622,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, 75, 1, 3, 4, 2, 2, 4, 1, 1, 1, 22, 3, 2, 4, 4, 1, 22, 3, 2, 44, 6, 1, 1, 75, 1, 22, 3, 1, 1, 5, 3, 3, 3, 3, 13, 1, 26, 1, }; + = new int[]{ 4, 75, 1, 3, 4, 2, 2, 4, 1, 1, 1, 22, 3, 2, 4, 4, 1, 22, 3, 90, 90, 2, 44, 6, 1, 1, 75, 1, 22, 3, 1, 1, 5, 3, 3, 3, 3, 13, 1, 26, 1, }; public void RecordCountLogCreated(Datadog.Trace.Telemetry.Metrics.MetricTags.LogLevel tag, int increment = 1) { @@ -551,116 +733,128 @@ public void RecordCountStatsApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags 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 = 159 + ((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 = 249 + ((int)tag1 * 10) + (int)tag2; + Interlocked.Add(ref _buffer.Count[index], increment); + } + public void RecordCountTelemetryApiRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag, int increment = 1) { - var index = 159 + (int)tag; + var index = 339 + (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 = 161 + ((int)tag1 * 22) + (int)tag2; + var index = 341 + ((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 = 205 + ((int)tag1 * 3) + (int)tag2; + var index = 385 + ((int)tag1 * 3) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountVersionConflictTracerCreated(int increment = 1) { - Interlocked.Add(ref _buffer.Count[211], increment); + Interlocked.Add(ref _buffer.Count[391], increment); } public void RecordCountUnsupportedCustomInstrumentationServices(int increment = 1) { - Interlocked.Add(ref _buffer.Count[212], increment); + Interlocked.Add(ref _buffer.Count[392], increment); } public void RecordCountDirectLogLogs(Datadog.Trace.Telemetry.Metrics.MetricTags.IntegrationName tag, int increment = 1) { - var index = 213 + (int)tag; + var index = 393 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountDirectLogApiRequests(int increment = 1) { - Interlocked.Add(ref _buffer.Count[288], increment); + Interlocked.Add(ref _buffer.Count[468], increment); } public void RecordCountDirectLogApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag, int increment = 1) { - var index = 289 + (int)tag; + var index = 469 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountDirectLogApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1) { - var index = 311 + (int)tag; + var index = 491 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountWafInit(int increment = 1) { - Interlocked.Add(ref _buffer.Count[314], increment); + Interlocked.Add(ref _buffer.Count[494], increment); } public void RecordCountWafUpdates(int increment = 1) { - Interlocked.Add(ref _buffer.Count[315], increment); + Interlocked.Add(ref _buffer.Count[495], increment); } public void RecordCountWafRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.WafAnalysis tag, int increment = 1) { - var index = 316 + (int)tag; + var index = 496 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountInputTruncated(Datadog.Trace.Telemetry.Metrics.MetricTags.TruncationReason tag, int increment = 1) { - var index = 321 + (int)tag; + var index = 501 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountRaspRuleEval(Datadog.Trace.Telemetry.Metrics.MetricTags.RaspRuleType tag, int increment = 1) { - var index = 324 + (int)tag; + var index = 504 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountRaspRuleMatch(Datadog.Trace.Telemetry.Metrics.MetricTags.RaspRuleType tag, int increment = 1) { - var index = 327 + (int)tag; + var index = 507 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountRaspTimeout(Datadog.Trace.Telemetry.Metrics.MetricTags.RaspRuleType tag, int increment = 1) { - var index = 330 + (int)tag; + var index = 510 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastExecutedSources(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSources tag, int increment = 1) { - var index = 333 + (int)tag; + var index = 513 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastExecutedPropagations(int increment = 1) { - Interlocked.Add(ref _buffer.Count[346], increment); + Interlocked.Add(ref _buffer.Count[526], increment); } public void RecordCountIastExecutedSinks(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks tag, int increment = 1) { - var index = 347 + (int)tag; + var index = 527 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastRequestTainted(int increment = 1) { - Interlocked.Add(ref _buffer.Count[373], increment); + Interlocked.Add(ref _buffer.Count[553], increment); } } \ No newline at end of file diff --git a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/NullMetricsTelemetryCollector_Count.g.cs b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/NullMetricsTelemetryCollector_Count.g.cs index a15b00704107..02e22f3735de 100644 --- a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/NullMetricsTelemetryCollector_Count.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/NullMetricsTelemetryCollector_Count.g.cs @@ -88,6 +88,14 @@ public void RecordCountStatsApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags { } + public void RecordCountOpenTelemetryConfigHiddenByDatadogConfig(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1) + { + } + + public void RecordCountOpenTelemetryConfigInvalid(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1) + { + } + public void RecordCountTelemetryApiRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag, int increment = 1) { } diff --git a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_Count.g.cs b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_Count.g.cs index 53ed1a03a1da..b2db3e94ba24 100644 --- a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_Count.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_Count.g.cs @@ -88,6 +88,14 @@ public void RecordCountStatsApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags { } + public void RecordCountOpenTelemetryConfigHiddenByDatadogConfig(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1) + { + } + + public void RecordCountOpenTelemetryConfigInvalid(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1) + { + } + public void RecordCountTelemetryApiRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag, int increment = 1) { } diff --git a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CountExtensions.g.cs b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CountExtensions.g.cs index 3033e76c82ad..cacdde79f6d1 100644 --- a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CountExtensions.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CountExtensions.g.cs @@ -12,7 +12,7 @@ internal static partial class CountExtensions /// /// The number of separate metrics in the metric. /// - public const int Length = 39; + public const int Length = 41; /// /// Gets the metric name for the provided metric @@ -41,6 +41,8 @@ public static string GetName(this Datadog.Trace.Telemetry.Metrics.Count metric) Datadog.Trace.Telemetry.Metrics.Count.StatsApiRequests => "stats_api.requests", Datadog.Trace.Telemetry.Metrics.Count.StatsApiResponses => "stats_api.responses", Datadog.Trace.Telemetry.Metrics.Count.StatsApiErrors => "stats_api.errors", + Datadog.Trace.Telemetry.Metrics.Count.OpenTelemetryConfigHiddenByDatadogConfig => "otel.env.hiding", + Datadog.Trace.Telemetry.Metrics.Count.OpenTelemetryConfigInvalid => "otel.env.invalid", Datadog.Trace.Telemetry.Metrics.Count.TelemetryApiRequests => "telemetry_api.requests", Datadog.Trace.Telemetry.Metrics.Count.TelemetryApiResponses => "telemetry_api.responses", Datadog.Trace.Telemetry.Metrics.Count.TelemetryApiErrors => "telemetry_api.errors", @@ -90,6 +92,8 @@ public static bool IsCommon(this Datadog.Trace.Telemetry.Metrics.Count metric) => metric switch { Datadog.Trace.Telemetry.Metrics.Count.LogCreated => "general", + Datadog.Trace.Telemetry.Metrics.Count.OpenTelemetryConfigHiddenByDatadogConfig => "tracers", + Datadog.Trace.Telemetry.Metrics.Count.OpenTelemetryConfigInvalid => "tracers", Datadog.Trace.Telemetry.Metrics.Count.TelemetryApiRequests => "telemetry", Datadog.Trace.Telemetry.Metrics.Count.TelemetryApiResponses => "telemetry", Datadog.Trace.Telemetry.Metrics.Count.TelemetryApiErrors => "telemetry", diff --git a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/IMetricsTelemetryCollector_Count.g.cs b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/IMetricsTelemetryCollector_Count.g.cs index d0de298967da..a1689840e744 100644 --- a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/IMetricsTelemetryCollector_Count.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/IMetricsTelemetryCollector_Count.g.cs @@ -47,6 +47,10 @@ internal partial interface IMetricsTelemetryCollector public void RecordCountStatsApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1); + public void RecordCountOpenTelemetryConfigHiddenByDatadogConfig(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1); + + public void RecordCountOpenTelemetryConfigInvalid(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1); + public void RecordCountTelemetryApiRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag, int increment = 1); public void RecordCountTelemetryApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode 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 0827b43b4535..25fbcb4fcaca 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 partial class MetricsTelemetryCollector { - private const int CountLength = 374; + private const int CountLength = 554; /// /// Creates the buffer for the values. @@ -197,10 +197,192 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // telemetry_api.requests, index = 159 + // otel.env.hiding, index = 159 + 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" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_traces_exporter" }), + 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 = 249 + 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" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_traces_exporter" }), + 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" }), + // telemetry_api.requests, index = 339 new(new[] { "endpoint:agent" }), new(new[] { "endpoint:agentless" }), - // telemetry_api.responses, index = 161 + // telemetry_api.responses, index = 341 new(new[] { "endpoint:agent", "status_code:200" }), new(new[] { "endpoint:agent", "status_code:201" }), new(new[] { "endpoint:agent", "status_code:202" }), @@ -245,18 +427,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 = 205 + // telemetry_api.errors, index = 385 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 = 211 + // version_conflict_tracers_created, index = 391 new(null), - // unsupported_custom_instrumentation_services, index = 212 + // unsupported_custom_instrumentation_services, index = 392 new(null), - // direct_log_logs, index = 213 + // direct_log_logs, index = 393 new(new[] { "integration_name:datadog" }), new(new[] { "integration_name:opentracing" }), new(new[] { "integration_name:ciapp" }), @@ -332,9 +514,9 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "integration_name:directorylistingleak" }), new(new[] { "integration_name:sessiontimeout" }), new(new[] { "integration_name:datadogtracemanual" }), - // direct_log_api.requests, index = 288 + // direct_log_api.requests, index = 468 new(null), - // direct_log_api.responses, index = 289 + // direct_log_api.responses, index = 469 new(new[] { "status_code:200" }), new(new[] { "status_code:201" }), new(new[] { "status_code:202" }), @@ -357,37 +539,37 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "status_code:503" }), new(new[] { "status_code:504" }), new(new[] { "status_code:5xx" }), - // direct_log_api.errors, index = 311 + // direct_log_api.errors, index = 491 new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // waf.init, index = 314 + // waf.init, index = 494 new(null), - // waf.updates, index = 315 + // waf.updates, index = 495 new(null), - // waf.requests, index = 316 + // waf.requests, index = 496 new(new[] { "waf_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:false", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:true", "request_blocked:false", "waf_timeout:false", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:true", "request_blocked:true", "waf_timeout:false", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:true", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:false", "request_excluded:true" }), - // waf.input_truncated, index = 321 + // waf.input_truncated, index = 501 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 = 324 + // rasp.rule.eval, index = 504 new(new[] { "waf_version", "rule_type:lfi" }), new(new[] { "waf_version", "rule_type:ssrf" }), new(new[] { "waf_version", "rule_type:sql_injection" }), - // rasp.rule.match, index = 327 + // rasp.rule.match, index = 507 new(new[] { "waf_version", "rule_type:lfi" }), new(new[] { "waf_version", "rule_type:ssrf" }), new(new[] { "waf_version", "rule_type:sql_injection" }), - // rasp.timeout, index = 330 + // rasp.timeout, index = 510 new(new[] { "waf_version", "rule_type:lfi" }), new(new[] { "waf_version", "rule_type:ssrf" }), new(new[] { "waf_version", "rule_type:sql_injection" }), - // executed.source, index = 333 + // executed.source, index = 513 new(new[] { "source_type:http.request.body" }), new(new[] { "source_type:http.request.path" }), new(new[] { "source_type:http.request.parameter.name" }), @@ -401,9 +583,9 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "source_type:http.request.matrix.parameter" }), new(new[] { "source_type:http.request.uri" }), new(new[] { "source_type:grpc.request.body" }), - // executed.propagation, index = 346 + // executed.propagation, index = 526 new(null), - // executed.sink, index = 347 + // executed.sink, index = 527 new(new[] { "vulnerability_type:none" }), new(new[] { "vulnerability_type:weak_cipher" }), new(new[] { "vulnerability_type:weak_hash" }), @@ -430,7 +612,7 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "vulnerability_type:xss" }), new(new[] { "vulnerability_type:directory_listing_leak" }), new(new[] { "vulnerability_type:session_timeout" }), - // request.tainted, index = 373 + // request.tainted, index = 553 new(null), }; @@ -440,7 +622,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, 75, 1, 3, 4, 2, 2, 4, 1, 1, 1, 22, 3, 2, 4, 4, 1, 22, 3, 2, 44, 6, 1, 1, 75, 1, 22, 3, 1, 1, 5, 3, 3, 3, 3, 13, 1, 26, 1, }; + = new int[]{ 4, 75, 1, 3, 4, 2, 2, 4, 1, 1, 1, 22, 3, 2, 4, 4, 1, 22, 3, 90, 90, 2, 44, 6, 1, 1, 75, 1, 22, 3, 1, 1, 5, 3, 3, 3, 3, 13, 1, 26, 1, }; public void RecordCountLogCreated(Datadog.Trace.Telemetry.Metrics.MetricTags.LogLevel tag, int increment = 1) { @@ -551,116 +733,128 @@ public void RecordCountStatsApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags 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 = 159 + ((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 = 249 + ((int)tag1 * 10) + (int)tag2; + Interlocked.Add(ref _buffer.Count[index], increment); + } + public void RecordCountTelemetryApiRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag, int increment = 1) { - var index = 159 + (int)tag; + var index = 339 + (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 = 161 + ((int)tag1 * 22) + (int)tag2; + var index = 341 + ((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 = 205 + ((int)tag1 * 3) + (int)tag2; + var index = 385 + ((int)tag1 * 3) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountVersionConflictTracerCreated(int increment = 1) { - Interlocked.Add(ref _buffer.Count[211], increment); + Interlocked.Add(ref _buffer.Count[391], increment); } public void RecordCountUnsupportedCustomInstrumentationServices(int increment = 1) { - Interlocked.Add(ref _buffer.Count[212], increment); + Interlocked.Add(ref _buffer.Count[392], increment); } public void RecordCountDirectLogLogs(Datadog.Trace.Telemetry.Metrics.MetricTags.IntegrationName tag, int increment = 1) { - var index = 213 + (int)tag; + var index = 393 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountDirectLogApiRequests(int increment = 1) { - Interlocked.Add(ref _buffer.Count[288], increment); + Interlocked.Add(ref _buffer.Count[468], increment); } public void RecordCountDirectLogApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag, int increment = 1) { - var index = 289 + (int)tag; + var index = 469 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountDirectLogApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1) { - var index = 311 + (int)tag; + var index = 491 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountWafInit(int increment = 1) { - Interlocked.Add(ref _buffer.Count[314], increment); + Interlocked.Add(ref _buffer.Count[494], increment); } public void RecordCountWafUpdates(int increment = 1) { - Interlocked.Add(ref _buffer.Count[315], increment); + Interlocked.Add(ref _buffer.Count[495], increment); } public void RecordCountWafRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.WafAnalysis tag, int increment = 1) { - var index = 316 + (int)tag; + var index = 496 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountInputTruncated(Datadog.Trace.Telemetry.Metrics.MetricTags.TruncationReason tag, int increment = 1) { - var index = 321 + (int)tag; + var index = 501 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountRaspRuleEval(Datadog.Trace.Telemetry.Metrics.MetricTags.RaspRuleType tag, int increment = 1) { - var index = 324 + (int)tag; + var index = 504 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountRaspRuleMatch(Datadog.Trace.Telemetry.Metrics.MetricTags.RaspRuleType tag, int increment = 1) { - var index = 327 + (int)tag; + var index = 507 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountRaspTimeout(Datadog.Trace.Telemetry.Metrics.MetricTags.RaspRuleType tag, int increment = 1) { - var index = 330 + (int)tag; + var index = 510 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastExecutedSources(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSources tag, int increment = 1) { - var index = 333 + (int)tag; + var index = 513 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastExecutedPropagations(int increment = 1) { - Interlocked.Add(ref _buffer.Count[346], increment); + Interlocked.Add(ref _buffer.Count[526], increment); } public void RecordCountIastExecutedSinks(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks tag, int increment = 1) { - var index = 347 + (int)tag; + var index = 527 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastRequestTainted(int increment = 1) { - Interlocked.Add(ref _buffer.Count[373], increment); + Interlocked.Add(ref _buffer.Count[553], increment); } } \ No newline at end of file diff --git a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/NullMetricsTelemetryCollector_Count.g.cs b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/NullMetricsTelemetryCollector_Count.g.cs index a15b00704107..02e22f3735de 100644 --- a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/NullMetricsTelemetryCollector_Count.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/NullMetricsTelemetryCollector_Count.g.cs @@ -88,6 +88,14 @@ public void RecordCountStatsApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags { } + public void RecordCountOpenTelemetryConfigHiddenByDatadogConfig(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1) + { + } + + public void RecordCountOpenTelemetryConfigInvalid(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1) + { + } + public void RecordCountTelemetryApiRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag, int increment = 1) { } diff --git a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_Count.g.cs b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_Count.g.cs index 53ed1a03a1da..b2db3e94ba24 100644 --- a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_Count.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CiVisibilityMetricsTelemetryCollector_Count.g.cs @@ -88,6 +88,14 @@ public void RecordCountStatsApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags { } + public void RecordCountOpenTelemetryConfigHiddenByDatadogConfig(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1) + { + } + + public void RecordCountOpenTelemetryConfigInvalid(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1) + { + } + public void RecordCountTelemetryApiRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag, int increment = 1) { } diff --git a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CountExtensions.g.cs b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CountExtensions.g.cs index 3033e76c82ad..cacdde79f6d1 100644 --- a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CountExtensions.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/CountExtensions.g.cs @@ -12,7 +12,7 @@ internal static partial class CountExtensions /// /// The number of separate metrics in the metric. /// - public const int Length = 39; + public const int Length = 41; /// /// Gets the metric name for the provided metric @@ -41,6 +41,8 @@ public static string GetName(this Datadog.Trace.Telemetry.Metrics.Count metric) Datadog.Trace.Telemetry.Metrics.Count.StatsApiRequests => "stats_api.requests", Datadog.Trace.Telemetry.Metrics.Count.StatsApiResponses => "stats_api.responses", Datadog.Trace.Telemetry.Metrics.Count.StatsApiErrors => "stats_api.errors", + Datadog.Trace.Telemetry.Metrics.Count.OpenTelemetryConfigHiddenByDatadogConfig => "otel.env.hiding", + Datadog.Trace.Telemetry.Metrics.Count.OpenTelemetryConfigInvalid => "otel.env.invalid", Datadog.Trace.Telemetry.Metrics.Count.TelemetryApiRequests => "telemetry_api.requests", Datadog.Trace.Telemetry.Metrics.Count.TelemetryApiResponses => "telemetry_api.responses", Datadog.Trace.Telemetry.Metrics.Count.TelemetryApiErrors => "telemetry_api.errors", @@ -90,6 +92,8 @@ public static bool IsCommon(this Datadog.Trace.Telemetry.Metrics.Count metric) => metric switch { Datadog.Trace.Telemetry.Metrics.Count.LogCreated => "general", + Datadog.Trace.Telemetry.Metrics.Count.OpenTelemetryConfigHiddenByDatadogConfig => "tracers", + Datadog.Trace.Telemetry.Metrics.Count.OpenTelemetryConfigInvalid => "tracers", Datadog.Trace.Telemetry.Metrics.Count.TelemetryApiRequests => "telemetry", Datadog.Trace.Telemetry.Metrics.Count.TelemetryApiResponses => "telemetry", Datadog.Trace.Telemetry.Metrics.Count.TelemetryApiErrors => "telemetry", diff --git a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/IMetricsTelemetryCollector_Count.g.cs b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/IMetricsTelemetryCollector_Count.g.cs index d0de298967da..a1689840e744 100644 --- a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/IMetricsTelemetryCollector_Count.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/IMetricsTelemetryCollector_Count.g.cs @@ -47,6 +47,10 @@ internal partial interface IMetricsTelemetryCollector public void RecordCountStatsApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1); + public void RecordCountOpenTelemetryConfigHiddenByDatadogConfig(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1); + + public void RecordCountOpenTelemetryConfigInvalid(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1); + public void RecordCountTelemetryApiRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag, int increment = 1); public void RecordCountTelemetryApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode 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 0827b43b4535..25fbcb4fcaca 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 partial class MetricsTelemetryCollector { - private const int CountLength = 374; + private const int CountLength = 554; /// /// Creates the buffer for the values. @@ -197,10 +197,192 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // telemetry_api.requests, index = 159 + // otel.env.hiding, index = 159 + 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" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_traces_exporter" }), + 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 = 249 + 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" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_debug", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_runtime_metrics_enabled", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_service", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_tags", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_enabled", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_propagation_style", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_sample_rate", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_traces_exporter" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_traces_sampler" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:otel_traces_sampler_arg" }), + new(new[] { "config_datadog:dd_trace_otel_enabled", "config_opentelemetry:unknown" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_log_level" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_metrics_exporter" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_propagators" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_resource_attributes" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_sdk_disabled" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_service_name" }), + new(new[] { "config_datadog:unknown", "config_opentelemetry:otel_traces_exporter" }), + 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" }), + // telemetry_api.requests, index = 339 new(new[] { "endpoint:agent" }), new(new[] { "endpoint:agentless" }), - // telemetry_api.responses, index = 161 + // telemetry_api.responses, index = 341 new(new[] { "endpoint:agent", "status_code:200" }), new(new[] { "endpoint:agent", "status_code:201" }), new(new[] { "endpoint:agent", "status_code:202" }), @@ -245,18 +427,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 = 205 + // telemetry_api.errors, index = 385 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 = 211 + // version_conflict_tracers_created, index = 391 new(null), - // unsupported_custom_instrumentation_services, index = 212 + // unsupported_custom_instrumentation_services, index = 392 new(null), - // direct_log_logs, index = 213 + // direct_log_logs, index = 393 new(new[] { "integration_name:datadog" }), new(new[] { "integration_name:opentracing" }), new(new[] { "integration_name:ciapp" }), @@ -332,9 +514,9 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "integration_name:directorylistingleak" }), new(new[] { "integration_name:sessiontimeout" }), new(new[] { "integration_name:datadogtracemanual" }), - // direct_log_api.requests, index = 288 + // direct_log_api.requests, index = 468 new(null), - // direct_log_api.responses, index = 289 + // direct_log_api.responses, index = 469 new(new[] { "status_code:200" }), new(new[] { "status_code:201" }), new(new[] { "status_code:202" }), @@ -357,37 +539,37 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "status_code:503" }), new(new[] { "status_code:504" }), new(new[] { "status_code:5xx" }), - // direct_log_api.errors, index = 311 + // direct_log_api.errors, index = 491 new(new[] { "type:timeout" }), new(new[] { "type:network" }), new(new[] { "type:status_code" }), - // waf.init, index = 314 + // waf.init, index = 494 new(null), - // waf.updates, index = 315 + // waf.updates, index = 495 new(null), - // waf.requests, index = 316 + // waf.requests, index = 496 new(new[] { "waf_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:false", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:true", "request_blocked:false", "waf_timeout:false", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:true", "request_blocked:true", "waf_timeout:false", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:true", "request_excluded:false" }), new(new[] { "waf_version", "rule_triggered:false", "request_blocked:false", "waf_timeout:false", "request_excluded:true" }), - // waf.input_truncated, index = 321 + // waf.input_truncated, index = 501 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 = 324 + // rasp.rule.eval, index = 504 new(new[] { "waf_version", "rule_type:lfi" }), new(new[] { "waf_version", "rule_type:ssrf" }), new(new[] { "waf_version", "rule_type:sql_injection" }), - // rasp.rule.match, index = 327 + // rasp.rule.match, index = 507 new(new[] { "waf_version", "rule_type:lfi" }), new(new[] { "waf_version", "rule_type:ssrf" }), new(new[] { "waf_version", "rule_type:sql_injection" }), - // rasp.timeout, index = 330 + // rasp.timeout, index = 510 new(new[] { "waf_version", "rule_type:lfi" }), new(new[] { "waf_version", "rule_type:ssrf" }), new(new[] { "waf_version", "rule_type:sql_injection" }), - // executed.source, index = 333 + // executed.source, index = 513 new(new[] { "source_type:http.request.body" }), new(new[] { "source_type:http.request.path" }), new(new[] { "source_type:http.request.parameter.name" }), @@ -401,9 +583,9 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "source_type:http.request.matrix.parameter" }), new(new[] { "source_type:http.request.uri" }), new(new[] { "source_type:grpc.request.body" }), - // executed.propagation, index = 346 + // executed.propagation, index = 526 new(null), - // executed.sink, index = 347 + // executed.sink, index = 527 new(new[] { "vulnerability_type:none" }), new(new[] { "vulnerability_type:weak_cipher" }), new(new[] { "vulnerability_type:weak_hash" }), @@ -430,7 +612,7 @@ private static AggregatedMetric[] GetCountBuffer() new(new[] { "vulnerability_type:xss" }), new(new[] { "vulnerability_type:directory_listing_leak" }), new(new[] { "vulnerability_type:session_timeout" }), - // request.tainted, index = 373 + // request.tainted, index = 553 new(null), }; @@ -440,7 +622,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, 75, 1, 3, 4, 2, 2, 4, 1, 1, 1, 22, 3, 2, 4, 4, 1, 22, 3, 2, 44, 6, 1, 1, 75, 1, 22, 3, 1, 1, 5, 3, 3, 3, 3, 13, 1, 26, 1, }; + = new int[]{ 4, 75, 1, 3, 4, 2, 2, 4, 1, 1, 1, 22, 3, 2, 4, 4, 1, 22, 3, 90, 90, 2, 44, 6, 1, 1, 75, 1, 22, 3, 1, 1, 5, 3, 3, 3, 3, 13, 1, 26, 1, }; public void RecordCountLogCreated(Datadog.Trace.Telemetry.Metrics.MetricTags.LogLevel tag, int increment = 1) { @@ -551,116 +733,128 @@ public void RecordCountStatsApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags 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 = 159 + ((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 = 249 + ((int)tag1 * 10) + (int)tag2; + Interlocked.Add(ref _buffer.Count[index], increment); + } + public void RecordCountTelemetryApiRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag, int increment = 1) { - var index = 159 + (int)tag; + var index = 339 + (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 = 161 + ((int)tag1 * 22) + (int)tag2; + var index = 341 + ((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 = 205 + ((int)tag1 * 3) + (int)tag2; + var index = 385 + ((int)tag1 * 3) + (int)tag2; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountVersionConflictTracerCreated(int increment = 1) { - Interlocked.Add(ref _buffer.Count[211], increment); + Interlocked.Add(ref _buffer.Count[391], increment); } public void RecordCountUnsupportedCustomInstrumentationServices(int increment = 1) { - Interlocked.Add(ref _buffer.Count[212], increment); + Interlocked.Add(ref _buffer.Count[392], increment); } public void RecordCountDirectLogLogs(Datadog.Trace.Telemetry.Metrics.MetricTags.IntegrationName tag, int increment = 1) { - var index = 213 + (int)tag; + var index = 393 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountDirectLogApiRequests(int increment = 1) { - Interlocked.Add(ref _buffer.Count[288], increment); + Interlocked.Add(ref _buffer.Count[468], increment); } public void RecordCountDirectLogApiResponses(Datadog.Trace.Telemetry.Metrics.MetricTags.StatusCode tag, int increment = 1) { - var index = 289 + (int)tag; + var index = 469 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountDirectLogApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags.ApiError tag, int increment = 1) { - var index = 311 + (int)tag; + var index = 491 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountWafInit(int increment = 1) { - Interlocked.Add(ref _buffer.Count[314], increment); + Interlocked.Add(ref _buffer.Count[494], increment); } public void RecordCountWafUpdates(int increment = 1) { - Interlocked.Add(ref _buffer.Count[315], increment); + Interlocked.Add(ref _buffer.Count[495], increment); } public void RecordCountWafRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.WafAnalysis tag, int increment = 1) { - var index = 316 + (int)tag; + var index = 496 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountInputTruncated(Datadog.Trace.Telemetry.Metrics.MetricTags.TruncationReason tag, int increment = 1) { - var index = 321 + (int)tag; + var index = 501 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountRaspRuleEval(Datadog.Trace.Telemetry.Metrics.MetricTags.RaspRuleType tag, int increment = 1) { - var index = 324 + (int)tag; + var index = 504 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountRaspRuleMatch(Datadog.Trace.Telemetry.Metrics.MetricTags.RaspRuleType tag, int increment = 1) { - var index = 327 + (int)tag; + var index = 507 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountRaspTimeout(Datadog.Trace.Telemetry.Metrics.MetricTags.RaspRuleType tag, int increment = 1) { - var index = 330 + (int)tag; + var index = 510 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastExecutedSources(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSources tag, int increment = 1) { - var index = 333 + (int)tag; + var index = 513 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastExecutedPropagations(int increment = 1) { - Interlocked.Add(ref _buffer.Count[346], increment); + Interlocked.Add(ref _buffer.Count[526], increment); } public void RecordCountIastExecutedSinks(Datadog.Trace.Telemetry.Metrics.MetricTags.IastInstrumentedSinks tag, int increment = 1) { - var index = 347 + (int)tag; + var index = 527 + (int)tag; Interlocked.Add(ref _buffer.Count[index], increment); } public void RecordCountIastRequestTainted(int increment = 1) { - Interlocked.Add(ref _buffer.Count[373], increment); + Interlocked.Add(ref _buffer.Count[553], increment); } } \ No newline at end of file diff --git a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/NullMetricsTelemetryCollector_Count.g.cs b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/NullMetricsTelemetryCollector_Count.g.cs index a15b00704107..02e22f3735de 100644 --- a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/NullMetricsTelemetryCollector_Count.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/TelemetryMetricGenerator/NullMetricsTelemetryCollector_Count.g.cs @@ -88,6 +88,14 @@ public void RecordCountStatsApiErrors(Datadog.Trace.Telemetry.Metrics.MetricTags { } + public void RecordCountOpenTelemetryConfigHiddenByDatadogConfig(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1) + { + } + + public void RecordCountOpenTelemetryConfigInvalid(Datadog.Trace.Telemetry.Metrics.MetricTags.DatadogConfiguration tag1, Datadog.Trace.Telemetry.Metrics.MetricTags.OpenTelemetryConfiguration tag2, int increment = 1) + { + } + public void RecordCountTelemetryApiRequests(Datadog.Trace.Telemetry.Metrics.MetricTags.TelemetryEndpoint tag, int increment = 1) { } diff --git a/tracer/src/Datadog.Trace/Telemetry/Metrics/Count.cs b/tracer/src/Datadog.Trace/Telemetry/Metrics/Count.cs index 858bce496221..0a04f16bf998 100644 --- a/tracer/src/Datadog.Trace/Telemetry/Metrics/Count.cs +++ b/tracer/src/Datadog.Trace/Telemetry/Metrics/Count.cs @@ -115,6 +115,16 @@ internal enum Count /// The number of requests sent to the api endpoint in the agent that errored, tagged by the error type (e.g. `type:timeout`, `type:network`, `type:status_code`) /// [TelemetryMetric("stats_api.errors")] StatsApiErrors, + + /// + /// The number of times a Datadog configuration is set while a corresponding OpenTelemetry configuration is set. + /// + [TelemetryMetric("otel.env.hiding", isCommon: true, NS.Tracer)] OpenTelemetryConfigHiddenByDatadogConfig, + + /// + /// The number of times an OpenTelemetry configuration has a mapping to a Datadog configuration but it cannot be mapped correctly. + /// + [TelemetryMetric("otel.env.invalid", isCommon: true, NS.Tracer)] OpenTelemetryConfigInvalid, #endregion #region Telemetry Namespace diff --git a/tracer/src/Datadog.Trace/Telemetry/Metrics/MetricTags.cs b/tracer/src/Datadog.Trace/Telemetry/Metrics/MetricTags.cs index 4db6a3e32b52..4a725bbcd927 100644 --- a/tracer/src/Datadog.Trace/Telemetry/Metrics/MetricTags.cs +++ b/tracer/src/Datadog.Trace/Telemetry/Metrics/MetricTags.cs @@ -116,6 +116,33 @@ internal enum ApiError [Description("type:status_code")] StatusCode, } + internal enum DatadogConfiguration + { + [Description("config_datadog:dd_trace_debug")] DebugEnabled, + [Description("config_datadog:dd_runtime_metrics_enabled")] RuntimeMetricsEnabled, + [Description("config_datadog:dd_service")] Service, + [Description("config_datadog:dd_tags")] Tags, + [Description("config_datadog:dd_trace_enabled")] TraceEnabled, + [Description("config_datadog:dd_trace_propagation_style")] PropagationStyle, + [Description("config_datadog:dd_trace_sample_rate")] SampleRate, + [Description("config_datadog:dd_trace_otel_enabled")] OpenTelemetryEnabled, + [Description("config_datadog:unknown")] Unknown, + } + + internal enum OpenTelemetryConfiguration + { + [Description("config_opentelemetry:otel_log_level")] LogLevel, + [Description("config_opentelemetry:otel_metrics_exporter")] MetricsExporter, + [Description("config_opentelemetry:otel_propagators")] Propagators, + [Description("config_opentelemetry:otel_resource_attributes")] ResourceAttributes, + [Description("config_opentelemetry:otel_sdk_disabled")] SdkDisabled, + [Description("config_opentelemetry:otel_service_name")] ServiceName, + [Description("config_opentelemetry:otel_traces_exporter")] TracesExporter, + [Description("config_opentelemetry:otel_traces_sampler")] TracesSampler, + [Description("config_opentelemetry:otel_traces_sampler_arg")] TracesSamplerArg, + [Description("config_opentelemetry:unknown")] Unknown, + } + internal enum PartialFlushReason { [Description("reason:large_trace")] LargeTrace, diff --git a/tracer/src/Datadog.Trace/TracerManager.cs b/tracer/src/Datadog.Trace/TracerManager.cs index bfacc112ce3a..1c2d590363fc 100644 --- a/tracer/src/Datadog.Trace/TracerManager.cs +++ b/tracer/src/Datadog.Trace/TracerManager.cs @@ -15,6 +15,7 @@ using Datadog.Trace.ClrProfiler; using Datadog.Trace.ClrProfiler.ServerlessInstrumentation; using Datadog.Trace.Configuration; +using Datadog.Trace.Configuration.ConfigurationSources.Telemetry; using Datadog.Trace.Configuration.Schema; using Datadog.Trace.ContinuousProfiler; using Datadog.Trace.DataStreamsMonitoring; @@ -573,6 +574,9 @@ void WriteDictionary(IReadOnlyDictionary dictionary) } Log.Information("DATADOG TRACER CONFIGURATION - {Configuration}", stringWriter.ToString()); + + OverrideErrorLog.Instance.ProcessAndClearActions(Log, TelemetryFactory.Metrics); // global errors, only logged once + instanceSettings.ErrorLog.ProcessAndClearActions(Log, TelemetryFactory.Metrics); // global errors, only logged once } catch (Exception ex) { diff --git a/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/Helpers/TelemetryHelperTests.cs b/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/Helpers/TelemetryHelperTests.cs index fe50d57e1d86..c0501f32793a 100644 --- a/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/Helpers/TelemetryHelperTests.cs +++ b/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/Helpers/TelemetryHelperTests.cs @@ -8,6 +8,7 @@ using System.Linq; using Datadog.Trace.AppSec; using Datadog.Trace.Configuration; +using Datadog.Trace.Configuration.ConfigurationSources.Telemetry; using Datadog.Trace.Configuration.Telemetry; using Datadog.Trace.Telemetry; using Datadog.Trace.TestHelpers; @@ -59,7 +60,7 @@ public void AssertIntegration_HandlesMultipleTelemetryPushes() collector.IntegrationRunning(IntegrationId.Kafka); collector.IntegrationGeneratedSpan(IntegrationId.Msmq); - var tracerSettings = new TracerSettings(null, NullConfigurationTelemetry.Instance) + var tracerSettings = new TracerSettings(null, NullConfigurationTelemetry.Instance, new OverrideErrorLog()) { DisabledIntegrationNames = new HashSet { nameof(IntegrationId.Kafka), nameof(IntegrationId.Msmq) } }; @@ -128,7 +129,7 @@ public void AssertConfiguration_HandlesMultipleTelemetryPushes() { ConfigurationKeys.AppSec.ScaEnabled, "1" }, }); - _ = new ImmutableTracerSettings(new TracerSettings(config, collector)); + _ = new ImmutableTracerSettings(new TracerSettings(config, collector, new OverrideErrorLog())); telemetryData.Add(BuildTelemetryData(null, collector.GetData())); diff --git a/tracer/test/Datadog.Trace.ClrProfiler.Managed.Tests/DbScopeFactoryTests.cs b/tracer/test/Datadog.Trace.ClrProfiler.Managed.Tests/DbScopeFactoryTests.cs index 3e5d50b2c3e7..15330b0331cf 100644 --- a/tracer/test/Datadog.Trace.ClrProfiler.Managed.Tests/DbScopeFactoryTests.cs +++ b/tracer/test/Datadog.Trace.ClrProfiler.Managed.Tests/DbScopeFactoryTests.cs @@ -11,6 +11,7 @@ using System.Threading.Tasks; using Datadog.Trace.ClrProfiler.AutoInstrumentation.AdoNet; using Datadog.Trace.Configuration; +using Datadog.Trace.Configuration.ConfigurationSources.Telemetry; using Datadog.Trace.Configuration.Telemetry; using Datadog.Trace.TestHelpers; using FluentAssertions; @@ -153,7 +154,7 @@ public async Task CreateDbCommandScope_InjectsDbmWhenEnabled(Type commandType, s { ConfigurationKeys.DbmPropagationMode, dbmMode } }; IConfigurationSource source = new NameValueConfigurationSource(collection); - var tracerSettings = new TracerSettings(source, NullConfigurationTelemetry.Instance); + var tracerSettings = new TracerSettings(source, NullConfigurationTelemetry.Instance, new OverrideErrorLog()); await using var tracer = TracerHelper.CreateWithFakeAgent(tracerSettings); using var scope = CreateDbCommandScope(tracer, command); @@ -175,7 +176,7 @@ public async Task CreateDbCommandScope_OnlyInjectsDbmOnceWhenCommandIsReused(Typ { ConfigurationKeys.DbmPropagationMode, dbmMode } }; IConfigurationSource source = new NameValueConfigurationSource(collection); - var tracerSettings = new TracerSettings(source, NullConfigurationTelemetry.Instance); + var tracerSettings = new TracerSettings(source, NullConfigurationTelemetry.Instance, new OverrideErrorLog()); await using var tracer = TracerHelper.CreateWithFakeAgent(tracerSettings); using (var scope = CreateDbCommandScope(tracer, command)) @@ -211,7 +212,7 @@ public async Task CreateDbCommandScope_DoesNotInjectDbmIntoStoredProcedures(Type { ConfigurationKeys.DbmPropagationMode, dbmMode } }; IConfigurationSource source = new NameValueConfigurationSource(collection); - var tracerSettings = new TracerSettings(source, NullConfigurationTelemetry.Instance); + var tracerSettings = new TracerSettings(source, NullConfigurationTelemetry.Instance, new OverrideErrorLog()); await using var tracer = TracerHelper.CreateWithFakeAgent(tracerSettings); using var scope = CreateDbCommandScope(tracer, command); @@ -233,7 +234,7 @@ public async Task CreateDbCommandScope_DoesNotInjectDbmWhenDisabled(Type command { ConfigurationKeys.DbmPropagationMode, "disabled" } }; IConfigurationSource source = new NameValueConfigurationSource(collection); - var tracerSettings = new TracerSettings(source, NullConfigurationTelemetry.Instance); + var tracerSettings = new TracerSettings(source, NullConfigurationTelemetry.Instance, new OverrideErrorLog()); await using var tracer = TracerHelper.CreateWithFakeAgent(tracerSettings); using var scope = CreateDbCommandScope(tracer, command); diff --git a/tracer/test/Datadog.Trace.Security.Unit.Tests/StandaloneASMBillingTests.cs b/tracer/test/Datadog.Trace.Security.Unit.Tests/StandaloneASMBillingTests.cs index d6b43f4e3015..7fa53c754397 100644 --- a/tracer/test/Datadog.Trace.Security.Unit.Tests/StandaloneASMBillingTests.cs +++ b/tracer/test/Datadog.Trace.Security.Unit.Tests/StandaloneASMBillingTests.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using Datadog.Trace.Configuration; +using Datadog.Trace.Configuration.ConfigurationSources.Telemetry; using Datadog.Trace.Configuration.Telemetry; using Datadog.Trace.Security.Unit.Tests.Iast; using Xunit; @@ -20,7 +21,7 @@ public void GivenAppsecStandaloneEnabledSettings_WhenEnabled_IsReallyEnabled() { { ConfigurationKeys.AppsecStandaloneEnabled, true } }); - var tracerSettings = new TracerSettings(settings, NullConfigurationTelemetry.Instance); + var tracerSettings = new TracerSettings(settings, NullConfigurationTelemetry.Instance, new OverrideErrorLog()); Assert.True(tracerSettings.AppsecStandaloneEnabledInternal); } @@ -32,7 +33,7 @@ public void GivenAppsecStandaloneEnabledSettings_WhenEnabled_StatsComputationIsD { ConfigurationKeys.AppsecStandaloneEnabled, true }, { ConfigurationKeys.StatsComputationEnabled, true } }); - var tracerSettings = new TracerSettings(settings, NullConfigurationTelemetry.Instance); + var tracerSettings = new TracerSettings(settings, NullConfigurationTelemetry.Instance, new OverrideErrorLog()); // Should ignore the configuration set by the customer Assert.False(tracerSettings.StatsComputationEnabled); diff --git a/tracer/test/Datadog.Trace.TestHelpers/LogSettingsHelper.cs b/tracer/test/Datadog.Trace.TestHelpers/LogSettingsHelper.cs index 144388ee8c38..951c6f3d204d 100644 --- a/tracer/test/Datadog.Trace.TestHelpers/LogSettingsHelper.cs +++ b/tracer/test/Datadog.Trace.TestHelpers/LogSettingsHelper.cs @@ -5,6 +5,7 @@ using System.Collections.Specialized; using Datadog.Trace.Configuration; +using Datadog.Trace.Configuration.ConfigurationSources.Telemetry; using Datadog.Trace.Logging.DirectSubmission; using Datadog.Trace.Logging.DirectSubmission.Formatting; @@ -13,7 +14,7 @@ namespace Datadog.Trace.TestHelpers internal class LogSettingsHelper { public static LogFormatter GetFormatter() => new( - new ImmutableTracerSettings(new TracerSettings(null, Configuration.Telemetry.NullConfigurationTelemetry.Instance)), + new ImmutableTracerSettings(new TracerSettings(null, Configuration.Telemetry.NullConfigurationTelemetry.Instance, new OverrideErrorLog())), GetValidSettings(), aasSettings: null, serviceName: "MyTestService", diff --git a/tracer/test/Datadog.Trace.Tests/Configuration/ConfigurationSourceTests.cs b/tracer/test/Datadog.Trace.Tests/Configuration/ConfigurationSourceTests.cs index 626ff33d022f..b5f817a81194 100644 --- a/tracer/test/Datadog.Trace.Tests/Configuration/ConfigurationSourceTests.cs +++ b/tracer/test/Datadog.Trace.Tests/Configuration/ConfigurationSourceTests.cs @@ -8,6 +8,7 @@ using System.Collections.Specialized; using System.Linq; using Datadog.Trace.Configuration; +using Datadog.Trace.Configuration.ConfigurationSources.Telemetry; using Datadog.Trace.Configuration.Telemetry; using Datadog.Trace.Vendors.Newtonsoft.Json; using FluentAssertions; @@ -247,7 +248,7 @@ public void GlobalDefaultSetting() { foreach (var (settingGetter, expectedValue) in GetGlobalDefaultTestData()) { - var settings = new GlobalSettings(NullConfigurationSource.Instance, NullConfigurationTelemetry.Instance); + var settings = new GlobalSettings(NullConfigurationSource.Instance, NullConfigurationTelemetry.Instance, new OverrideErrorLog()); object actualValue = settingGetter(settings); Assert.Equal(expectedValue, actualValue); } @@ -260,7 +261,7 @@ public void GlobalNameValueConfigurationSource() { var collection = new NameValueCollection { { key, value } }; IConfigurationSource source = new NameValueConfigurationSource(collection); - var settings = new GlobalSettings(source, NullConfigurationTelemetry.Instance); + var settings = new GlobalSettings(source, NullConfigurationTelemetry.Instance, new OverrideErrorLog()); object actualValue = settingGetter(settings); Assert.Equal(expectedValue, actualValue); } @@ -275,7 +276,7 @@ public void GlobalEnvironmentConfigurationSource() // save original value so we can restore later Environment.SetEnvironmentVariable(key, value, EnvironmentVariableTarget.Process); - var settings = new GlobalSettings(source, NullConfigurationTelemetry.Instance); + var settings = new GlobalSettings(source, NullConfigurationTelemetry.Instance, new OverrideErrorLog()); object actualValue = settingGetter(settings); Assert.Equal(expectedValue, actualValue); diff --git a/tracer/test/Datadog.Trace.Tests/Configuration/GlobalSettingsTests.cs b/tracer/test/Datadog.Trace.Tests/Configuration/GlobalSettingsTests.cs index bf5a542f84e7..22b0379b5758 100644 --- a/tracer/test/Datadog.Trace.Tests/Configuration/GlobalSettingsTests.cs +++ b/tracer/test/Datadog.Trace.Tests/Configuration/GlobalSettingsTests.cs @@ -4,7 +4,11 @@ // using Datadog.Trace.Configuration; +using Datadog.Trace.Configuration.ConfigurationSources.Telemetry; using Datadog.Trace.Configuration.Telemetry; +using Datadog.Trace.Logging; +using Datadog.Trace.Telemetry; +using Datadog.Trace.Telemetry.Metrics; using Datadog.Trace.TestHelpers; using FluentAssertions; using Xunit; @@ -18,31 +22,33 @@ public class GlobalSettingsTests : SettingsTestsBase public void DebugEnabled(string value, bool expected) { var source = CreateConfigurationSource((ConfigurationKeys.DebugEnabled, value)); - var settings = new GlobalSettings(source, NullConfigurationTelemetry.Instance); + var settings = new GlobalSettings(source, NullConfigurationTelemetry.Instance, new OverrideErrorLog()); settings.DebugEnabled.Should().Be(expected); } [Theory] - [InlineData("true", "info", true)] - [InlineData("true", "debug", true)] - [InlineData("false", "info", false)] - [InlineData("false", "debug", false)] - [InlineData("A", "info", false)] - [InlineData("A", "debug", false)] - [InlineData(null, "info", false)] - [InlineData(null, "debug", true)] - [InlineData("", "info", false)] - [InlineData("", "debug", false)] - public void OtelLogLevelDebugSetsDebugEnabled(string value, string otelValue, bool expected) + [InlineData("true", "info", true, (int)Count.OpenTelemetryConfigHiddenByDatadogConfig)] + [InlineData("true", "debug", true, (int)Count.OpenTelemetryConfigHiddenByDatadogConfig)] + [InlineData("false", "info", false, (int)Count.OpenTelemetryConfigHiddenByDatadogConfig)] + [InlineData("false", "debug", false, (int)Count.OpenTelemetryConfigHiddenByDatadogConfig)] + [InlineData("A", "info", false, (int)Count.OpenTelemetryConfigHiddenByDatadogConfig)] + [InlineData("A", "debug", false, (int)Count.OpenTelemetryConfigHiddenByDatadogConfig)] + [InlineData(null, "info", false, (int)Count.OpenTelemetryConfigInvalid)] + [InlineData(null, "debug", true, null)] + [InlineData("", "info", false, (int)Count.OpenTelemetryConfigHiddenByDatadogConfig)] + [InlineData("", "debug", false, (int)Count.OpenTelemetryConfigHiddenByDatadogConfig)] + public void OtelLogLevelDebugSetsDebugEnabled(string value, string otelValue, bool expected, int? metric) { const string otelKey = ConfigurationKeys.OpenTelemetry.LogLevel; var source = CreateConfigurationSource( (ConfigurationKeys.DebugEnabled, value), (otelKey, otelValue)); - var settings = new GlobalSettings(source, NullConfigurationTelemetry.Instance); + var errorLog = new OverrideErrorLog(); + var settings = new GlobalSettings(source, NullConfigurationTelemetry.Instance, errorLog); settings.DebugEnabled.Should().Be(expected); + errorLog.ShouldHaveExpectedOtelMetric(metric, ConfigurationKeys.OpenTelemetry.LogLevel.ToLowerInvariant(), ConfigurationKeys.DebugEnabled.ToLowerInvariant()); } [Theory] @@ -50,7 +56,7 @@ public void OtelLogLevelDebugSetsDebugEnabled(string value, string otelValue, bo public void DiagnosticSourceEnabled(string value, bool expected) { var source = CreateConfigurationSource((ConfigurationKeys.DiagnosticSourceEnabled, value)); - var settings = new GlobalSettings(source, NullConfigurationTelemetry.Instance); + var settings = new GlobalSettings(source, NullConfigurationTelemetry.Instance, new OverrideErrorLog()); settings.DiagnosticSourceEnabled.Should().Be(expected); } diff --git a/tracer/test/Datadog.Trace.Tests/Configuration/ImmutableTracerSettingsTests.cs b/tracer/test/Datadog.Trace.Tests/Configuration/ImmutableTracerSettingsTests.cs index 5f197a48e13c..a2f3ae3bd71e 100644 --- a/tracer/test/Datadog.Trace.Tests/Configuration/ImmutableTracerSettingsTests.cs +++ b/tracer/test/Datadog.Trace.Tests/Configuration/ImmutableTracerSettingsTests.cs @@ -7,8 +7,12 @@ using System.Reflection; using AgileObjects.NetStandardPolyfills; using Datadog.Trace.Configuration; +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; using FluentAssertions; using FluentAssertions.Execution; using Xunit; @@ -72,7 +76,7 @@ public void HasSamePropertiesAsTracerSettings() public void CopiesTelemetryFromTracerSettings() { var config = new ConfigurationTelemetry(); - var tracerSettings = new TracerSettings(NullConfigurationSource.Instance, config); + var tracerSettings = new TracerSettings(NullConfigurationSource.Instance, config, new()); var immutable = tracerSettings.Build(); var immutableTelemetry = immutable.Telemetry; @@ -125,7 +129,7 @@ public void RecordsDisabledSettingsInTelemetry() var expected = new[] { "MongoDb", "Msmq", "GraphQL", "Wcf", "StackExchangeRedis" }; var telemetry = new ConfigurationTelemetry(); - var tracerSettings = new TracerSettings(source, telemetry); + var tracerSettings = new TracerSettings(source, telemetry, new()); var immutable = tracerSettings.Build(); var config = immutable @@ -181,7 +185,7 @@ public void OTELTagsSetsServiceInformation() } [Fact] - public void DDTagsTakesPrecdenceOverOTELTags() + public void DDTagsTakesPrecedenceOverOTELTags() { var source = new NameValueConfigurationSource(new() { @@ -189,7 +193,8 @@ public void DDTagsTakesPrecdenceOverOTELTags() { "OTEL_RESOURCE_ATTRIBUTES", "deployment.environment=datadog_env,service.name=datadog_service,service.version=datadog_version" }, }); - var tracerSettings = new TracerSettings(source); + var errorLog = new OverrideErrorLog(); + var tracerSettings = new TracerSettings(source, NullConfigurationTelemetry.Instance, errorLog); var immutableTracerSettings = tracerSettings.Build(); immutableTracerSettings.EnvironmentInternal.Should().Be("datadog_env"); @@ -197,6 +202,7 @@ public void DDTagsTakesPrecdenceOverOTELTags() // Since the DD_TAGS config is set, the OTEL_RESOURCE_ATTRIBUTES config is ignored immutableTracerSettings.ServiceVersionInternal.Should().NotBe("datadog_version"); immutableTracerSettings.ServiceNameInternal.Should().NotBe("datadog_service"); + errorLog.ShouldHaveExpectedOtelMetric(Count.OpenTelemetryConfigHiddenByDatadogConfig, "OTEL_RESOURCE_ATTRIBUTES".ToLowerInvariant(), "DD_TAGS".ToLowerInvariant()); } } } diff --git a/tracer/test/Datadog.Trace.Tests/Configuration/MsmqTests.cs b/tracer/test/Datadog.Trace.Tests/Configuration/MsmqTests.cs index b0c847d53e20..42962b015ca8 100644 --- a/tracer/test/Datadog.Trace.Tests/Configuration/MsmqTests.cs +++ b/tracer/test/Datadog.Trace.Tests/Configuration/MsmqTests.cs @@ -9,6 +9,7 @@ using Datadog.Trace.Agent; using Datadog.Trace.ClrProfiler.AutoInstrumentation.Msmq; using Datadog.Trace.Configuration; +using Datadog.Trace.Configuration.ConfigurationSources.Telemetry; using Datadog.Trace.Configuration.Telemetry; using Datadog.Trace.Sampling; using FluentAssertions; @@ -31,7 +32,7 @@ public void GetOperationNameIsCorrect(object schemaVersionObject, string spanKin var schemaVersion = (SchemaVersion)schemaVersionObject; var configSourceMock = new Mock(); configSourceMock.Setup(c => c.GetString(It.Is(s => s.Equals(ConfigurationKeys.MetadataSchemaVersion)))).Returns(schemaVersion.ToString()); - var settings = new TracerSettings(configSourceMock.Object, new ConfigurationTelemetry()); + var settings = new TracerSettings(configSourceMock.Object, new ConfigurationTelemetry(), new OverrideErrorLog()); var writerMock = new Mock(); var samplerMock = new Mock(); var tracer = new Tracer(settings, writerMock.Object, samplerMock.Object, scopeManager: null, statsd: null); diff --git a/tracer/test/Datadog.Trace.Tests/Configuration/OverrideErrorLogExtensions.cs b/tracer/test/Datadog.Trace.Tests/Configuration/OverrideErrorLogExtensions.cs new file mode 100644 index 000000000000..89a855fed096 --- /dev/null +++ b/tracer/test/Datadog.Trace.Tests/Configuration/OverrideErrorLogExtensions.cs @@ -0,0 +1,53 @@ +// +// 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. +// + +using System.Collections.Generic; +using System.Linq; +using Datadog.Trace.Configuration.ConfigurationSources.Telemetry; +using Datadog.Trace.Logging; +using Datadog.Trace.Telemetry; +using Datadog.Trace.Telemetry.Metrics; +using FluentAssertions; +using MetricDefinition = (Datadog.Trace.Telemetry.Metrics.Count? Metric, string OtelSetting, string DdSetting); + +namespace Datadog.Trace.Tests.Configuration; + +internal static class OverrideErrorLogExtensions +{ + public static void ShouldHaveExpectedOtelMetric(this OverrideErrorLog errorLog, int? metric, string otelSetting, string ddSetting) + => errorLog.ShouldHaveExpectedOtelMetric(metric.HasValue ? (Count?)metric.Value : null, otelSetting, ddSetting); + + public static void ShouldHaveExpectedOtelMetric(this OverrideErrorLog errorLog, Count? metric, string otelSetting, string ddSetting) + => errorLog.ShouldHaveExpectedOtelMetric((metric, otelSetting, ddSetting)); + + public static void ShouldHaveExpectedOtelMetric(this OverrideErrorLog errorLog, IEnumerable metric) + => errorLog.ShouldHaveExpectedOtelMetric([..metric]); + + private static void ShouldHaveExpectedOtelMetric(this OverrideErrorLog errorLog, params MetricDefinition[] expectedMetrics) + { + var telemetry = new MetricsTelemetryCollector(); + errorLog.ProcessAndClearActions(DatadogSerilogLogger.NullLogger, telemetry); + telemetry.AggregateMetrics(); + + var actual = telemetry.GetMetrics().Metrics; + var expected = expectedMetrics + .Where(x => x.Metric.HasValue) + .Select(metric => new + { + Metric = metric.Metric.Value.GetName(), + Tags = new[] { $"config_datadog:{metric.DdSetting}", $"config_opentelemetry:{metric.OtelSetting}" }, + }) + .ToList(); + + if (expected.Count == 0) + { + actual.Should().BeNullOrEmpty(); + } + else + { + actual.Should().BeEquivalentTo(expected); + } + } +} diff --git a/tracer/test/Datadog.Trace.Tests/Configuration/RabbitMQTests.cs b/tracer/test/Datadog.Trace.Tests/Configuration/RabbitMQTests.cs index 4f65ad00bcd2..ea5cc93d7ad9 100644 --- a/tracer/test/Datadog.Trace.Tests/Configuration/RabbitMQTests.cs +++ b/tracer/test/Datadog.Trace.Tests/Configuration/RabbitMQTests.cs @@ -9,6 +9,7 @@ using Datadog.Trace.Agent; using Datadog.Trace.ClrProfiler.AutoInstrumentation.RabbitMQ; using Datadog.Trace.Configuration; +using Datadog.Trace.Configuration.ConfigurationSources.Telemetry; using Datadog.Trace.Configuration.Telemetry; using Datadog.Trace.Sampling; using FluentAssertions; @@ -31,7 +32,7 @@ public void GetOperationNameIsCorrect(object schemaVersionObject, string spanKin var schemaVersion = (SchemaVersion)schemaVersionObject; var configSourceMock = new Mock(); configSourceMock.Setup(c => c.GetString(It.Is(s => s.Equals(ConfigurationKeys.MetadataSchemaVersion)))).Returns(schemaVersion.ToString()); - var settings = new TracerSettings(configSourceMock.Object, new ConfigurationTelemetry()); + var settings = new TracerSettings(configSourceMock.Object, new ConfigurationTelemetry(), new OverrideErrorLog()); var writerMock = new Mock(); var samplerMock = new Mock(); var tracer = new Tracer(settings, writerMock.Object, samplerMock.Object, scopeManager: null, statsd: null); diff --git a/tracer/test/Datadog.Trace.Tests/Configuration/TracerSettingsTests.cs b/tracer/test/Datadog.Trace.Tests/Configuration/TracerSettingsTests.cs index 3cb38c04c0a6..244f40c8c72f 100644 --- a/tracer/test/Datadog.Trace.Tests/Configuration/TracerSettingsTests.cs +++ b/tracer/test/Datadog.Trace.Tests/Configuration/TracerSettingsTests.cs @@ -10,11 +10,13 @@ using System.Linq; using Datadog.Trace.Agent; using Datadog.Trace.Configuration; +using Datadog.Trace.Configuration.ConfigurationSources.Telemetry; using Datadog.Trace.Configuration.Telemetry; using Datadog.Trace.ExtensionMethods; using Datadog.Trace.Sampling; using Datadog.Trace.Tagging; using Datadog.Trace.Telemetry; +using Datadog.Trace.Telemetry.Metrics; using Datadog.Trace.TestHelpers; using FluentAssertions; using Moq; @@ -112,16 +114,16 @@ public void DDTagsTakesPrecedenceOverOtelTags(string ddTagKey, string otelTagKey } [Theory] - [InlineData("", null, true)] - [InlineData("", "random", true)] - [InlineData("", "none", true)] - [InlineData("1", null, true)] - [InlineData("1", "none", true)] - [InlineData("0", "random", false)] - [InlineData("0", "none", false)] - [InlineData(null, "random", true)] - [InlineData(null, "none", false)] - public void TraceEnabled(string value, string otelValue, bool areTracesEnabled) + [InlineData("", null, true, null)] + [InlineData("", "random", true, (int)Count.OpenTelemetryConfigHiddenByDatadogConfig)] + [InlineData("", "none", true, (int)Count.OpenTelemetryConfigHiddenByDatadogConfig)] + [InlineData("1", null, true, null)] + [InlineData("1", "none", true, (int)Count.OpenTelemetryConfigHiddenByDatadogConfig)] + [InlineData("0", "random", false, (int)Count.OpenTelemetryConfigHiddenByDatadogConfig)] + [InlineData("0", "none", false, (int)Count.OpenTelemetryConfigHiddenByDatadogConfig)] + [InlineData(null, "random", true, (int)Count.OpenTelemetryConfigInvalid)] + [InlineData(null, "none", false, null)] + public void TraceEnabled(string value, string otelValue, bool areTracesEnabled, int? metric) { var settings = new NameValueCollection { @@ -129,9 +131,11 @@ public void TraceEnabled(string value, string otelValue, bool areTracesEnabled) { ConfigurationKeys.OpenTelemetry.TracesExporter, otelValue }, }; - var tracerSettings = new TracerSettings(new NameValueConfigurationSource(settings)); + var errorLog = new OverrideErrorLog(); + var tracerSettings = new TracerSettings(new NameValueConfigurationSource(settings), NullConfigurationTelemetry.Instance, errorLog); Assert.Equal(areTracesEnabled, tracerSettings.TraceEnabled); + errorLog.ShouldHaveExpectedOtelMetric(metric, ConfigurationKeys.OpenTelemetry.TracesExporter.ToLowerInvariant(), ConfigurationKeys.TraceEnabled.ToLowerInvariant()); _writerMock.Invocations.Clear(); @@ -273,9 +277,16 @@ public void ServiceName(string value, string legacyValue, string otelValue, stri const string otelKey = ConfigurationKeys.OpenTelemetry.ServiceName; var source = CreateConfigurationSource((ConfigurationKeys.ServiceName, value), (legacyServiceName, legacyValue), (otelKey, otelValue)); - var settings = new TracerSettings(source); + var errorLog = new OverrideErrorLog(); + var settings = new TracerSettings(source, NullConfigurationTelemetry.Instance, errorLog); settings.ServiceName.Should().Be(expected); + Count? metric = otelValue switch + { + "ignored_otel" => Count.OpenTelemetryConfigHiddenByDatadogConfig, + _ => null, + }; + errorLog.ShouldHaveExpectedOtelMetric(metric, ConfigurationKeys.OpenTelemetry.ServiceName.ToLowerInvariant(), ConfigurationKeys.ServiceName.ToLowerInvariant()); } [Theory] @@ -490,22 +501,35 @@ public void StatsComputationInterval(string value, int expected) [Theory] [InlineData("true", "none", true)] [InlineData("true", "random", true)] + [InlineData("true", null, true)] [InlineData("false", "none", false)] [InlineData("false", "random", false)] + [InlineData("false", null, false)] [InlineData("A", "none", false)] [InlineData("A", "random", false)] [InlineData("", "none", false)] [InlineData("", "random", false)] [InlineData(null, "none", false)] [InlineData(null, "random", false)] + [InlineData(null, null, false)] public void RuntimeMetricsEnabled(string value, string otelValue, bool expected) { var source = CreateConfigurationSource( (ConfigurationKeys.RuntimeMetricsEnabled, value), (ConfigurationKeys.OpenTelemetry.MetricsExporter, otelValue)); - var settings = new TracerSettings(source); + + var errorLog = new OverrideErrorLog(); + var settings = new TracerSettings(source, NullConfigurationTelemetry.Instance, errorLog); settings.RuntimeMetricsEnabled.Should().Be(expected); + Count? metric = (value, otelValue) switch + { + (null, "random") => Count.OpenTelemetryConfigInvalid, + (not null, not null) => Count.OpenTelemetryConfigHiddenByDatadogConfig, + _ => null, + }; + + errorLog.ShouldHaveExpectedOtelMetric(metric, ConfigurationKeys.OpenTelemetry.MetricsExporter.ToLowerInvariant(), ConfigurationKeys.RuntimeMetricsEnabled.ToLowerInvariant()); } [Theory] @@ -534,7 +558,7 @@ public void CustomSamplingRulesFormat(string value, string expected) { var source = CreateConfigurationSource((ConfigurationKeys.CustomSamplingRulesFormat, value)); var telemetry = new ConfigurationTelemetry(); - var settings = new TracerSettings(source, telemetry); + var settings = new TracerSettings(source, telemetry, new()); // verify setting settings.CustomSamplingRulesFormat.Should().Be(expected); @@ -602,15 +626,51 @@ public void SpanSamplingRules(string value, string expected) [InlineData(null, "always_on", null, 1.0d)] [InlineData(null, "parentbased_always_off", null, 0.0d)] [InlineData(null, "always_off", null, 0.0d)] + [InlineData(null, "traceidratio", "invalid", null)] + [InlineData(null, "parentbased_always_on", "invalid", 1.0d)] + [InlineData(null, "always_on", "invalid", 1.0d)] + [InlineData(null, "parentbased_always_off", "invalid", 0.0d)] + [InlineData(null, "always_off", "invalid", 0.0d)] + [InlineData(null, "invalid", null, null)] + [InlineData(null, "invalid", "invalid", null)] public void GlobalSamplingRate(string value, string otelSampler, string otelSampleRate, double? expected) { var source = CreateConfigurationSource( (ConfigurationKeys.GlobalSamplingRate, value), (ConfigurationKeys.OpenTelemetry.TracesSampler, otelSampler), (ConfigurationKeys.OpenTelemetry.TracesSamplerArg, otelSampleRate)); - var settings = new TracerSettings(source); + var errorLog = new OverrideErrorLog(); + var settings = new TracerSettings(source, NullConfigurationTelemetry.Instance, errorLog); + // confirm the logs/metrics settings.GlobalSamplingRate.Should().Be(expected); + var metrics = new List<(Count?, string, string)>(); + + if (value is not null) + { + // hidden metrics + if (otelSampler is not null) + { + metrics.Add((Count.OpenTelemetryConfigHiddenByDatadogConfig, ConfigurationKeys.OpenTelemetry.TracesSampler.ToLowerInvariant(), ConfigurationKeys.GlobalSamplingRate.ToLowerInvariant())); + } + + if (otelSampleRate is not null) + { + metrics.Add((Count.OpenTelemetryConfigHiddenByDatadogConfig, ConfigurationKeys.OpenTelemetry.TracesSamplerArg.ToLowerInvariant(), ConfigurationKeys.GlobalSamplingRate.ToLowerInvariant())); + } + } + else if (otelSampler is "invalid") + { + // we _don't_ report this one as invalid, and it "prevents" reporting the invalid arg + } + else if (otelSampler is "traceidratio" or "parentbased_traceidratio" + && otelSampleRate is "invalid" or null) + { + // we _only_ report this one if we need to use it + metrics.Add((Count.OpenTelemetryConfigInvalid, ConfigurationKeys.OpenTelemetry.TracesSamplerArg.ToLowerInvariant(), ConfigurationKeys.GlobalSamplingRate.ToLowerInvariant())); + } + + errorLog.ShouldHaveExpectedOtelMetric(metrics.ToArray()); } [Theory] @@ -775,9 +835,19 @@ public void IsActivityListenerEnabled(string value, string fallbackValue, string const string otelKey = ConfigurationKeys.OpenTelemetry.SdkDisabled; var source = CreateConfigurationSource((ConfigurationKeys.FeatureFlags.OpenTelemetryEnabled, value), (fallbackKey, fallbackValue), (otelKey, otelValue)); - var settings = new TracerSettings(source); + var errorLog = new OverrideErrorLog(); + var settings = new TracerSettings(source, NullConfigurationTelemetry.Instance, errorLog); settings.IsActivityListenerEnabled.Should().Be(expected); + Count? metric = (value ?? fallbackValue, otelValue?.ToLower()) switch + { + (null, "true") => null, + (null, _) => Count.OpenTelemetryConfigInvalid, + (not null, not null) => Count.OpenTelemetryConfigHiddenByDatadogConfig, + _ => null, + }; + + errorLog.ShouldHaveExpectedOtelMetric(metric, ConfigurationKeys.OpenTelemetry.SdkDisabled.ToLowerInvariant(), ConfigurationKeys.FeatureFlags.OpenTelemetryEnabled.ToLowerInvariant()); } [Theory] @@ -789,6 +859,7 @@ public void IsActivityListenerEnabled(string value, string fallbackValue, string [InlineData(null, null, null, "tracecontext", new[] { "tracecontext" })] [InlineData(null, null, null, "tracecontext,b3,b3multi", new[] { "tracecontext", "b3 single header", "b3multi" })] [InlineData(null, null, null, null, new[] { "Datadog", "tracecontext" })] + [InlineData(null, null, null, ",", new[] { "Datadog", "tracecontext" })] public void PropagationStyleInject(string value, string legacyValue, string fallbackValue, string otelValue, string[] expected) { const string legacyKey = "DD_PROPAGATION_STYLE_INJECT"; @@ -803,9 +874,19 @@ public void PropagationStyleInject(string value, string legacyValue, string fall (otelKey, otelValue), (ConfigurationKeys.FeatureFlags.OpenTelemetryEnabled, isActivityListenerEnabled ? "1" : "0")); - var settings = new TracerSettings(source); + var errorLog = new OverrideErrorLog(); + var settings = new TracerSettings(source, NullConfigurationTelemetry.Instance, errorLog); settings.PropagationStyleInject.Should().BeEquivalentTo(expected); + + Count? metric = (value ?? legacyValue ?? fallbackValue, otelValue) switch + { + (null, ",") => Count.OpenTelemetryConfigInvalid, + (not null, not null) => Count.OpenTelemetryConfigHiddenByDatadogConfig, + _ => null, + }; + + errorLog.ShouldHaveExpectedOtelMetric(metric, ConfigurationKeys.OpenTelemetry.Propagators.ToLowerInvariant(), ConfigurationKeys.PropagationStyle.ToLowerInvariant()); } } @@ -818,6 +899,7 @@ public void PropagationStyleInject(string value, string legacyValue, string fall [InlineData(null, null, null, "tracecontext", new[] { "tracecontext" })] [InlineData(null, null, null, "tracecontext,b3,b3multi", new[] { "tracecontext", "b3 single header", "b3multi" })] [InlineData(null, null, null, null, new[] { "Datadog", "tracecontext" })] + [InlineData(null, null, null, ",", new[] { "Datadog", "tracecontext" })] public void PropagationStyleExtract(string value, string legacyValue, string fallbackValue, string otelValue, string[] expected) { const string legacyKey = "DD_PROPAGATION_STYLE_EXTRACT"; @@ -832,9 +914,19 @@ public void PropagationStyleExtract(string value, string legacyValue, string fal (otelKey, otelValue), (ConfigurationKeys.FeatureFlags.OpenTelemetryEnabled, isActivityListenerEnabled ? "1" : "0")); - var settings = new TracerSettings(source); + var errorLog = new OverrideErrorLog(); + var settings = new TracerSettings(source, NullConfigurationTelemetry.Instance, errorLog); settings.PropagationStyleExtract.Should().BeEquivalentTo(expected); + + Count? metric = (value ?? legacyValue ?? fallbackValue, otelValue) switch + { + (null, ",") => Count.OpenTelemetryConfigInvalid, + (not null, not null) => Count.OpenTelemetryConfigHiddenByDatadogConfig, + _ => null, + }; + + errorLog.ShouldHaveExpectedOtelMetric(metric, ConfigurationKeys.OpenTelemetry.Propagators.ToLowerInvariant(), ConfigurationKeys.PropagationStyle.ToLowerInvariant()); } } diff --git a/tracer/test/Datadog.Trace.Tests/SpanTests.cs b/tracer/test/Datadog.Trace.Tests/SpanTests.cs index 8d212b5d931c..4668e43efee6 100644 --- a/tracer/test/Datadog.Trace.Tests/SpanTests.cs +++ b/tracer/test/Datadog.Trace.Tests/SpanTests.cs @@ -30,14 +30,11 @@ public SpanTests(ITestOutputHelper output) { _output = output; - var settings = new TracerSettings( - new NameValueConfigurationSource( - new NameValueCollection - { - { ConfigurationKeys.PeerServiceDefaultsEnabled, "true" }, - { ConfigurationKeys.PeerServiceNameMappings, "a-peer-service:a-remmaped-peer-service" } - }), - new ConfigurationTelemetry()); + var settings = TracerSettings.Create(new() + { + { ConfigurationKeys.PeerServiceDefaultsEnabled, "true" }, + { ConfigurationKeys.PeerServiceNameMappings, "a-peer-service:a-remmaped-peer-service" } + }); _writerMock = new Mock(); var samplerMock = new Mock(); diff --git a/tracer/test/Datadog.Trace.Tests/Telemetry/Collectors/ApplicationTelemetryCollectorTests.cs b/tracer/test/Datadog.Trace.Tests/Telemetry/Collectors/ApplicationTelemetryCollectorTests.cs index d86000bc0c6d..f3e81262c53c 100644 --- a/tracer/test/Datadog.Trace.Tests/Telemetry/Collectors/ApplicationTelemetryCollectorTests.cs +++ b/tracer/test/Datadog.Trace.Tests/Telemetry/Collectors/ApplicationTelemetryCollectorTests.cs @@ -5,6 +5,7 @@ using System.Collections.Specialized; using Datadog.Trace.Configuration; +using Datadog.Trace.Configuration.ConfigurationSources.Telemetry; using Datadog.Trace.Configuration.Telemetry; using Datadog.Trace.PlatformHelpers; using Datadog.Trace.Telemetry; @@ -34,7 +35,8 @@ public void ApplicationDataShouldIncludeExpectedValues() { ConfigurationKeys.GitCommitSha, "mySha" }, { ConfigurationKeys.GitRepositoryUrl, "https://github.com/gitOrg/gitRepo" }, }), - configurationTelemetry); + configurationTelemetry, + new OverrideErrorLog()); var collector = new ApplicationTelemetryCollector(); @@ -76,7 +78,8 @@ public void ApplicationWithNoGitDataShouldIncludeExpectedValues() { ConfigurationKeys.Environment, env }, { ConfigurationKeys.ServiceVersion, serviceVersion }, }), - configurationTelemetry); + configurationTelemetry, + new OverrideErrorLog()); var collector = new ApplicationTelemetryCollector(); @@ -120,7 +123,8 @@ public void HostDataShouldIncludeExpectedValues() { ConfigurationKeys.GitCommitSha, "mySha" }, { ConfigurationKeys.GitRepositoryUrl, "https://github.com/gitOrg/gitRepo" }, }), - configurationTelemetry); + configurationTelemetry, + new OverrideErrorLog()); var collector = new ApplicationTelemetryCollector(); diff --git a/tracer/test/Datadog.Trace.Tests/Telemetry/Collectors/ConfigurationTelemetryCollectorTests.cs b/tracer/test/Datadog.Trace.Tests/Telemetry/Collectors/ConfigurationTelemetryCollectorTests.cs index 35c60a493764..f59f3df0e9d6 100644 --- a/tracer/test/Datadog.Trace.Tests/Telemetry/Collectors/ConfigurationTelemetryCollectorTests.cs +++ b/tracer/test/Datadog.Trace.Tests/Telemetry/Collectors/ConfigurationTelemetryCollectorTests.cs @@ -9,6 +9,7 @@ using System.Linq; using Datadog.Trace.AppSec; using Datadog.Trace.Configuration; +using Datadog.Trace.Configuration.ConfigurationSources.Telemetry; using Datadog.Trace.Configuration.Telemetry; using Datadog.Trace.Iast.Settings; using Datadog.Trace.Telemetry; @@ -37,7 +38,8 @@ public void HasChangesAfterEachTracerSettingsAdded() var settings1 = new TracerSettings( new NameValueConfigurationSource( new NameValueCollection { { ConfigurationKeys.ServiceVersion, "1.2.3" } }), - collector); + collector, + new OverrideErrorLog()); collector.HasChanges().Should().BeTrue(); GetLatestValueFromConfig(collector.GetData(), ConfigurationKeys.ServiceVersion).Should().Be("1.2.3"); @@ -46,7 +48,8 @@ public void HasChangesAfterEachTracerSettingsAdded() var settings2 = new TracerSettings( new NameValueConfigurationSource( new NameValueCollection { { ConfigurationKeys.ServiceVersion, "2.0.0" } }), - collector); + collector, + new OverrideErrorLog()); collector.HasChanges().Should().BeTrue(); GetLatestValueFromConfig(collector.GetData(), ConfigurationKeys.ServiceVersion).Should().Be("2.0.0"); @@ -63,7 +66,8 @@ public void CopiedChangesHavePrecedence() var settings1 = new TracerSettings( new NameValueConfigurationSource( new NameValueCollection { { ConfigurationKeys.ServiceVersion, "1.2.3" } }), - secondary); + secondary, + new OverrideErrorLog()); secondary.HasChanges().Should().BeTrue(); collector.HasChanges().Should().BeFalse(); @@ -72,7 +76,8 @@ public void CopiedChangesHavePrecedence() var settings2 = new TracerSettings( new NameValueConfigurationSource( new NameValueCollection { { ConfigurationKeys.ServiceVersion, "2.0.0" } }), - collector); + collector, + new OverrideErrorLog()); collector.HasChanges().Should().BeTrue(); @@ -136,7 +141,7 @@ public void ConfigurationDataShouldIncludeAzureValues(bool isSafeToTrace) config.Add(ConfigurationKeys.ApiKey, "SomeValue"); } - var settings = new ImmutableTracerSettings(new TracerSettings(new NameValueConfigurationSource(config), collector)); + var settings = new ImmutableTracerSettings(new TracerSettings(new NameValueConfigurationSource(config), collector, new OverrideErrorLog())); var data = collector.GetData(); @@ -162,7 +167,7 @@ public void HasNoDataAfterCallingClear() { var collector = new ConfigurationTelemetry(); - _ = new TracerSettings(new NameValueConfigurationSource(new NameValueCollection { { ConfigurationKeys.ServiceVersion, "1.2.3" } }), collector); + _ = new TracerSettings(new NameValueConfigurationSource(new NameValueCollection { { ConfigurationKeys.ServiceVersion, "1.2.3" } }), collector, new OverrideErrorLog()); collector.Clear(); collector.GetData().Should().BeNull(); @@ -173,7 +178,7 @@ public void ConfigurationDataShouldMarkAsManagedOnlyWhenProfilerNotAttached() { var collector = new ConfigurationTelemetry(); - var s = new ImmutableTracerSettings(new TracerSettings(NullConfigurationSource.Instance, collector)); + var s = new ImmutableTracerSettings(new TracerSettings(NullConfigurationSource.Instance, collector, new OverrideErrorLog())); GetLatestValueFromConfig(collector.GetData(), ConfigTelemetryData.NativeTracerVersion).Should().Be("None"); } @@ -191,7 +196,7 @@ public void ConfigurationDataShouldIncludeExpectedPropagationValues(string propa { ConfigurationKeys.FeatureFlags.OpenTelemetryEnabled, activityListenerEnabled }, }; - _ = new ImmutableTracerSettings(new TracerSettings(new NameValueConfigurationSource(config), collector)); + _ = new ImmutableTracerSettings(new TracerSettings(new NameValueConfigurationSource(config), collector, new OverrideErrorLog())); var data = collector.GetData(); @@ -220,7 +225,7 @@ public void ConfigurationDataShouldReportDefaultValues() var collector = new ConfigurationTelemetry(); var source = new NameValueConfigurationSource(new NameValueCollection()); - _ = new ImmutableTracerSettings(new TracerSettings(source, collector)); + _ = new ImmutableTracerSettings(new TracerSettings(source, collector, new OverrideErrorLog())); _ = new SecuritySettings(source, collector); var data = collector.GetData(); @@ -263,7 +268,7 @@ public object BuildFullTrustConfigurationData() const string serviceName = "my-tests"; const string serviceVersion = "1.2.3"; var collector = new ConfigurationTelemetry(); - var s = new TracerSettings(NullConfigurationSource.Instance, collector) + var s = new TracerSettings(NullConfigurationSource.Instance, collector, new OverrideErrorLog()) { ServiceName = serviceName, Environment = env, diff --git a/tracer/test/Datadog.Trace.Tests/Telemetry/Collectors/MetricsTelemetryCollectorTests.cs b/tracer/test/Datadog.Trace.Tests/Telemetry/Collectors/MetricsTelemetryCollectorTests.cs index 2a1e2fb28ffb..770453f5c824 100644 --- a/tracer/test/Datadog.Trace.Tests/Telemetry/Collectors/MetricsTelemetryCollectorTests.cs +++ b/tracer/test/Datadog.Trace.Tests/Telemetry/Collectors/MetricsTelemetryCollectorTests.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using Datadog.Trace.Configuration.ConfigurationSources.Telemetry; using Datadog.Trace.Telemetry; using Datadog.Trace.Telemetry.Metrics; using FluentAssertions; @@ -86,6 +87,13 @@ public async Task AggregatesOnShutdown() [InlineData("1.2.3")] public async Task AllMetricsAreReturned_ForMetricsTelemetryCollector(string wafVersion) { + static void IncrementOpenTelemetryConfigMetrics(MetricsTelemetryCollector collector, string openTelemetryKey) + { + OpenTelemetryHelpers.GetConfigurationMetricTags(openTelemetryKey, out var openTelemetryConfig, out var datadogConfig); + collector.RecordCountOpenTelemetryConfigHiddenByDatadogConfig(datadogConfig, openTelemetryConfig); + collector.RecordCountOpenTelemetryConfigInvalid(datadogConfig, openTelemetryConfig); + } + var collector = new MetricsTelemetryCollector(Timeout.InfiniteTimeSpan); collector.Record(PublicApiUsage.Tracer_Configure); collector.Record(PublicApiUsage.Tracer_Configure); @@ -105,6 +113,17 @@ public async Task AllMetricsAreReturned_ForMetricsTelemetryCollector(string wafV collector.RecordDistributionSharedInitTime(MetricTags.InitializationComponent.Total, 46); collector.RecordDistributionSharedInitTime(MetricTags.InitializationComponent.Managed, 52); + // Record OpenTelemetry => Datadog configuration error metrics + IncrementOpenTelemetryConfigMetrics(collector, "OTEL_SERVICE_NAME"); + IncrementOpenTelemetryConfigMetrics(collector, "OTEL_LOG_LEVEL"); + IncrementOpenTelemetryConfigMetrics(collector, "OTEL_PROPAGATORS"); + IncrementOpenTelemetryConfigMetrics(collector, "OTEL_TRACES_SAMPLER"); + IncrementOpenTelemetryConfigMetrics(collector, "OTEL_TRACES_SAMPLER_ARG"); + IncrementOpenTelemetryConfigMetrics(collector, "OTEL_TRACES_EXPORTER"); + IncrementOpenTelemetryConfigMetrics(collector, "OTEL_METRICS_EXPORTER"); + IncrementOpenTelemetryConfigMetrics(collector, "OTEL_RESOURCE_ATTRIBUTES"); + IncrementOpenTelemetryConfigMetrics(collector, "OTEL_SDK_DISABLED"); + // These aren't applicable in non-ci visibility collector.RecordCountCIVisibilityITRSkipped(MetricTags.CIVisibilityTestingEventType.Test, 123); collector.RecordCountCIVisibilityEventCreated(MetricTags.CIVisibilityTestFramework.XUnit, MetricTags.CIVisibilityTestingEventTypeWithCodeOwnerAndSupportedCiAndBenchmark.Test); @@ -290,6 +309,168 @@ public async Task AllMetricsAreReturned_ForMetricsTelemetryCollector(string wafV Common = false, Namespace = (string)null, }, + new + { + Metric = Count.OpenTelemetryConfigHiddenByDatadogConfig.GetName(), + Points = new[] { new { Value = 1 } }, + Type = TelemetryMetricType.Count, + Tags = new[] { "config_opentelemetry:otel_service_name", "config_datadog:dd_service" }, + Common = true, + Namespace = "tracers", + }, + new + { + Metric = Count.OpenTelemetryConfigInvalid.GetName(), + Points = new[] { new { Value = 1 } }, + Type = TelemetryMetricType.Count, + Tags = new[] { "config_opentelemetry:otel_service_name", "config_datadog:dd_service" }, + Common = true, + Namespace = "tracers", + }, + new + { + Metric = Count.OpenTelemetryConfigHiddenByDatadogConfig.GetName(), + Points = new[] { new { Value = 1 } }, + Type = TelemetryMetricType.Count, + Tags = new[] { "config_opentelemetry:otel_log_level", "config_datadog:dd_trace_debug" }, + Common = true, + Namespace = "tracers", + }, + new + { + Metric = Count.OpenTelemetryConfigInvalid.GetName(), + Points = new[] { new { Value = 1 } }, + Type = TelemetryMetricType.Count, + Tags = new[] { "config_opentelemetry:otel_log_level", "config_datadog:dd_trace_debug" }, + Common = true, + Namespace = "tracers", + }, + new + { + Metric = Count.OpenTelemetryConfigHiddenByDatadogConfig.GetName(), + Points = new[] { new { Value = 1 } }, + Type = TelemetryMetricType.Count, + Tags = new[] { "config_opentelemetry:otel_propagators", "config_datadog:dd_trace_propagation_style" }, + Common = true, + Namespace = "tracers", + }, + new + { + Metric = Count.OpenTelemetryConfigInvalid.GetName(), + Points = new[] { new { Value = 1 } }, + Type = TelemetryMetricType.Count, + Tags = new[] { "config_opentelemetry:otel_propagators", "config_datadog:dd_trace_propagation_style" }, + Common = true, + Namespace = "tracers", + }, + new + { + Metric = Count.OpenTelemetryConfigHiddenByDatadogConfig.GetName(), + Points = new[] { new { Value = 1 } }, + Type = TelemetryMetricType.Count, + Tags = new[] { "config_opentelemetry:otel_traces_sampler", "config_datadog:dd_trace_sample_rate" }, + Common = true, + Namespace = "tracers", + }, + new + { + Metric = Count.OpenTelemetryConfigInvalid.GetName(), + Points = new[] { new { Value = 1 } }, + Type = TelemetryMetricType.Count, + Tags = new[] { "config_opentelemetry:otel_traces_sampler", "config_datadog:dd_trace_sample_rate" }, + Common = true, + Namespace = "tracers", + }, + new + { + Metric = Count.OpenTelemetryConfigHiddenByDatadogConfig.GetName(), + Points = new[] { new { Value = 1 } }, + Type = TelemetryMetricType.Count, + Tags = new[] { "config_opentelemetry:otel_traces_sampler_arg", "config_datadog:dd_trace_sample_rate" }, + Common = true, + Namespace = "tracers", + }, + new + { + Metric = Count.OpenTelemetryConfigInvalid.GetName(), + Points = new[] { new { Value = 1 } }, + Type = TelemetryMetricType.Count, + Tags = new[] { "config_opentelemetry:otel_traces_sampler_arg", "config_datadog:dd_trace_sample_rate" }, + Common = true, + Namespace = "tracers", + }, + new + { + Metric = Count.OpenTelemetryConfigHiddenByDatadogConfig.GetName(), + Points = new[] { new { Value = 1 } }, + Type = TelemetryMetricType.Count, + Tags = new[] { "config_opentelemetry:otel_traces_exporter", "config_datadog:dd_trace_enabled" }, + Common = true, + Namespace = "tracers", + }, + new + { + Metric = Count.OpenTelemetryConfigInvalid.GetName(), + Points = new[] { new { Value = 1 } }, + Type = TelemetryMetricType.Count, + Tags = new[] { "config_opentelemetry:otel_traces_exporter", "config_datadog:dd_trace_enabled" }, + Common = true, + Namespace = "tracers", + }, + new + { + Metric = Count.OpenTelemetryConfigHiddenByDatadogConfig.GetName(), + Points = new[] { new { Value = 1 } }, + Type = TelemetryMetricType.Count, + Tags = new[] { "config_opentelemetry:otel_metrics_exporter", "config_datadog:dd_runtime_metrics_enabled" }, + Common = true, + Namespace = "tracers", + }, + new + { + Metric = Count.OpenTelemetryConfigInvalid.GetName(), + Points = new[] { new { Value = 1 } }, + Type = TelemetryMetricType.Count, + Tags = new[] { "config_opentelemetry:otel_metrics_exporter", "config_datadog:dd_runtime_metrics_enabled" }, + Common = true, + Namespace = "tracers", + }, + new + { + Metric = Count.OpenTelemetryConfigHiddenByDatadogConfig.GetName(), + Points = new[] { new { Value = 1 } }, + Type = TelemetryMetricType.Count, + Tags = new[] { "config_opentelemetry:otel_resource_attributes", "config_datadog:dd_tags" }, + Common = true, + Namespace = "tracers", + }, + new + { + Metric = Count.OpenTelemetryConfigInvalid.GetName(), + Points = new[] { new { Value = 1 } }, + Type = TelemetryMetricType.Count, + Tags = new[] { "config_opentelemetry:otel_resource_attributes", "config_datadog:dd_tags" }, + Common = true, + Namespace = "tracers", + }, + new + { + Metric = Count.OpenTelemetryConfigHiddenByDatadogConfig.GetName(), + Points = new[] { new { Value = 1 } }, + Type = TelemetryMetricType.Count, + Tags = new[] { "config_opentelemetry:otel_sdk_disabled", "config_datadog:dd_trace_otel_enabled" }, + Common = true, + Namespace = "tracers", + }, + new + { + Metric = Count.OpenTelemetryConfigInvalid.GetName(), + Points = new[] { new { Value = 1 } }, + Type = TelemetryMetricType.Count, + Tags = new[] { "config_opentelemetry:otel_sdk_disabled", "config_datadog:dd_trace_otel_enabled" }, + Common = true, + Namespace = "tracers", + }, }); metrics.Distributions.Should().BeEquivalentTo(new[] diff --git a/tracer/test/Datadog.Trace.Tests/Telemetry/Metrics/common_metrics.json b/tracer/test/Datadog.Trace.Tests/Telemetry/Metrics/common_metrics.json index d4636155d516..30c36c15b2f4 100644 --- a/tracer/test/Datadog.Trace.Tests/Telemetry/Metrics/common_metrics.json +++ b/tracer/test/Datadog.Trace.Tests/Telemetry/Metrics/common_metrics.json @@ -37,6 +37,38 @@ "send_to_user": false, "user_tags": [] }, + "otel.env.hiding": { + "tags": [ + "config_datadog", + "config_opentelemetry" + ], + "metric_type": "count", + "data_type": "configuration keys", + "description": "The number of Opentelemetry configuration keys, configured and supported, but overridden by its counterpart Datadog Configuration key, tagged by Datadog configuration key and Opentelemetry configuration key", + "send_to_user": false, + "user_tags": [] + }, + "otel.env.invalid": { + "tags": [ + "config_datadog", + "config_opentelemetry" + ], + "metric_type": "count", + "data_type": "configuration keys", + "description": "The number of configured supported Opentelemetry configuration keys that we fail to map its value to the Datadog form, tagged by Datadog configuration key and Opentelemetry configuration key", + "send_to_user": false, + "user_tags": [] + }, + "otel.env.unsupported": { + "tags": [ + "config_opentelemetry" + ], + "metric_type": "count", + "data_type": "configuration keys", + "description": "The number of unsupported (not having a mapping with any Datadog configuration key) configured Opentelemetry Configuration keys, tagged by Opentelemetry configuration key", + "send_to_user": false, + "user_tags": [] + }, "spans_created": { "tags": [ "integration_name" @@ -314,28 +346,100 @@ "send_to_user": false, "user_tags": [] }, + "inject.success": { + "tags": [ + "language", + "version", + "injector_version", + "platform", + "injecter_version" + ], + "metric_type": "count", + "data_type": "requests", + "description": "Number of successful injections of APM libraries", + "send_to_user": false, + "user_tags": [] + }, + "inject.skip": { + "tags": [ + "language", + "version", + "injector_version", + "injecter_version", + "platform", + "reason" + ], + "metric_type": "count", + "data_type": "requests", + "description": "Number of skipped injections of APM libraries", + "send_to_user": false, + "user_tags": [] + }, + "inject.error": { + "tags": [ + "language", + "version", + "injector_version", + "injecter_version", + "platform", + "reason" + ], + "metric_type": "count", + "data_type": "requests", + "description": "Number of erroneous injections of APM libraries", + "send_to_user": false, + "user_tags": [] + }, "host_lib_injection.success": { "tags": [ "language", "version", + "injector_version", "injecter_version" ], "metric_type": "count", "data_type": "requests", "description": "Number of successful host lib injection", - "send_to_user": true, + "send_to_user": false, "user_tags": [] }, "host_lib_injection.failure": { "tags": [ "language", "version", + "injector_version", "injecter_version" ], "metric_type": "count", "data_type": "requests", "description": "Number of failed host lib injection", - "send_to_user": true, + "send_to_user": false, + "user_tags": [] + }, + "k8s_lib_injection.success": { + "tags": [ + "language", + "version", + "injector_version", + "injecter_version" + ], + "metric_type": "count", + "data_type": "requests", + "description": "Number of successful k8s lib injection", + "send_to_user": false, + "user_tags": [] + }, + "k8s_lib_injection.failure": { + "tags": [ + "language", + "version", + "injector_version", + "injecter_version" + ], + "metric_type": "count", + "data_type": "requests", + "description": "Number of failed host k8s injection", + "send_to_user": false, "user_tags": [] }, "docker_lib_injection.success": { @@ -346,7 +450,7 @@ "metric_type": "count", "data_type": "requests", "description": "Number of successful docker lib injection", - "send_to_user": true, + "send_to_user": false, "user_tags": [] }, "docker_lib_injection.failure": { @@ -357,7 +461,7 @@ "metric_type": "count", "data_type": "requests", "description": "Number of failed docker lib injection", - "send_to_user": true, + "send_to_user": false, "user_tags": [] }, "library_entrypoint.abort": { @@ -369,7 +473,7 @@ "metric_type": "count", "data_type": "requests", "description": "Number of injections aborted at library entrypoint due to checks not passing", - "send_to_user": true, + "send_to_user": false, "user_tags": [] }, "library_entrypoint.abort.runtime": { @@ -380,7 +484,7 @@ "metric_type": "count", "data_type": "requests", "description": "Number of injections aborted at library entrypoint due to runtime version not supported", - "send_to_user": true, + "send_to_user": false, "user_tags": [] }, "library_entrypoint.abort.integration": { @@ -393,7 +497,7 @@ "metric_type": "count", "data_type": "requests", "description": "Number of injections aborted at library entrypoint due to integration version not supported", - "send_to_user": true, + "send_to_user": false, "user_tags": [] }, "library_entrypoint.error": { @@ -407,7 +511,7 @@ "metric_type": "count", "data_type": "requests", "description": "Number of injections aborted at library entrypoint due to an error", - "send_to_user": true, + "send_to_user": false, "user_tags": [] }, "library_entrypoint.complete": { @@ -419,7 +523,7 @@ "metric_type": "count", "data_type": "requests", "description": "Number of successful library entrypoint injections", - "send_to_user": true, + "send_to_user": false, "user_tags": [] }, "entry.process.running.1s": { @@ -430,7 +534,7 @@ "metric_type": "count", "data_type": "requests", "description": "Number of injections that are still running after 1s", - "send_to_user": true, + "send_to_user": false, "user_tags": [] }, "entry.process.running.5s": { @@ -441,7 +545,7 @@ "metric_type": "count", "data_type": "requests", "description": "Number of injections that are still running after 5s", - "send_to_user": true, + "send_to_user": false, "user_tags": [] }, "entry.process.running.10s": { @@ -452,7 +556,7 @@ "metric_type": "count", "data_type": "requests", "description": "Number of injections that are still running after 10s", - "send_to_user": true, + "send_to_user": false, "user_tags": [] }, "exporter_fallback": { diff --git a/tracer/test/Datadog.Trace.Tests/Telemetry/TelemetryFactoryTests.cs b/tracer/test/Datadog.Trace.Tests/Telemetry/TelemetryFactoryTests.cs index 53aafa8130c4..f6d30f562720 100644 --- a/tracer/test/Datadog.Trace.Tests/Telemetry/TelemetryFactoryTests.cs +++ b/tracer/test/Datadog.Trace.Tests/Telemetry/TelemetryFactoryTests.cs @@ -8,6 +8,7 @@ using Datadog.Trace.Agent.DiscoveryService; using Datadog.Trace.ClrProfiler; using Datadog.Trace.Configuration; +using Datadog.Trace.Configuration.ConfigurationSources.Telemetry; using Datadog.Trace.Configuration.Telemetry; using Datadog.Trace.Telemetry; using Datadog.Trace.TestHelpers; @@ -27,7 +28,7 @@ public class TelemetryFactoryTests public void TelemetryFactory_DisabledIfTelemetryIsDisabled() { var factory = TelemetryFactory.CreateFactory(); - var tracerSettings = new ImmutableTracerSettings(new TracerSettings(NullConfigurationSource.Instance, NullConfigurationTelemetry.Instance)); + var tracerSettings = new ImmutableTracerSettings(new TracerSettings(NullConfigurationSource.Instance, NullConfigurationTelemetry.Instance, new OverrideErrorLog())); var settings = new TelemetrySettings( telemetryEnabled: false, // explicitly disabled configurationError: null, @@ -47,7 +48,7 @@ public void TelemetryFactory_DisabledIfTelemetryIsDisabled() public void TelemetryFactory_DisabledIfNoTransports() { var factory = TelemetryFactory.CreateFactory(); - var tracerSettings = new ImmutableTracerSettings(new TracerSettings(NullConfigurationSource.Instance, NullConfigurationTelemetry.Instance)); + var tracerSettings = new ImmutableTracerSettings(new TracerSettings(NullConfigurationSource.Instance, NullConfigurationTelemetry.Instance, new OverrideErrorLog())); var settings = new TelemetrySettings( telemetryEnabled: true, configurationError: null, @@ -71,7 +72,7 @@ public void TelemetryFactory_UsesV2ControllerIfV2Enabled() TelemetryFactory.SetMetricsForTesting(new MetricsTelemetryCollector()); var factory = TelemetryFactory.CreateFactory(); - var tracerSettings = new ImmutableTracerSettings(new TracerSettings(NullConfigurationSource.Instance, NullConfigurationTelemetry.Instance)); + var tracerSettings = new ImmutableTracerSettings(new TracerSettings(NullConfigurationSource.Instance, NullConfigurationTelemetry.Instance, new OverrideErrorLog())); var settings = new TelemetrySettings( telemetryEnabled: true, configurationError: null, @@ -96,7 +97,7 @@ public void TelemetryFactory_V2Telemetry_DisablesMetricsIfMetricsDisabled() TelemetryFactory.SetMetricsForTesting(new MetricsTelemetryCollector()); var factory = TelemetryFactory.CreateFactory(); - var tracerSettings = new ImmutableTracerSettings(new TracerSettings(NullConfigurationSource.Instance, NullConfigurationTelemetry.Instance)); + var tracerSettings = new ImmutableTracerSettings(new TracerSettings(NullConfigurationSource.Instance, NullConfigurationTelemetry.Instance, new OverrideErrorLog())); var settings = new TelemetrySettings( telemetryEnabled: true, configurationError: null, @@ -121,7 +122,7 @@ public void TelemetryFactory_V2Telemetry_EnablesMetricsIfMetricsEnabled() TelemetryFactory.SetMetricsForTesting(metricsTelemetryCollector); var factory = TelemetryFactory.CreateFactory(); - var tracerSettings = new ImmutableTracerSettings(new TracerSettings(NullConfigurationSource.Instance, NullConfigurationTelemetry.Instance)); + var tracerSettings = new ImmutableTracerSettings(new TracerSettings(NullConfigurationSource.Instance, NullConfigurationTelemetry.Instance, new OverrideErrorLog())); var settings = new TelemetrySettings( telemetryEnabled: true, configurationError: null, @@ -146,7 +147,7 @@ public void TelemetryFactory_V2Telemetry_UsesCiVisibilityMetricsCollectorIfReque TelemetryFactory.SetMetricsForTesting(metricsTelemetryCollector); var factory = TelemetryFactory.CreateFactory(); - var tracerSettings = new ImmutableTracerSettings(new TracerSettings(NullConfigurationSource.Instance, NullConfigurationTelemetry.Instance)); + var tracerSettings = new ImmutableTracerSettings(new TracerSettings(NullConfigurationSource.Instance, NullConfigurationTelemetry.Instance, new OverrideErrorLog())); var settings = new TelemetrySettings( telemetryEnabled: true, configurationError: null, @@ -175,7 +176,7 @@ public void TelemetryFactory_V2Telemetry_ControllerAndCollectorsPersistWhenNewCo TelemetryFactory.SetMetricsForTesting(new MetricsTelemetryCollector()); var factory = TelemetryFactory.CreateFactory(); - var tracerSettings = new ImmutableTracerSettings(new TracerSettings(NullConfigurationSource.Instance, NullConfigurationTelemetry.Instance)); + var tracerSettings = new ImmutableTracerSettings(new TracerSettings(NullConfigurationSource.Instance, NullConfigurationTelemetry.Instance, new OverrideErrorLog())); var settings = new TelemetrySettings( telemetryEnabled: true, configurationError: null,