Skip to content

Commit

Permalink
Merge branch 'main' into options-dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
cijothomas committed Jan 25, 2023
2 parents d55e4ec + ff6efe7 commit 765d165
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 64 deletions.
3 changes: 0 additions & 3 deletions docs/trace/customizing-the-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,6 @@ For exporting purposes, the SDK provides the following built-in processors:
| `OTEL_BSP_MAX_QUEUE_SIZE` | `MaxQueueSize` |
| `OTEL_BSP_MAX_EXPORT_BATCH_SIZE` | `MaxExportBatchSizeEnvVarKey` |

`FormatException` is thrown in case of an invalid value for any of the
supported environment variables.

* [SimpleExportProcessor<T>](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#simple-processor)
: This is an exporting processor which passes telemetry to the configured
exporter immediately without any batching.
Expand Down
3 changes: 0 additions & 3 deletions src/OpenTelemetry.Exporter.Console/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ values of the `PeriodicExportingMetricReaderOptions`
| `OTEL_METRIC_EXPORT_INTERVAL` | `ExportIntervalMilliseconds` |
| `OTEL_METRIC_EXPORT_TIMEOUT` | `ExportTimeoutMilliseconds` |

`FormatException` is thrown in case of an invalid value for any of the
supported environment variables.

## References

* [OpenTelemetry Project](https://opentelemetry.io/)
3 changes: 0 additions & 3 deletions src/OpenTelemetry.Exporter.InMemory/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ values of the `PeriodicExportingMetricReaderOptions`
| `OTEL_METRIC_EXPORT_INTERVAL` | `ExportIntervalMilliseconds` |
| `OTEL_METRIC_EXPORT_TIMEOUT` | `ExportTimeoutMilliseconds` |

`FormatException` is thrown in case of an invalid value for any of the
supported environment variables.

## References

* [OpenTelemetry Project](https://opentelemetry.io/)
4 changes: 0 additions & 4 deletions src/OpenTelemetry.Exporter.Jaeger/JaegerExporterOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ namespace OpenTelemetry.Exporter
/// OTEL_EXPORTER_JAEGER_AGENT_HOST, OTEL_EXPORTER_JAEGER_AGENT_PORT
/// environment variables are parsed during object construction.
/// </summary>
/// <remarks>
/// The constructor throws <see cref="FormatException"/> if it fails to parse
/// any of the supported environment variables.
/// </remarks>
public class JaegerExporterOptions
{
internal const int DefaultMaxPayloadSizeInBytes = 4096;
Expand Down
3 changes: 0 additions & 3 deletions src/OpenTelemetry.Exporter.Jaeger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ values of the `JaegerExporterOptions`
| `OTEL_EXPORTER_JAEGER_ENDPOINT` | `Endpoint` |
| `OTEL_EXPORTER_JAEGER_PROTOCOL` | `Protocol` (`udp/thrift.compact` or `http/thrift.binary`) |

`FormatException` is thrown in case of an invalid value for any of the
supported environment variables.

## Configure HttpClient

The `HttpClientFactory` option is provided on `JaegerExporterOptions` for users
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ values of the `PeriodicExportingMetricReaderOptions`
| `OTEL_METRIC_EXPORT_INTERVAL` | `ExportIntervalMilliseconds` |
| `OTEL_METRIC_EXPORT_TIMEOUT` | `ExportTimeoutMilliseconds` |

`FormatException` is thrown in case of an invalid value for any of the
supported environment variables.

## References

* [OpenTelemetry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ namespace OpenTelemetry.Exporter
/// OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_TIMEOUT, OTEL_EXPORTER_OTLP_PROTOCOL
/// environment variables are parsed during object construction.
/// </summary>
/// <remarks>
/// The constructor throws <see cref="FormatException"/> if it fails to parse
/// any of the supported environment variables.
/// </remarks>
public class OtlpExporterOptions
{
internal const string EndpointEnvVarName = "OTEL_EXPORTER_OTLP_ENDPOINT";
Expand Down
3 changes: 0 additions & 3 deletions src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@ values of the span limits
* `OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT`
* `OTEL_LINK_ATTRIBUTE_COUNT_LIMIT`

`FormatException` is thrown in case of an invalid value for any of the
supported environment variables.

## OTLP Logs

This package currently only supports exporting traces and metrics. Support for
Expand Down
3 changes: 0 additions & 3 deletions src/OpenTelemetry.Exporter.Zipkin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ values of the `ZipkinExporterOptions`.
| --------------------------------| -------------------------------- |
| `OTEL_EXPORTER_ZIPKIN_ENDPOINT` | `Endpoint` |

`FormatException` is thrown in case of an invalid value for any of the
supported environment variables.

## Configure HttpClient

The `HttpClientFactory` option is provided on `ZipkinExporterOptions` for users
Expand Down
4 changes: 0 additions & 4 deletions src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ namespace OpenTelemetry.Exporter
/// OTEL_EXPORTER_ZIPKIN_ENDPOINT
/// environment variables are parsed during object construction.
/// </summary>
/// <remarks>
/// The constructor throws <see cref="FormatException"/> if it fails to parse
/// any of the supported environment variables.
/// </remarks>
public sealed class ZipkinExporterOptions
{
internal const int DefaultMaxPayloadSizeInBytes = 4096;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ namespace OpenTelemetry.Trace
/// OTEL_BSP_MAX_QUEUE_SIZE, OTEL_BSP_MAX_EXPORT_BATCH_SIZE, OTEL_BSP_EXPORT_TIMEOUT, OTEL_BSP_SCHEDULE_DELAY
/// environment variables are parsed during object construction.
/// </summary>
/// <remarks>
/// The constructor throws <see cref="FormatException"/> if it fails to parse
/// any of the supported environment variables.
/// </remarks>
public class BatchExportActivityProcessorOptions : BatchExportProcessorOptions<Activity>
{
internal const string MaxQueueSizeEnvVarKey = "OTEL_BSP_MAX_QUEUE_SIZE";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,16 @@ public void JaegerExporterOptions_EnvironmentVariableOverride()
Assert.Equal(new Uri("http://custom-endpoint:12345"), options.Endpoint);
}

[Theory(Skip = "https://github.com/open-telemetry/opentelemetry-dotnet/issues/3690")]
[InlineData(JaegerExporterOptions.OTelAgentPortEnvVarKey)]
[InlineData(JaegerExporterOptions.OTelProtocolEnvVarKey)]
public void JaegerExporterOptions_InvalidEnvironmentVariableOverride(string envVar)
[Fact]
public void JaegerExporterOptions_InvalidEnvironmentVariableOverride()
{
Environment.SetEnvironmentVariable(envVar, "invalid");
Environment.SetEnvironmentVariable(JaegerExporterOptions.OTelAgentPortEnvVarKey, "invalid");
Environment.SetEnvironmentVariable(JaegerExporterOptions.OTelProtocolEnvVarKey, "invalid");

var options = new JaegerExporterOptions();

Assert.Throws<FormatException>(() => new JaegerExporterOptions());
Assert.Equal("localhost", options.AgentHost);
Assert.Equal(default(JaegerExportProtocol), options.Protocol);
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,28 +95,18 @@ public void OtlpExporterOptions_UsingIConfiguration()
Assert.Equal(OtlpExportProtocol.HttpProtobuf, options.Protocol);
}

[Fact(Skip = "https://github.com/open-telemetry/opentelemetry-dotnet/issues/3690")]
public void OtlpExporterOptions_InvalidEndpointVariableOverride()
[Fact]
public void OtlpExporterOptions_InvalidEnvironmentVariableOverride()
{
Environment.SetEnvironmentVariable(OtlpExporterOptions.EndpointEnvVarName, "invalid");

Assert.Throws<FormatException>(() => new OtlpExporterOptions());
}

[Fact(Skip = "https://github.com/open-telemetry/opentelemetry-dotnet/issues/3690")]
public void OtlpExporterOptions_InvalidTimeoutVariableOverride()
{
Environment.SetEnvironmentVariable(OtlpExporterOptions.TimeoutEnvVarName, "invalid");

Assert.Throws<FormatException>(() => new OtlpExporterOptions());
}

[Fact(Skip = "https://github.com/open-telemetry/opentelemetry-dotnet/issues/3690")]
public void OtlpExporterOptions_InvalidProtocolVariableOverride()
{
Environment.SetEnvironmentVariable(OtlpExporterOptions.ProtocolEnvVarName, "invalid");

Assert.Throws<FormatException>(() => new OtlpExporterOptions());
var options = new OtlpExporterOptions();

Assert.Equal(new Uri("http://localhost:4317"), options.Endpoint);
Assert.Equal(10000, options.TimeoutMilliseconds);
Assert.Equal(default, options.Protocol);
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ public void ErrorGettingUriFromEnvVarSetsDefaultEndpointValue()
{
Environment.SetEnvironmentVariable(ZipkinExporterOptions.ZipkinEndpointEnvVar, "InvalidUri");

Assert.Throws<FormatException>(() => new ZipkinExporterOptions());
var options = new ZipkinExporterOptions();

Assert.Equal(new Uri(ZipkinExporterOptions.DefaultZipkinEndpoint), options.Endpoint);
}
finally
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,20 @@ public void BatchExportProcessorOptions_UsingIConfiguration()
Assert.Equal(4, options.ScheduledDelayMilliseconds);
}

[Fact(Skip = "https://github.com/open-telemetry/opentelemetry-dotnet/issues/3690")]
public void BatchExportProcessorOptions_InvalidPortEnvironmentVariableOverride()
[Fact]
public void BatchExportProcessorOptions_InvalidEnvironmentVariableOverride()
{
Environment.SetEnvironmentVariable(BatchExportActivityProcessorOptions.ExporterTimeoutEnvVarKey, "invalid");
Environment.SetEnvironmentVariable(BatchExportActivityProcessorOptions.MaxExportBatchSizeEnvVarKey, "invalid");
Environment.SetEnvironmentVariable(BatchExportActivityProcessorOptions.MaxQueueSizeEnvVarKey, "invalid");
Environment.SetEnvironmentVariable(BatchExportActivityProcessorOptions.ScheduledDelayEnvVarKey, "invalid");

var options = new BatchExportActivityProcessorOptions();

Assert.Throws<FormatException>(() => new BatchExportActivityProcessorOptions());
Assert.Equal(30000, options.ExporterTimeoutMilliseconds);
Assert.Equal(512, options.MaxExportBatchSize);
Assert.Equal(2048, options.MaxQueueSize);
Assert.Equal(5000, options.ScheduledDelayMilliseconds);
}

[Fact]
Expand Down

0 comments on commit 765d165

Please sign in to comment.