[Exporter.OTLP] Require path when disk-retry is configured#7106
[Exporter.OTLP] Require path when disk-retry is configured#7106rajkumar-rangaraj merged 3 commits intoopen-telemetry:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7106 +/- ##
==========================================
+ Coverage 88.79% 88.85% +0.06%
==========================================
Files 271 271
Lines 12970 12971 +1
==========================================
+ Hits 11517 11526 +9
+ Misses 1453 1445 -8
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
We've been moving toward enabling disk retry by default, and requiring an explicit env var to use it at all works against that direction. Thoughts? |
|
@rajkumar-rangaraj, I think that this plan can be against existing common behavior in OTel. EDIT: Similar scenario for rust, nodejs and python. If retry available it is in-memory by default. |
|
Maybe we could help improve the DX for the breaking change by adding something like this to the CHANGELOG entry? |
|
We could also potentially do something like noted in else if (AppContext.TryGetSwitch("OpenTelemetry.Exporter.OpenTelemetryProtocol.DangerousUseTempPathForDiskRetry", out var isEnabled) && isEnabled)
{
this.DiskRetryDirectoryPath = Path.GetTempPath();
}
else
{
throw new NotSupportedException(
$"Retry Policy '{retryPolicy}' requires '{OtlpDiskRetryDirectoryPathEnvVar}' to be configured.");
}Users could then enable that with: AppContext.SetSwitch("OpenTelemetry.Exporter.OpenTelemetryProtocol.DangerousUseTempPathForDiskRetry", true);The disadvantage to this is that you have to change the code - you can't enable the context switch through configuration. |
|
I do not think that we should add this kind of switch to experimental feature. I think that setting env. var. is equally hard as setting application switch. |
78dffdc
Changes
requires
OTEL_DOTNET_EXPERIMENTAL_OTLP_DISK_RETRY_DIRECTORY_PATHwhenOTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY=diskis configured. The exporter nolonger falls back to a shared temp directory by default.
Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changes[ ] Changes in public API reviewed (if applicable)