Skip to content

Commit

Permalink
revert change
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiyuanliang-ms committed Aug 13, 2024
1 parent 83d2417 commit 29b2cab
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ internal class RequestTracingConstants
public const string FeatureManagementVersionKey = "FMVer";
public const string FeatureManagementAspNetCoreVersionKey = "FMANCVer";
public const string DevEnvironmentValue = "Dev";
public const string KeyVaultConfiguredTag = "UsesKeyVault";
public const string KeyVaultRefreshConfiguredTag = "RefreshesKeyVault";
public const string ReplicaCountKey = "ReplicaCount";
public const string FeatureFlagUsesTelemetryTag = "Telemetry";
public const string FeatureFlagUsesSeedTag = "Seed";
public const string FeatureFlagMaxVariantsKey = "MaxVariants";
public const string FeatureFlagUsesVariantConfigurationReferenceTag = "ConfigRef";
public const string FeatureFlagFeaturesKey = "FFFeatures";
public const string FeaturesKey = "Features";
public const string KeyVaultConfiguredTag = "KV";
public const string KeyVaultRefreshConfiguredTag = "KVRefresh";
public const string LoadBalancingEnabledTag = "LB";
public const string SignalRUsedTag = "SignalR";
public const string FailoverRequestTag = "FailoverRequest";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,35 +65,15 @@ internal class RequestTracingOptions

public bool UsesAnyTracingFeature()
{
return IsKeyVaultConfigured || IsKeyVaultRefreshConfigured || IsLoadBalancingEnabled || IsSignalRUsed;
return IsLoadBalancingEnabled || IsSignalRUsed;
}

public string CreateFeaturesString()
{
var sb = new StringBuilder();

if (IsKeyVaultConfigured)
{
sb.Append(RequestTracingConstants.KeyVaultConfiguredTag);
}

if (IsKeyVaultRefreshConfigured)
{
if (sb.Length > 0)
{
sb.Append(RequestTracingConstants.Delimiter);
}

sb.Append(RequestTracingConstants.KeyVaultRefreshConfiguredTag);
}

if (IsLoadBalancingEnabled)
{
if (sb.Length > 0)
{
sb.Append(RequestTracingConstants.Delimiter);
}

sb.Append(RequestTracingConstants.LoadBalancingEnabledTag);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,16 @@ private static string CreateCorrelationContextHeader(RequestType requestType, Re
correlationContextKeyValues.Add(new KeyValuePair<string, string>(RequestTracingConstants.FeaturesKey, requestTracingOptions.CreateFeaturesString()));
}

if (requestTracingOptions.IsKeyVaultConfigured)
{
correlationContextTags.Add(RequestTracingConstants.KeyVaultConfiguredTag);
}

if (requestTracingOptions.IsKeyVaultRefreshConfigured)
{
correlationContextTags.Add(RequestTracingConstants.KeyVaultRefreshConfiguredTag);
}

if (requestTracingOptions.IsFailoverRequest)
{
correlationContextTags.Add(RequestTracingConstants.FailoverRequestTag);
Expand Down

0 comments on commit 29b2cab

Please sign in to comment.