Skip to content

Commit

Permalink
Merge branch 'main' into utpilla/Makr-Private-Fields-ReadOnly-Where-P…
Browse files Browse the repository at this point in the history
…ossible
  • Loading branch information
cijothomas authored Sep 4, 2021
2 parents 601c58b + 79d4c49 commit ea74b00
Show file tree
Hide file tree
Showing 32 changed files with 301 additions and 35 deletions.
2 changes: 1 addition & 1 deletion docs/metrics/getting-started-async-counter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Install the
package:

```sh
dotnet add package OpenTelemetry.Exporter.Console --version 1.2.*.*
dotnet add package --prerelease OpenTelemetry.Exporter.Console
```

Update the `Program.cs` file with the code from [Program.cs](./Program.cs):
Expand Down
2 changes: 1 addition & 1 deletion docs/metrics/getting-started-gauge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Install the
package:

```sh
dotnet add package OpenTelemetry.Exporter.Console --version 1.2.*.*
dotnet add package --prerelease OpenTelemetry.Exporter.Console
```

Update the `Program.cs` file with the code from [Program.cs](./Program.cs):
Expand Down
28 changes: 14 additions & 14 deletions docs/metrics/getting-started-histogram/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Install the
package:

```sh
dotnet add package OpenTelemetry.Exporter.Console --version 1.2.*.*
dotnet add package --prerelease OpenTelemetry.Exporter.Console
```

Update the `Program.cs` file with the code from [Program.cs](./Program.cs):
Expand All @@ -32,19 +32,19 @@ output from the console, similar to shown below:

<!-- markdownlint-disable MD013 -->
```text
Export 14:30:58.201 14:30:59.177 histogram [tag1=value1;tag2=value2] Histogram, Meter: TestMeter/0.0.1
Value: Sum: 33862 Count: 62
(-? - 0) : 0
(0 - 5) : 0
(5 - 10) : 0
(10 - 25) : 2
(25 - 50) : 0
(50 - 75) : 1
(75 - 100) : 1
(100 - 250) : 6
(250 - 500) : 18
(500 - 1000) : 34
(1000 - ?) : 0
Export (2021-09-02T01:02:09.8013446Z, 2021-09-02T01:02:19.9749573Z] histogram tag1=value1;tag2=value2 Histogram, Meter: TestMeter/0.0.1
Value: Sum: 304929 Count: 623
(-Infinity, 0]: 0
(0, 5]: 5
(5, 10]: 5
(10, 25]: 14
(25, 50]: 15
(50, 75]: 18
(75, 100]: 17
(100, 250]: 91
(250, 500]: 158
(500, 1000]: 300
(1000, +Infinity): 0
```
<!-- markdownlint-enable MD013 -->

Expand Down
2 changes: 1 addition & 1 deletion docs/metrics/getting-started/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Install the
package:

```sh
dotnet add package OpenTelemetry.Exporter.Console --version 1.2.*.*
dotnet add package --prerelease OpenTelemetry.Exporter.Console
```

