Skip to content

Commit 179c79d

Browse files
committed
Split configuration keys in platform keys
1 parent f819c41 commit 179c79d

9 files changed

+127
-101
lines changed

tracer/missing-nullability-files.csv

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ src/Datadog.Trace/Configuration/ConfigurationKeys.AzureAppService.cs
8484
src/Datadog.Trace/Configuration/ConfigurationKeys.Debugger.cs
8585
src/Datadog.Trace/Configuration/ConfigurationKeys.DirectLogSubmission.cs
8686
src/Datadog.Trace/Configuration/ConfigurationKeys.Exporter.cs
87-
src/Datadog.Trace/Configuration/ConfigurationKeys.GCPFunction.cs
8887
src/Datadog.Trace/Configuration/ConfigurationKeys.Iast.cs
8988
src/Datadog.Trace/Configuration/ConfigurationKeys.Logging.cs
9089
src/Datadog.Trace/Configuration/ConfigurationKeys.Rcm.cs

tracer/src/Datadog.Trace/Configuration/ConfigurationKeys.AzureAppService.cs

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -21,38 +21,6 @@ internal class AzureAppService
2121
/// </summary>
2222
internal const string SiteExtensionVersionKey = "DD_AAS_DOTNET_EXTENSION_VERSION";
2323

24-
/// <summary>
25-
/// Example: 8c500027-5f00-400e-8f00-60000000000f+apm-dotnet-EastUSwebspace
26-
/// Format: {subscriptionId}+{planResourceGroup}-{hostedInRegion}
27-
/// </summary>
28-
internal const string WebsiteOwnerNameKey = "WEBSITE_OWNER_NAME";
29-
30-
/// <summary>
31-
/// This is the name of the resource group the site instance is assigned to.
32-
/// </summary>
33-
internal const string ResourceGroupKey = "WEBSITE_RESOURCE_GROUP";
34-
35-
/// <summary>
36-
/// This is the unique name of the website instance within Azure App Services.
37-
/// Its presence is used to determine if we are running in Azure App Services.
38-
/// </summary>
39-
internal const string SiteNameKey = "WEBSITE_SITE_NAME";
40-
41-
/// <summary>
42-
/// The instance name in Azure where the traced application is running.
43-
/// </summary>
44-
internal const string InstanceNameKey = "COMPUTERNAME";
45-
46-
/// <summary>
47-
/// The instance ID in Azure where the traced application is running.
48-
/// </summary>
49-
internal const string InstanceIdKey = "WEBSITE_INSTANCE_ID";
50-
51-
/// <summary>
52-
/// The operating system in Azure where the traced application is running.
53-
/// </summary>
54-
internal const string OperatingSystemKey = "WEBSITE_OS";
55-
5624
/// <summary>
5725
/// Used to force the loader to start the trace agent (in case automatic instrumentation is disabled)
5826
/// </summary>
@@ -62,12 +30,6 @@ internal class AzureAppService
6230
/// Used to force the loader to start dogstatsd (in case automatic instrumentation is disabled)
6331
/// </summary>
6432
public const string AasEnableCustomMetrics = "DD_AAS_ENABLE_CUSTOM_METRICS";
65-
66-
/// <summary>
67-
/// Used to identify consumption plan functions. Consumption plans will either not have this variable,
68-
/// or will have a value of "dynamic".
69-
/// </summary>
70-
public const string WebsiteSKU = "WEBSITE_SKU";
7133
}
7234
}
7335
}

tracer/src/Datadog.Trace/Configuration/ConfigurationKeys.GCPFunction.cs

Lines changed: 0 additions & 36 deletions
This file was deleted.

tracer/src/Datadog.Trace/Configuration/ConfigurationKeys.cs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -762,29 +762,6 @@ public static class Proxy
762762
public const string ProxyNoProxy = "DD_PROXY_NO_PROXY";
763763
}
764764

