Skip to content

Commit

Permalink
refactory
Browse files Browse the repository at this point in the history
  • Loading branch information
vishweshbankwar committed May 3, 2024
1 parent 526e290 commit 97eaacc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ internal sealed class ExperimentalOptions

public const string OtlpRetryEnvVar = "OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY";

public const string OtlpDiskRetryStoragePathEnvVar = "OTEL_DOTNET_EXPERIMENTAL_OTLP_DISK_RETRY_DIRECTORY_PATH";
public const string OtlpDiskRetryDirectoryPathEnvVar = "OTEL_DOTNET_EXPERIMENTAL_OTLP_DISK_RETRY_DIRECTORY_PATH";

public ExperimentalOptions()
: this(new ConfigurationBuilder().AddEnvironmentVariables().Build())
Expand All @@ -39,14 +39,14 @@ public ExperimentalOptions(IConfiguration configuration)
}
else if (retryPolicy.Equals("disk", StringComparison.OrdinalIgnoreCase))
{
if (configuration.TryGetStringValue(OtlpDiskRetryStoragePathEnvVar, out var path) && path != null)
if (configuration.TryGetStringValue(OtlpDiskRetryDirectoryPathEnvVar, out var path) && path != null)
{
this.EnableDiskRetry = true;
this.DiskRetryStoragePath = path;
this.DiskRetryDirectoryPath = path;
}
else
{
throw new ArgumentException($"{OtlpDiskRetryStoragePathEnvVar} is required when '{retryPolicy}' retry is used");
throw new ArgumentException($"{OtlpDiskRetryDirectoryPathEnvVar} is required when '{retryPolicy}' retry is used");
}
}
else
Expand Down Expand Up @@ -78,5 +78,5 @@ public ExperimentalOptions(IConfiguration configuration)
/// <summary>
/// Gets the path on disk where the telemetry will be stored for retries at a later point.
/// </summary>
public string? DiskRetryStoragePath { get; }
public string? DiskRetryDirectoryPath { get; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public static THeaders GetHeaders<THeaders>(this OtlpExporterOptions options, Ac
request.MergeFrom(data);
return request;
},
Path.Combine(experimentalOptions.DiskRetryStoragePath, "traces"));
Path.Combine(experimentalOptions.DiskRetryDirectoryPath, "traces"));
}
else
{
Expand Down Expand Up @@ -150,7 +150,7 @@ public static THeaders GetHeaders<THeaders>(this OtlpExporterOptions options, Ac
request.MergeFrom(data);
return request;
},
Path.Combine(experimentalOptions.DiskRetryStoragePath, "metrics"));
Path.Combine(experimentalOptions.DiskRetryDirectoryPath, "metrics"));
}
else
{
Expand Down Expand Up @@ -180,7 +180,7 @@ public static THeaders GetHeaders<THeaders>(this OtlpExporterOptions options, Ac
request.MergeFrom(data);
return request;
},
Path.Combine(experimentalOptions.DiskRetryStoragePath, "logs"));
Path.Combine(experimentalOptions.DiskRetryDirectoryPath, "logs"));
}
else
{
Expand Down

0 comments on commit 97eaacc

Please sign in to comment.