@@ -286,7 +286,6 @@ public static String getHostName() {
286
286
private final boolean appSecStackTraceEnabled ;
287
287
private final int appSecMaxStackTraces ;
288
288
private final int appSecMaxStackTraceDepth ;
289
- private final boolean appSecStandaloneEnabled ;
290
289
private final boolean apiSecurityEnabled ;
291
290
private final float apiSecurityRequestSampleRate ;
292
291
@@ -1292,7 +1291,6 @@ PROFILING_DATADOG_PROFILER_ENABLED, isDatadogProfilerSafeInCurrentEnvironment())
1292
1291
configProvider .getStringNotEmpty (APPSEC_AUTO_USER_INSTRUMENTATION_MODE , null ),
1293
1292
configProvider .getStringNotEmpty (APPSEC_AUTOMATED_USER_EVENTS_TRACKING , null ));
1294
1293
appSecScaEnabled = configProvider .getBoolean (APPSEC_SCA_ENABLED );
1295
- appSecStandaloneEnabled = configProvider .getBoolean (APPSEC_STANDALONE_ENABLED , false );
1296
1294
appSecRaspEnabled = configProvider .getBoolean (APPSEC_RASP_ENABLED , DEFAULT_APPSEC_RASP_ENABLED );
1297
1295
appSecStackTraceEnabled =
1298
1296
configProvider .getBoolean (
@@ -3408,7 +3406,7 @@ public String getDataJobsCommandPattern() {
3408
3406
}
3409
3407
3410
3408
public boolean isApmTracingEnabled () {
3411
- return ! appSecStandaloneEnabled && apmTracingEnabled ;
3409
+ return apmTracingEnabled ;
3412
3410
}
3413
3411
3414
3412
/** @return A map of tags to be applied only to the local application root span. */
@@ -3601,97 +3599,6 @@ private Map<String, Long> getProcessIdTag() {
3601
3599
return Collections .singletonMap (PID_TAG , getProcessId ());
3602
3600
}
3603
3601
3604
- private Map <String , String > getAzureAppServicesTags () {
3605
- // These variable names and derivations are copied from the dotnet tracer
3606
- // See
3607
- // https://github.com/DataDog/dd-trace-dotnet/blob/master/tracer/src/Datadog.Trace/PlatformHelpers/AzureAppServices.cs
3608
- // and
3609
- // https://github.com/DataDog/dd-trace-dotnet/blob/master/tracer/src/Datadog.Trace/TraceContext.cs#L207
3610
- Map <String , String > aasTags = new HashMap <>();
3611
-
3612
- /// The site name of the site instance in Azure where the traced application is running.
3613
- String siteName = getEnv ("WEBSITE_SITE_NAME" );
3614
- if (siteName != null ) {
3615
- aasTags .put ("aas.site.name" , siteName );
3616
- }
3617
-
3618
- // The kind of application instance running in Azure.
3619
- // Possible values: app, api, mobileapp, app_linux, app_linux_container, functionapp,
3620
- // functionapp_linux, functionapp_linux_container
3621
-
3622
- // The type of application instance running in Azure.
3623
- // Possible values: app, function
3624
- if (getEnv ("FUNCTIONS_WORKER_RUNTIME" ) != null
3625
- || getEnv ("FUNCTIONS_EXTENSIONS_VERSION" ) != null ) {
3626
- aasTags .put ("aas.site.kind" , "functionapp" );
3627
- aasTags .put ("aas.site.type" , "function" );
3628
- } else {
3629
- aasTags .put ("aas.site.kind" , "app" );
3630
- aasTags .put ("aas.site.type" , "app" );
3631
- }
3632
-
3633
- // The resource group of the site instance in Azure App Services
3634
- String resourceGroup = getEnv ("WEBSITE_RESOURCE_GROUP" );
3635
- if (resourceGroup != null ) {
3636
- aasTags .put ("aas.resource.group" , resourceGroup );
3637
- }
3638
-
3639
- // Example: 8c500027-5f00-400e-8f00-60000000000f+apm-dotnet-EastUSwebspace
3640
- // Format: {subscriptionId}+{planResourceGroup}-{hostedInRegion}
3641
- String websiteOwner = getEnv ("WEBSITE_OWNER_NAME" );
3642
- int plusIndex = websiteOwner == null ? -1 : websiteOwner .indexOf ("+" );
3643
-
3644
- // The subscription ID of the site instance in Azure App Services
3645
- String subscriptionId = null ;
3646
- if (plusIndex > 0 ) {
3647
- subscriptionId = websiteOwner .substring (0 , plusIndex );
3648
- aasTags .put ("aas.subscription.id" , subscriptionId );
3649
- }
3650
-
3651
- if (subscriptionId != null && siteName != null && resourceGroup != null ) {
3652
- // The resource ID of the site instance in Azure App Services
3653
- String resourceId =
3654
- "/subscriptions/"
3655
- + subscriptionId
3656
- + "/resourcegroups/"
3657
- + resourceGroup
3658
- + "/providers/microsoft.web/sites/"
3659
- + siteName ;
3660
- resourceId = resourceId .toLowerCase (Locale .ROOT );
3661
- aasTags .put ("aas.resource.id" , resourceId );
3662
- } else {
3663
- log .warn (
3664
- "Unable to generate resource id subscription id: {}, site name: {}, resource group {}" ,
3665
- subscriptionId ,
3666
- siteName ,
3667
- resourceGroup );
3668
- }
3669
-
3670
- // The instance ID in Azure
3671
- String instanceId = getEnv ("WEBSITE_INSTANCE_ID" );
3672
- instanceId = instanceId == null ? "unknown" : instanceId ;
3673
- aasTags .put ("aas.environment.instance_id" , instanceId );
3674
-
3675
- // The instance name in Azure
3676
- String instanceName = getEnv ("COMPUTERNAME" );
3677
- instanceName = instanceName == null ? "unknown" : instanceName ;
3678
- aasTags .put ("aas.environment.instance_name" , instanceName );
3679
-
3680
- // The operating system in Azure
3681
- String operatingSystem = getEnv ("WEBSITE_OS" );
3682
- operatingSystem = operatingSystem == null ? "unknown" : operatingSystem ;
3683
- aasTags .put ("aas.environment.os" , operatingSystem );
3684
-
3685
- // The version of the extension installed
3686
- String siteExtensionVersion = getEnv ("DD_AAS_JAVA_EXTENSION_VERSION" );
3687
- siteExtensionVersion = siteExtensionVersion == null ? "unknown" : siteExtensionVersion ;
3688
- aasTags .put ("aas.environment.extension_version" , siteExtensionVersion );
3689
-
3690
- aasTags .put ("aas.environment.runtime" , getProp ("java.vm.name" , "unknown" ));
3691
-
3692
- return aasTags ;
3693
- }
3694
-
3695
3602
private int schemaVersionFromConfig () {
3696
3603
String versionStr =
3697
3604
configProvider .getString (TRACE_SPAN_ATTRIBUTE_SCHEMA , "v" + SpanNaming .SCHEMA_MIN_VERSION );
@@ -3913,6 +3820,97 @@ public boolean isTelemetryDebugRequestsEnabled() {
3913
3820
return telemetryDebugRequestsEnabled ;
3914
3821
}
3915
3822
3823
+ private Map <String , String > getAzureAppServicesTags () {
3824
+ // These variable names and derivations are copied from the dotnet tracer
3825
+ // See
3826
+ // https://github.com/DataDog/dd-trace-dotnet/blob/master/tracer/src/Datadog.Trace/PlatformHelpers/AzureAppServices.cs
3827
+ // and
3828
+ // https://github.com/DataDog/dd-trace-dotnet/blob/master/tracer/src/Datadog.Trace/TraceContext.cs#L207
3829
+ Map <String , String > aasTags = new HashMap <>();
3830
+
3831
+ /// The site name of the site instance in Azure where the traced application is running.
3832
+ String siteName = getEnv ("WEBSITE_SITE_NAME" );
3833
+ if (siteName != null ) {
3834
+ aasTags .put ("aas.site.name" , siteName );
3835
+ }
3836
+
3837
+ // The kind of application instance running in Azure.
3838
+ // Possible values: app, api, mobileapp, app_linux, app_linux_container, functionapp,
3839
+ // functionapp_linux, functionapp_linux_container
3840
+
3841
+ // The type of application instance running in Azure.
3842
+ // Possible values: app, function
3843
+ if (getEnv ("FUNCTIONS_WORKER_RUNTIME" ) != null
3844
+ || getEnv ("FUNCTIONS_EXTENSIONS_VERSION" ) != null ) {
3845
+ aasTags .put ("aas.site.kind" , "functionapp" );
3846
+ aasTags .put ("aas.site.type" , "function" );
3847
+ } else {
3848
+ aasTags .put ("aas.site.kind" , "app" );
3849
+ aasTags .put ("aas.site.type" , "app" );
3850
+ }
3851
+
3852
+ // The resource group of the site instance in Azure App Services
3853
+ String resourceGroup = getEnv ("WEBSITE_RESOURCE_GROUP" );
3854
+ if (resourceGroup != null ) {
3855
+ aasTags .put ("aas.resource.group" , resourceGroup );
3856
+ }
3857
+
3858
+ // Example: 8c500027-5f00-400e-8f00-60000000000f+apm-dotnet-EastUSwebspace
3859
+ // Format: {subscriptionId}+{planResourceGroup}-{hostedInRegion}
3860
+ String websiteOwner = getEnv ("WEBSITE_OWNER_NAME" );
3861
+ int plusIndex = websiteOwner == null ? -1 : websiteOwner .indexOf ("+" );
3862
+
3863
+ // The subscription ID of the site instance in Azure App Services
3864
+ String subscriptionId = null ;
3865
+ if (plusIndex > 0 ) {
3866
+ subscriptionId = websiteOwner .substring (0 , plusIndex );
3867
+ aasTags .put ("aas.subscription.id" , subscriptionId );
3868
+ }
3869
+
3870
+ if (subscriptionId != null && siteName != null && resourceGroup != null ) {
3871
+ // The resource ID of the site instance in Azure App Services
3872
+ String resourceId =
3873
+ "/subscriptions/"
3874
+ + subscriptionId
3875
+ + "/resourcegroups/"
3876
+ + resourceGroup
3877
+ + "/providers/microsoft.web/sites/"
3878
+ + siteName ;
3879
+ resourceId = resourceId .toLowerCase (Locale .ROOT );
3880
+ aasTags .put ("aas.resource.id" , resourceId );
3881
+ } else {
3882
+ log .warn (
3883
+ "Unable to generate resource id subscription id: {}, site name: {}, resource group {}" ,
3884
+ subscriptionId ,
3885
+ siteName ,
3886
+ resourceGroup );
3887
+ }
3888
+
3889
+ // The instance ID in Azure
3890
+ String instanceId = getEnv ("WEBSITE_INSTANCE_ID" );
3891
+ instanceId = instanceId == null ? "unknown" : instanceId ;
3892
+ aasTags .put ("aas.environment.instance_id" , instanceId );
3893
+
3894
+ // The instance name in Azure
3895
+ String instanceName = getEnv ("COMPUTERNAME" );
3896
+ instanceName = instanceName == null ? "unknown" : instanceName ;
3897
+ aasTags .put ("aas.environment.instance_name" , instanceName );
3898
+
3899
+ // The operating system in Azure
3900
+ String operatingSystem = getEnv ("WEBSITE_OS" );
3901
+ operatingSystem = operatingSystem == null ? "unknown" : operatingSystem ;
3902
+ aasTags .put ("aas.environment.os" , operatingSystem );
3903
+
3904
+ // The version of the extension installed
3905
+ String siteExtensionVersion = getEnv ("DD_AAS_JAVA_EXTENSION_VERSION" );
3906
+ siteExtensionVersion = siteExtensionVersion == null ? "unknown" : siteExtensionVersion ;
3907
+ aasTags .put ("aas.environment.extension_version" , siteExtensionVersion );
3908
+
3909
+ aasTags .put ("aas.environment.runtime" , getProp ("java.vm.name" , "unknown" ));
3910
+
3911
+ return aasTags ;
3912
+ }
3913
+
3916
3914
public boolean isAgentlessLogSubmissionEnabled () {
3917
3915
return agentlessLogSubmissionEnabled ;
3918
3916
}
@@ -4643,8 +4641,8 @@ public String toString() {
4643
4641
+ dataJobsEnabled
4644
4642
+ ", dataJobsCommandPattern="
4645
4643
+ dataJobsCommandPattern
4646
- + ", appSecStandaloneEnabled ="
4647
- + appSecStandaloneEnabled
4644
+ + ", apmTracingEnabled ="
4645
+ + apmTracingEnabled
4648
4646
+ ", cloudRequestPayloadTagging="
4649
4647
+ cloudRequestPayloadTagging
4650
4648
+ ", cloudResponsePayloadTagging="
0 commit comments