765-
/// <summary>
766-
/// String format patterns used to match integration-specific configuration keys.
767-
/// </summary>
768-
public static class Integrations
769-
{
770-
/// <summary>
771-
/// Configuration key pattern for enabling or disabling an integration.
772-
/// </summary>
773-
public const string Enabled = "DD_TRACE_{0}_ENABLED";
774-
775-
/// <summary>
776-
/// Configuration key pattern for enabling or disabling Analytics in an integration.
777-
/// </summary>
778-
[Obsolete(DeprecationMessages.AppAnalytics)]
779-
public const string AnalyticsEnabled = "DD_TRACE_{0}_ANALYTICS_ENABLED";
780-
781-
/// <summary>
782-
/// Configuration key pattern for setting Analytics sampling rate in an integration.
783-
/// </summary>
784-
[Obsolete(DeprecationMessages.AppAnalytics)]
785-
public const string AnalyticsSampleRate = "DD_TRACE_{0}_ANALYTICS_SAMPLE_RATE";
786-
}
787-
788765
/// <summary>
789766
/// String constants for debug configuration keys.
790767
/// </summary>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// <copyright file="PlatformKeys.Aws.cs" company="Datadog">
2+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License.
3+
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
4+
// </copyright>
5+
#nullable enable
6+
namespace Datadog.Trace.Configuration;
7+
8+
internal static partial class PlatformKeys
9+
{
10+
internal static class Aws
11+
{
12+
public const string FunctionName = "AWS_LAMBDA_FUNCTION_NAME";
13+
}
14+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// <copyright file="PlatformKeys.AzureAppService.cs" company="Datadog">
2+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License.
3+
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
4+
// </copyright>
5+
#nullable enable
6+
namespace Datadog.Trace.Configuration;
7+
8+
internal static partial class PlatformKeys
9+
{
10+
internal static class AzureAppService
11+
{
12+
/// <summary>
13+
/// Example: 8c500027-5f00-400e-8f00-60000000000f+apm-dotnet-EastUSwebspace
14+
/// Format: {subscriptionId}+{planResourceGroup}-{hostedInRegion}
15+
/// </summary>
16+
internal const string WebsiteOwnerNameKey = "WEBSITE_OWNER_NAME";
17+
18+
/// <summary>
19+
/// This is the name of the resource group the site instance is assigned to.
20+
/// </summary>
21+
internal const string ResourceGroupKey = "WEBSITE_RESOURCE_GROUP";
22+
23+
/// <summary>
24+
/// This is the unique name of the website instance within Azure App Services.
25+
/// Its presence is used to determine if we are running in Azure App Services.
26+
/// </summary>
27+
internal const string SiteNameKey = "WEBSITE_SITE_NAME";
28+
29+
/// <summary>
30+
/// This is the key for AzureAppServicePerformanceCounters
31+
/// </summary>
32+
internal const string CountersKey = "WEBSITE_COUNTERS_CLR";
33+
34+
/// <summary>
35+
/// The instance name in Azure where the traced application is running.
36+
/// </summary>
37+
internal const string InstanceNameKey = "COMPUTERNAME";
38+
39+
/// <summary>
40+
/// The instance ID in Azure where the traced application is running.
41+
/// </summary>
42+
internal const string InstanceIdKey = "WEBSITE_INSTANCE_ID";
43+
44+
/// <summary>
45+
/// The operating system in Azure where the traced application is running.
46+
/// </summary>
47+
internal const string OperatingSystemKey = "WEBSITE_OS";
48+
49+
/// <summary>
50+
/// Used to identify consumption plan functions. Consumption plans will either not have this variable,
51+
/// or will have a value of "dynamic".
52+
/// </summary>
53+
public const string WebsiteSku = "WEBSITE_SKU";
54+
}
55+
}

tracer/src/Datadog.Trace/Configuration/ConfigurationKeys.AzureFunctions.cs renamed to tracer/src/Datadog.Trace/Configuration/PlatformKeys.AzureFunctions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <copyright file="ConfigurationKeys.AzureFunctions.cs" company="Datadog">
1+
// <copyright file="PlatformKeys.AzureFunctions.cs" company="Datadog">
22
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License.
33
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
44
// </copyright>
@@ -7,12 +7,12 @@
77

88
namespace Datadog.Trace.Configuration;
99

10-
internal partial class ConfigurationKeys
10+
internal static partial class PlatformKeys
1111
{
1212
/// <summary>
1313
/// Reference: https://learn.microsoft.com/en-us/azure/azure-functions/functions-app-settings
1414
/// </summary>
15-
internal class AzureFunctions
15+
internal static class AzureFunctions
1616
{
1717
/// <summary>
1818
/// The version of the Azure Functions runtime, e.g. "~1" or "~4".
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// <copyright file="PlatformKeys.DotNet.cs" company="Datadog">
2+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License.
3+
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
4+
// </copyright>
5+
6+
#nullable enable
7+
8+
namespace Datadog.Trace.Configuration;
9+
10+
internal static partial class PlatformKeys
11+
{
12+
/// <summary>
13+
/// Platform key indicating the path to the .NET Core CLR profiler path
14+
/// </summary>
15+
public const string DotNetCoreClrProfiler = "CORECLR_PROFILER_PATH";
16+
17+
/// <summary>
18+
/// Platform key indicating the path to the .NET Framework CLR profiler path
19+
/// </summary>
20+
public const string DotNetClrProfiler = "COR_PROFILER_PATH";
21+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// <copyright file="PlatformKeys.GcpFunction.cs" company="Datadog">
2+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License.
3+
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
4+
// </copyright>
5+
#nullable enable
6+
namespace Datadog.Trace.Configuration;
7+
8+
internal static partial class PlatformKeys
9+
{
10+
internal static class GcpFunction
11+
{
12+
/// <summary>
13+
/// The name of functions running deprecated runtimes.
14+
/// </summary>
15+
internal const string DeprecatedFunctionNameKey = "FUNCTION_NAME";
16+
17+
/// <summary>
18+
/// The name of the gcp project a deprecated function belongs to. Only set in functions running deprecated runtimes.
19+
/// Used to tell whether or not we are in a deprecated function environment.
20+
/// </summary>
21+
internal const string DeprecatedProjectKey = "GCP_PROJECT";
22+
23+
/// <summary>
24+
/// The name of functions running non-deprecated runtimes.
25+
/// </summary>
26+
internal const string FunctionNameKey = "K_SERVICE";
27+
28+
/// <summary>
29+
/// The name of the function handler to be executed when the function is invoked. Only set in functions running non-deprecated runtimes.
30+
/// Used to tell whether or not we are in a non-deprecated function environment.
31+
/// </summary>
32+
internal const string FunctionTargetKey = "FUNCTION_TARGET";
33+
}
34+
}

0 commit comments

Comments
 (0)