Skip to content

Commit bdc556e

Browse files
committed
Refactor: Remove confusing unused internal constructor in OtlpExporterOptions
The internal constructor was only ever called from the public constructor, and the public constructor itself is only used in tests. This made it easy to assume the internal constructor was part of normal runtime scenarios, which could cause confusion. (in normal runtime scenarios, only the factory method `OtlpExporterOptions.CreateOtlpExporterOptions` is used) Removing it simplifies the code and avoids misleading readers.
1 parent f723800 commit bdc556e

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpExporterOptions.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,10 @@ public class OtlpExporterOptions : IOtlpExporterOptions
4848
/// Initializes a new instance of the <see cref="OtlpExporterOptions"/> class.
4949
/// </summary>
5050
public OtlpExporterOptions()
51-
: this(OtlpExporterOptionsConfigurationType.Default)
52-
{
53-
}
54-
55-
internal OtlpExporterOptions(
56-
OtlpExporterOptionsConfigurationType configurationType)
5751
: this(
58-
configuration: new ConfigurationBuilder().AddEnvironmentVariables().Build(),
59-
configurationType,
60-
defaultBatchOptions: new())
52+
configuration: new ConfigurationBuilder().Build(),
53+
configurationType: OtlpExporterOptionsConfigurationType.Default,
54+
defaultBatchOptions: new())
6155
{
6256
}
6357

0 commit comments

Comments
 (0)