Update the `Program.cs` file with the code from [Program.cs](./Program.cs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace OpenTelemetry.Context.Propagation
{
internal class NoopTextMapPropagator : TextMapPropagator
internal sealed class NoopTextMapPropagator : TextMapPropagator
{
private static readonly PropagationContext DefaultPropagationContext = default;

Expand Down
8 changes: 8 additions & 0 deletions src/OpenTelemetry.Exporter.Jaeger/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

## Unreleased

* `JaegerExporterOptions.BatchExportProcessorOptions` is initialized with
`BatchExportActivityProcessorOptions` which supports field value overriding
using `OTEL_BSP_SCHEDULE_DELAY`, `OTEL_BSP_EXPORT_TIMEOUT`,
`OTEL_BSP_MAX_QUEUE_SIZE`, `OTEL_BSP_MAX_EXPORT_BATCH_SIZE`
envionmental variables as defined in the
[specification](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.5.0/specification/sdk-environment-variables.md#batch-span-processor).
([#2219](https://github.com/open-telemetry/opentelemetry-dotnet/pull/2219))

## 1.2.0-alpha2

Released 2021-Aug-24
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace OpenTelemetry.Exporter.Jaeger.Implementation
{
internal class InMemoryTransport : TTransport
internal sealed class InMemoryTransport : TTransport
{
private readonly BufferWriter bufferWriter;
private BufferWriterMemory? buffer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace OpenTelemetry.Exporter.Jaeger.Implementation
{
#pragma warning disable CA1032 // Implement standard exception constructors
#pragma warning disable CA1064 // Exceptions should be public
internal class JaegerExporterException : Exception
internal sealed class JaegerExporterException : Exception
#pragma warning restore CA1064 // Exceptions should be public
#pragma warning restore CA1032 // Implement standard exception constructors
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace OpenTelemetry.Exporter.Jaeger.Implementation
{
internal class JaegerThriftClient : TBaseClient
internal sealed class JaegerThriftClient : TBaseClient
{
public JaegerThriftClient(TProtocol outputProtocol)
: base(outputProtocol)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

namespace OpenTelemetry.Exporter.Jaeger.Implementation
{
internal class JaegerThriftClientTransport : TTransport
internal sealed class JaegerThriftClientTransport : TTransport
{
private readonly IJaegerClient client;
private readonly MemoryStream byteStream;
Expand Down
3 changes: 2 additions & 1 deletion src/OpenTelemetry.Exporter.Jaeger/JaegerExporterOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using System.Diagnostics;
using System.Security;
using OpenTelemetry.Exporter.Jaeger.Implementation;
using OpenTelemetry.Trace;

namespace OpenTelemetry.Exporter
{
Expand Down Expand Up @@ -82,6 +83,6 @@ public JaegerExporterOptions()
/// <summary>
/// Gets or sets the BatchExportProcessor options. Ignored unless ExportProcessorType is BatchExporter.
/// </summary>
public BatchExportProcessorOptions<Activity> BatchExportProcessorOptions { get; set; } = new BatchExportProcessorOptions<Activity>();
public BatchExportProcessorOptions<Activity> BatchExportProcessorOptions { get; set; } = new BatchExportActivityProcessorOptions();
}
}
8 changes: 8 additions & 0 deletions src/OpenTelemetry.Exporter.OpenTelemetryProtocol/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

## Unreleased

* `OtlpExporterOptions.BatchExportProcessorOptions` is initialized with
`BatchExportActivityProcessorOptions` which supports field value overriding
using `OTEL_BSP_SCHEDULE_DELAY`, `OTEL_BSP_EXPORT_TIMEOUT`,
`OTEL_BSP_MAX_QUEUE_SIZE`, `OTEL_BSP_MAX_EXPORT_BATCH_SIZE`
envionmental variables as defined in the
[specification](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.5.0/specification/sdk-environment-variables.md#batch-span-processor).
([#2219](https://github.com/open-telemetry/opentelemetry-dotnet/pull/2219))

## 1.2.0-alpha2

Released 2021-Aug-24
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using System.Diagnostics;
using System.Security;
using OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation;
using OpenTelemetry.Trace;

namespace OpenTelemetry.Exporter
{
Expand Down Expand Up @@ -104,7 +105,7 @@ public OtlpExporterOptions()
/// <summary>
/// Gets or sets the BatchExportProcessor options. Ignored unless ExportProcessorType is Batch.
/// </summary>
public BatchExportProcessorOptions<Activity> BatchExportProcessorOptions { get; set; } = new BatchExportProcessorOptions<Activity>();
public BatchExportProcessorOptions<Activity> BatchExportProcessorOptions { get; set; } = new BatchExportActivityProcessorOptions();

/// <summary>
/// Gets or sets the metric export interval in milliseconds. The default value is 1000 milliseconds.
Expand Down
8 changes: 8 additions & 0 deletions src/OpenTelemetry.Exporter.Zipkin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

## Unreleased

* `ZipkinExporterOptions.BatchExportProcessorOptions` is initialized with
`BatchExportActivityProcessorOptions` which supports field value overriding
using `OTEL_BSP_SCHEDULE_DELAY`, `OTEL_BSP_EXPORT_TIMEOUT`,
`OTEL_BSP_MAX_QUEUE_SIZE`, `OTEL_BSP_MAX_EXPORT_BATCH_SIZE`
envionmental variables as defined in the
[specification](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.5.0/specification/sdk-environment-variables.md#batch-span-processor).
([#2219](https://github.com/open-telemetry/opentelemetry-dotnet/pull/2219))

## 1.2.0-alpha2

Released 2021-Aug-24
Expand Down
2 changes: 1 addition & 1 deletion src/OpenTelemetry.Exporter.Zipkin/ZipkinExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ private static string ResolveHostName()
return result;
}

private class JsonContent : HttpContent
private sealed class JsonContent : HttpContent
{
private static readonly MediaTypeHeaderValue JsonHeader = new MediaTypeHeaderValue("application/json")
{
Expand Down
3 changes: 2 additions & 1 deletion src/OpenTelemetry.Exporter.Zipkin/ZipkinExporterOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using System;
using System.Diagnostics;
using OpenTelemetry.Exporter.Zipkin.Implementation;
using OpenTelemetry.Trace;

namespace OpenTelemetry.Exporter
{
Expand Down Expand Up @@ -70,6 +71,6 @@ public ZipkinExporterOptions()
/// <summary>
/// Gets or sets the BatchExportProcessor options. Ignored unless ExportProcessorType is BatchExporter.
/// </summary>
public BatchExportProcessorOptions<Activity> BatchExportProcessorOptions { get; set; } = new BatchExportProcessorOptions<Activity>();
public BatchExportProcessorOptions<Activity> BatchExportProcessorOptions { get; set; } = new BatchExportActivityProcessorOptions();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace OpenTelemetry.Trace
/// <summary>
/// A <see cref="TracerProviderBuilderBase"/> with support for deferred initialization using <see cref="IServiceProvider"/> for dependency injection.
/// </summary>
internal class TracerProviderBuilderHosting : TracerProviderBuilderBase, IDeferredTracerProviderBuilder
internal sealed class TracerProviderBuilderHosting : TracerProviderBuilderBase, IDeferredTracerProviderBuilder
{
private readonly List<Action<IServiceProvider, TracerProviderBuilder>> configurationActions = new List<Action<IServiceProvider, TracerProviderBuilder>>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

namespace OpenTelemetry.Instrumentation.GrpcNetClient.Implementation
{
internal class GrpcClientDiagnosticListener : ListenerHandler
internal sealed class GrpcClientDiagnosticListener : ListenerHandler
{
internal static readonly AssemblyName AssemblyName = typeof(GrpcClientDiagnosticListener).Assembly.GetName();
internal static readonly string ActivitySourceName = AssemblyName.Name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

namespace OpenTelemetry.Instrumentation.Http.Implementation
{
internal class HttpHandlerDiagnosticListener : ListenerHandler
internal sealed class HttpHandlerDiagnosticListener : ListenerHandler
{
internal static readonly AssemblyName AssemblyName = typeof(HttpHandlerDiagnosticListener).Assembly.GetName();
internal static readonly string ActivitySourceName = AssemblyName.Name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace OpenTelemetry.Instrumentation.SqlClient.Implementation
{
internal class SqlClientDiagnosticListener : ListenerHandler
internal sealed class SqlClientDiagnosticListener : ListenerHandler
{
public const string SqlDataBeforeExecuteCommand = "System.Data.SqlClient.WriteCommandBefore";
public const string SqlMicrosoftBeforeExecuteCommand = "Microsoft.Data.SqlClient.WriteCommandBefore";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace OpenTelemetry.Instrumentation.SqlClient.Implementation
///
/// "Microsoft.Data.SqlClient.EventSource" doesn't have that issue.
/// </remarks>
internal class SqlEventSourceListener : EventListener
internal sealed class SqlEventSourceListener : EventListener
{
internal const string AdoNetEventSourceName = "Microsoft-AdoNet-SystemData";
internal const string MdsEventSourceName = "Microsoft.Data.SqlClient.EventSource";
Expand Down
2 changes: 2 additions & 0 deletions src/OpenTelemetry/.publicApi/net461/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
OpenTelemetry.Trace.BatchExportActivityProcessorOptions
OpenTelemetry.Trace.BatchExportActivityProcessorOptions.BatchExportActivityProcessorOptions() -> void
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
OpenTelemetry.Trace.BatchExportActivityProcessorOptions
OpenTelemetry.Trace.BatchExportActivityProcessorOptions.BatchExportActivityProcessorOptions() -> void
7 changes: 7 additions & 0 deletions src/OpenTelemetry/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## Unreleased

* Add `BatchExportActivityProcessorOptions` which supports field value overriding
using `OTEL_BSP_SCHEDULE_DELAY`, `OTEL_BSP_EXPORT_TIMEOUT`,
`OTEL_BSP_MAX_QUEUE_SIZE`, `OTEL_BSP_MAX_EXPORT_BATCH_SIZE`
envionmental variables as defined in the
[specification](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.5.0/specification/sdk-environment-variables.md#batch-span-processor).
([#2219](https://github.com/open-telemetry/opentelemetry-dotnet/pull/2219))

## 1.2.0-alpha2

Released 2021-Aug-24
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public virtual bool TryFetch(object obj, out T value)
return false;
}

private class TypedPropertyFetch<TDeclaredObject, TDeclaredProperty> : PropertyFetch
private sealed class TypedPropertyFetch<TDeclaredObject, TDeclaredProperty> : PropertyFetch
where TDeclaredProperty : T
{
private readonly Func<TDeclaredObject, TDeclaredProperty> propertyFetch;
Expand Down
22 changes: 22 additions & 0 deletions src/OpenTelemetry/Internal/OpenTelemetrySdkEventSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#endif
using System.Diagnostics;
using System.Diagnostics.Tracing;
using System.Security;

namespace OpenTelemetry.Internal
{
Expand Down Expand Up @@ -125,6 +126,15 @@ public void TracerProviderException(string evnt, Exception ex)
}
}

[NonEvent]
public void MissingPermissionsToReadEnvironmentVariable(SecurityException ex)
{
if (this.IsEnabled(EventLevel.Warning, EventKeywords.All))
{
this.MissingPermissionsToReadEnvironmentVariable(ex.ToInvariantString());
}
}

[Event(1, Message = "Span processor queue size reached maximum. Throttling spans.", Level = EventLevel.Warning)]
public void SpanProcessorQueueIsExhausted()
{
Expand Down Expand Up @@ -287,6 +297,18 @@ public void TracerProviderException(string evnt, string ex)
this.WriteEvent(28, evnt, ex);
}

[Event(29, Message = "Failed to parse environment variable: '{0}', value: '{1}'.", Level = EventLevel.Warning)]
public void FailedToParseEnvironmentVariable(string name, string value)
{
this.WriteEvent(29, name, value);
}

[Event(30, Message = "Missing permissions to read environment variable: '{0}'", Level = EventLevel.Warning)]
public void MissingPermissionsToReadEnvironmentVariable(string exception)
{
this.WriteEvent(30, exception);
}

#if DEBUG
public class OpenTelemetryEventListener : EventListener
{
Expand Down
14 changes: 14 additions & 0 deletions src/OpenTelemetry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,24 @@ purposes, the SDK provides the following built-in processors:
* [BatchExportProcessor&lt;T&gt;](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#batching-processor)
: This is an exporting processor which batches the telemetry before sending to
the configured exporter.

The following environment variables can be used to override the default
values of the `BatchExportActivityProcessorOptions`.

<!-- markdownlint-disable MD013 -->
| Environment variable | `BatchExportActivityProcessorOptions` property |
| -------------------------------- | ---------------------------------------------- |
| `OTEL_BSP_SCHEDULE_DELAY` | `ScheduledDelayMilliseconds` |
| `OTEL_BSP_EXPORT_TIMEOUT` | `ExporterTimeoutMilliseconds` |
| `OTEL_BSP_MAX_QUEUE_SIZE` | `MaxQueueSize` |
| `OTEL_BSP_MAX_EXPORT_BATCH_SIZE` | `MaxExportBatchSizeEnvVarKey` |
<!-- markdownlint-enable MD013 -->

* [CompositeProcessor&lt;T&gt;](../../src/OpenTelemetry/CompositeProcessor.cs)
: This is a processor which can be composed from multiple processors. This is
typically used to construct multiple processing pipelines, each ending with
its own exporter.

* [SimpleExportProcessor&lt;T&gt;](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 without any batching.
Expand Down
Loading

0 comments on commit ea74b00

Please sign in to comment.