Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,7 @@
<type fullname="System.Func`5" />
<type fullname="System.Func`6" />
<type fullname="System.GC" />
<type fullname="System.GCGenerationInfo" />
<type fullname="System.GCMemoryInfo" />
<type fullname="System.Globalization.CultureInfo" />
<type fullname="System.Globalization.DateTimeStyles" />
Expand Down
19 changes: 19 additions & 0 deletions tracer/src/Datadog.Trace/Configuration/TracerSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,16 @@ not null when string.Equals(value, "otlp", StringComparison.OrdinalIgnoreCase) =

RuntimeMetricsEnabled = runtimeMetricsEnabledResult.WithDefault(false);

RuntimeMetricsDiagnosticsMetricsApiEnabled = config.WithKeys(ConfigurationKeys.RuntimeMetricsDiagnosticsMetricsApiEnabled).AsBool(false);

#if !NET6_0_OR_GREATER
if (RuntimeMetricsEnabled && RuntimeMetricsDiagnosticsMetricsApiEnabled)
{
Log.Warning(
$"{ConfigurationKeys.RuntimeMetricsDiagnosticsMetricsApiEnabled} was enabled, but System.Diagnostics.Metrics is only available on .NET 6+. Using standard runtime metrics collector.");
telemetry.Record(ConfigurationKeys.RuntimeMetricsDiagnosticsMetricsApiEnabled, false, ConfigurationOrigins.Calculated);
}
#endif
OtelMetricExportIntervalMs = config
.WithKeys(ConfigurationKeys.OpenTelemetry.MetricExportIntervalMs)
.AsInt32(defaultValue: 10_000);
Expand Down Expand Up @@ -1053,6 +1063,15 @@ not null when string.Equals(value, "otlp", StringComparison.OrdinalIgnoreCase) =
/// </summary>
internal bool RuntimeMetricsEnabled { get; }

/// <summary>
/// Gets a value indicating whether the experimental runtime metrics collector which uses the
/// <a href="https://learn.microsoft.com/en-us/dotnet/core/diagnostics/metrics">System.Diagnostics.Metrics</a> API.
/// This collector can only be enabled when using .NET 6+, and will only include ASP.NET Core metrics
/// when using .NET 8+.
/// </summary>
/// <seealso cref="ConfigurationKeys.RuntimeMetricsDiagnosticsMetricsApiEnabled"/>
internal bool RuntimeMetricsDiagnosticsMetricsApiEnabled { get; }

/// <summary>
/// Gets a value indicating whether libdatadog data pipeline
/// is enabled.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,13 @@ DD_RUNTIME_METRICS_ENABLED: |
Configuration key for enabling or disabling runtime metrics sent to DogStatsD.
Default value is <c>false</c> (disabled).

DD_RUNTIME_METRICS_DIAGNOSTICS_METRICS_API_ENABLED: |
Enables an experimental runtime metrics collector which uses the
<a href="https://learn.microsoft.com/en-us/dotnet/core/diagnostics/metrics">System.Diagnostics.Metrics</a> API.
This collector can only be enabled when using .NET 6+, and will only include ASP.NET Core metrics
when using .NET 8+.
Default value is <c>false</c> (disabled).

DD_SERVICE: |
Configuration key for the application's default service name.
Used as the service name for top-level spans,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,11 @@
"A"
]
},
"DD_RUNTIME_METRICS_DIAGNOSTICS_METRICS_API_ENABLED": {
"version": [
"A"
]
},
"DD_SERVICE": {
"version": [
"A"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,15 @@ internal static partial class ConfigurationKeys
[System.Obsolete("This parameter is obsolete and should be replaced by `DD_TRACE_RATE_LIMIT`")]
public const string MaxTracesSubmittedPerSecond = "DD_MAX_TRACES_PER_SECOND";

/// <summary>
/// Enables an experimental runtime metrics collector which uses the
/// <a href="https://learn.microsoft.com/en-us/dotnet/core/diagnostics/metrics">System.Diagnostics.Metrics</a> API.
/// This collector can only be enabled when using .NET 6+, and will only include ASP.NET Core metrics
/// when using .NET 8+.
/// Default value is <c>false</c> (disabled).
/// </summary>
public const string RuntimeMetricsDiagnosticsMetricsApiEnabled = "DD_RUNTIME_METRICS_DIAGNOSTICS_METRICS_API_ENABLED";

/// <summary>
/// Configuration key for enabling or disabling runtime metrics sent to DogStatsD.
/// Default value is <c>false</c> (disabled).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,15 @@ internal static partial class ConfigurationKeys
[System.Obsolete("This parameter is obsolete and should be replaced by `DD_TRACE_RATE_LIMIT`")]
public const string MaxTracesSubmittedPerSecond = "DD_MAX_TRACES_PER_SECOND";

/// <summary>
/// Enables an experimental runtime metrics collector which uses the
/// <a href="https://learn.microsoft.com/en-us/dotnet/core/diagnostics/metrics">System.Diagnostics.Metrics</a> API.
/// This collector can only be enabled when using .NET 6+, and will only include ASP.NET Core metrics
/// when using .NET 8+.
/// Default value is <c>false</c> (disabled).
/// </summary>
public const string RuntimeMetricsDiagnosticsMetricsApiEnabled = "DD_RUNTIME_METRICS_DIAGNOSTICS_METRICS_API_ENABLED";

/// <summary>
/// Configuration key for enabling or disabling runtime metrics sent to DogStatsD.
/// Default value is <c>false</c> (disabled).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,15 @@ internal static partial class ConfigurationKeys
[System.Obsolete("This parameter is obsolete and should be replaced by `DD_TRACE_RATE_LIMIT`")]
public const string MaxTracesSubmittedPerSecond = "DD_MAX_TRACES_PER_SECOND";

/// <summary>
/// Enables an experimental runtime metrics collector which uses the
/// <a href="https://learn.microsoft.com/en-us/dotnet/core/diagnostics/metrics">System.Diagnostics.Metrics</a> API.
/// This collector can only be enabled when using .NET 6+, and will only include ASP.NET Core metrics
/// when using .NET 8+.
/// Default value is <c>false</c> (disabled).
/// </summary>
public const string RuntimeMetricsDiagnosticsMetricsApiEnabled = "DD_RUNTIME_METRICS_DIAGNOSTICS_METRICS_API_ENABLED";

/// <summary>
/// Configuration key for enabling or disabling runtime metrics sent to DogStatsD.
/// Default value is <c>false</c> (disabled).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,15 @@ internal static partial class ConfigurationKeys
[System.Obsolete("This parameter is obsolete and should be replaced by `DD_TRACE_RATE_LIMIT`")]
public const string MaxTracesSubmittedPerSecond = "DD_MAX_TRACES_PER_SECOND";

/// <summary>
/// Enables an experimental runtime metrics collector which uses the
/// <a href="https://learn.microsoft.com/en-us/dotnet/core/diagnostics/metrics">System.Diagnostics.Metrics</a> API.
/// This collector can only be enabled when using .NET 6+, and will only include ASP.NET Core metrics
/// when using .NET 8+.
/// Default value is <c>false</c> (disabled).
/// </summary>
public const string RuntimeMetricsDiagnosticsMetricsApiEnabled = "DD_RUNTIME_METRICS_DIAGNOSTICS_METRICS_API_ENABLED";

/// <summary>
/// Configuration key for enabling or disabling runtime metrics sent to DogStatsD.
/// Default value is <c>false</c> (disabled).
Expand Down
Loading
Loading