Skip to content

Commit

Permalink
Merge branch 'main' into zipkin-httpclientfactory
Browse files Browse the repository at this point in the history
  • Loading branch information
cijothomas authored Nov 23, 2021
2 parents b3821ba + ec67afe commit aefbf9d
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 75 deletions.
32 changes: 11 additions & 21 deletions src/OpenTelemetry/.publicApi/net461/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ abstract OpenTelemetry.Metrics.MetricReader.ProcessMetrics(in OpenTelemetry.Batc
OpenTelemetry.BaseExporter<T>.ForceFlush(int timeoutMilliseconds = -1) -> bool
OpenTelemetry.Batch<T>.Batch(T[] items, int count) -> void
OpenTelemetry.Batch<T>.Count.get -> long
OpenTelemetry.Metrics.Aggregation
OpenTelemetry.Metrics.Aggregation.Default = 0 -> OpenTelemetry.Metrics.Aggregation
OpenTelemetry.Metrics.Aggregation.Drop = 1 -> OpenTelemetry.Metrics.Aggregation
OpenTelemetry.Metrics.Aggregation.Histogram = 4 -> OpenTelemetry.Metrics.Aggregation
OpenTelemetry.Metrics.Aggregation.LastValue = 3 -> OpenTelemetry.Metrics.Aggregation
OpenTelemetry.Metrics.Aggregation.Sum = 2 -> OpenTelemetry.Metrics.Aggregation
OpenTelemetry.Metrics.AggregationTemporality
OpenTelemetry.Metrics.AggregationTemporality.Cumulative = 1 -> OpenTelemetry.Metrics.AggregationTemporality
OpenTelemetry.Metrics.AggregationTemporality.Delta = 2 -> OpenTelemetry.Metrics.AggregationTemporality
Expand All @@ -19,16 +13,16 @@ OpenTelemetry.Metrics.AggregationTemporalityAttribute.Supported.get -> OpenTelem
OpenTelemetry.Metrics.BaseExportingMetricReader
OpenTelemetry.Metrics.BaseExportingMetricReader.BaseExportingMetricReader(OpenTelemetry.BaseExporter<OpenTelemetry.Metrics.Metric> exporter) -> void
OpenTelemetry.Metrics.BaseExportingMetricReader.SupportedExportModes.get -> OpenTelemetry.Metrics.ExportModes
OpenTelemetry.Metrics.BatchMetricPoint
OpenTelemetry.Metrics.BatchMetricPoint.BatchMetricPoint() -> void
OpenTelemetry.Metrics.BatchMetricPoint.Dispose() -> void
OpenTelemetry.Metrics.BatchMetricPoint.Enumerator
OpenTelemetry.Metrics.BatchMetricPoint.Enumerator.Current.get -> OpenTelemetry.Metrics.MetricPoint
OpenTelemetry.Metrics.BatchMetricPoint.Enumerator.Dispose() -> void
OpenTelemetry.Metrics.BatchMetricPoint.Enumerator.Enumerator() -> void
OpenTelemetry.Metrics.BatchMetricPoint.Enumerator.MoveNext() -> bool
OpenTelemetry.Metrics.BatchMetricPoint.Enumerator.Reset() -> void
OpenTelemetry.Metrics.BatchMetricPoint.GetEnumerator() -> OpenTelemetry.Metrics.BatchMetricPoint.Enumerator
OpenTelemetry.Metrics.MetricPointsAccessor
OpenTelemetry.Metrics.MetricPointsAccessor.MetricPointsAccessor() -> void
OpenTelemetry.Metrics.MetricPointsAccessor.Dispose() -> void
OpenTelemetry.Metrics.MetricPointsAccessor.Enumerator
OpenTelemetry.Metrics.MetricPointsAccessor.Enumerator.Current.get -> OpenTelemetry.Metrics.MetricPoint
OpenTelemetry.Metrics.MetricPointsAccessor.Enumerator.Dispose() -> void
OpenTelemetry.Metrics.MetricPointsAccessor.Enumerator.Enumerator() -> void
OpenTelemetry.Metrics.MetricPointsAccessor.Enumerator.MoveNext() -> bool
OpenTelemetry.Metrics.MetricPointsAccessor.Enumerator.Reset() -> void
OpenTelemetry.Metrics.MetricPointsAccessor.GetEnumerator() -> OpenTelemetry.Metrics.MetricPointsAccessor.Enumerator
OpenTelemetry.Metrics.ExportModes
OpenTelemetry.Metrics.ExportModes.Pull = 2 -> OpenTelemetry.Metrics.ExportModes
OpenTelemetry.Metrics.ExportModes.Push = 1 -> OpenTelemetry.Metrics.ExportModes
Expand All @@ -49,7 +43,7 @@ OpenTelemetry.Metrics.MeterProviderBuilderExtensions
OpenTelemetry.Metrics.MeterProviderExtensions
OpenTelemetry.Metrics.Metric
OpenTelemetry.Metrics.Metric.Description.get -> string
OpenTelemetry.Metrics.Metric.GetMetricPoints() -> OpenTelemetry.Metrics.BatchMetricPoint
OpenTelemetry.Metrics.Metric.GetMetricPoints() -> OpenTelemetry.Metrics.MetricPointsAccessor
OpenTelemetry.Metrics.Metric.Meter.get -> System.Diagnostics.Metrics.Meter
OpenTelemetry.Metrics.Metric.MetricType.get -> OpenTelemetry.Metrics.MetricType
OpenTelemetry.Metrics.Metric.Name.get -> string
Expand Down Expand Up @@ -109,8 +103,6 @@ override OpenTelemetry.Metrics.BaseExportingMetricReader.Dispose(bool disposing)
override OpenTelemetry.Metrics.BaseExportingMetricReader.OnCollect(int timeoutMilliseconds) -> bool
override OpenTelemetry.Metrics.BaseExportingMetricReader.OnShutdown(int timeoutMilliseconds) -> bool
override OpenTelemetry.Metrics.BaseExportingMetricReader.ProcessMetrics(in OpenTelemetry.Batch<OpenTelemetry.Metrics.Metric> metrics, int timeoutMilliseconds) -> bool
override OpenTelemetry.Metrics.ExplicitBucketHistogramConfiguration.Aggregation.get -> OpenTelemetry.Metrics.Aggregation
override OpenTelemetry.Metrics.ExplicitBucketHistogramConfiguration.Aggregation.set -> void
override OpenTelemetry.Metrics.MeterProviderBuilderBase.AddInstrumentation<TInstrumentation>(System.Func<TInstrumentation> instrumentationFactory) -> OpenTelemetry.Metrics.MeterProviderBuilder
override OpenTelemetry.Metrics.MeterProviderBuilderBase.AddMeter(params string[] names) -> OpenTelemetry.Metrics.MeterProviderBuilder
override OpenTelemetry.Metrics.PeriodicExportingMetricReader.Dispose(bool disposing) -> void
Expand Down Expand Up @@ -138,5 +130,3 @@ virtual OpenTelemetry.BaseExporter<T>.OnForceFlush(int timeoutMilliseconds) -> b
virtual OpenTelemetry.Metrics.MetricReader.Dispose(bool disposing) -> void
virtual OpenTelemetry.Metrics.MetricReader.OnCollect(int timeoutMilliseconds) -> bool
virtual OpenTelemetry.Metrics.MetricReader.OnShutdown(int timeoutMilliseconds) -> bool
virtual OpenTelemetry.Metrics.MetricStreamConfiguration.Aggregation.get -> OpenTelemetry.Metrics.Aggregation
virtual OpenTelemetry.Metrics.MetricStreamConfiguration.Aggregation.set -> void
32 changes: 11 additions & 21 deletions src/OpenTelemetry/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ abstract OpenTelemetry.Metrics.MetricReader.ProcessMetrics(in OpenTelemetry.Batc
OpenTelemetry.BaseExporter<T>.ForceFlush(int timeoutMilliseconds = -1) -> bool
OpenTelemetry.Batch<T>.Batch(T[] items, int count) -> void
OpenTelemetry.Batch<T>.Count.get -> long
OpenTelemetry.Metrics.Aggregation
OpenTelemetry.Metrics.Aggregation.Default = 0 -> OpenTelemetry.Metrics.Aggregation
OpenTelemetry.Metrics.Aggregation.Drop = 1 -> OpenTelemetry.Metrics.Aggregation
OpenTelemetry.Metrics.Aggregation.Histogram = 4 -> OpenTelemetry.Metrics.Aggregation
OpenTelemetry.Metrics.Aggregation.LastValue = 3 -> OpenTelemetry.Metrics.Aggregation
OpenTelemetry.Metrics.Aggregation.Sum = 2 -> OpenTelemetry.Metrics.Aggregation
OpenTelemetry.Metrics.AggregationTemporality
OpenTelemetry.Metrics.AggregationTemporality.Cumulative = 1 -> OpenTelemetry.Metrics.AggregationTemporality
OpenTelemetry.Metrics.AggregationTemporality.Delta = 2 -> OpenTelemetry.Metrics.AggregationTemporality
Expand All @@ -19,16 +13,16 @@ OpenTelemetry.Metrics.AggregationTemporalityAttribute.Supported.get -> OpenTelem
OpenTelemetry.Metrics.BaseExportingMetricReader
OpenTelemetry.Metrics.BaseExportingMetricReader.BaseExportingMetricReader(OpenTelemetry.BaseExporter<OpenTelemetry.Metrics.Metric> exporter) -> void
OpenTelemetry.Metrics.BaseExportingMetricReader.SupportedExportModes.get -> OpenTelemetry.Metrics.ExportModes
OpenTelemetry.Metrics.BatchMetricPoint
OpenTelemetry.Metrics.BatchMetricPoint.BatchMetricPoint() -> void
OpenTelemetry.Metrics.BatchMetricPoint.Dispose() -> void
OpenTelemetry.Metrics.BatchMetricPoint.Enumerator
OpenTelemetry.Metrics.BatchMetricPoint.Enumerator.Current.get -> OpenTelemetry.Metrics.MetricPoint
OpenTelemetry.Metrics.BatchMetricPoint.Enumerator.Dispose() -> void
OpenTelemetry.Metrics.BatchMetricPoint.Enumerator.Enumerator() -> void
OpenTelemetry.Metrics.BatchMetricPoint.Enumerator.MoveNext() -> bool
OpenTelemetry.Metrics.BatchMetricPoint.Enumerator.Reset() -> void
OpenTelemetry.Metrics.BatchMetricPoint.GetEnumerator() -> OpenTelemetry.Metrics.BatchMetricPoint.Enumerator
OpenTelemetry.Metrics.MetricPointsAccessor
OpenTelemetry.Metrics.MetricPointsAccessor.MetricPointsAccessor() -> void
OpenTelemetry.Metrics.MetricPointsAccessor.Dispose() -> void
OpenTelemetry.Metrics.MetricPointsAccessor.Enumerator
OpenTelemetry.Metrics.MetricPointsAccessor.Enumerator.Current.get -> OpenTelemetry.Metrics.MetricPoint
OpenTelemetry.Metrics.MetricPointsAccessor.Enumerator.Dispose() -> void
OpenTelemetry.Metrics.MetricPointsAccessor.Enumerator.Enumerator() -> void
OpenTelemetry.Metrics.MetricPointsAccessor.Enumerator.MoveNext() -> bool
OpenTelemetry.Metrics.MetricPointsAccessor.Enumerator.Reset() -> void
OpenTelemetry.Metrics.MetricPointsAccessor.GetEnumerator() -> OpenTelemetry.Metrics.MetricPointsAccessor.Enumerator
OpenTelemetry.Metrics.ExportModes
OpenTelemetry.Metrics.ExportModes.Pull = 2 -> OpenTelemetry.Metrics.ExportModes
OpenTelemetry.Metrics.ExportModes.Push = 1 -> OpenTelemetry.Metrics.ExportModes
Expand All @@ -49,7 +43,7 @@ OpenTelemetry.Metrics.MeterProviderBuilderExtensions
OpenTelemetry.Metrics.MeterProviderExtensions
OpenTelemetry.Metrics.Metric
OpenTelemetry.Metrics.Metric.Description.get -> string
OpenTelemetry.Metrics.Metric.GetMetricPoints() -> OpenTelemetry.Metrics.BatchMetricPoint
OpenTelemetry.Metrics.Metric.GetMetricPoints() -> OpenTelemetry.Metrics.MetricPointsAccessor
OpenTelemetry.Metrics.Metric.Meter.get -> System.Diagnostics.Metrics.Meter
OpenTelemetry.Metrics.Metric.MetricType.get -> OpenTelemetry.Metrics.MetricType
OpenTelemetry.Metrics.Metric.Name.get -> string
Expand Down Expand Up @@ -109,8 +103,6 @@ override OpenTelemetry.Metrics.BaseExportingMetricReader.Dispose(bool disposing)
override OpenTelemetry.Metrics.BaseExportingMetricReader.OnCollect(int timeoutMilliseconds) -> bool
override OpenTelemetry.Metrics.BaseExportingMetricReader.OnShutdown(int timeoutMilliseconds) -> bool
override OpenTelemetry.Metrics.BaseExportingMetricReader.ProcessMetrics(in OpenTelemetry.Batch<OpenTelemetry.Metrics.Metric> metrics, int timeoutMilliseconds) -> bool
override OpenTelemetry.Metrics.ExplicitBucketHistogramConfiguration.Aggregation.get -> OpenTelemetry.Metrics.Aggregation
override OpenTelemetry.Metrics.ExplicitBucketHistogramConfiguration.Aggregation.set -> void
override OpenTelemetry.Metrics.MeterProviderBuilderBase.AddInstrumentation<TInstrumentation>(System.Func<TInstrumentation> instrumentationFactory) -> OpenTelemetry.Metrics.MeterProviderBuilder
override OpenTelemetry.Metrics.MeterProviderBuilderBase.AddMeter(params string[] names) -> OpenTelemetry.Metrics.MeterProviderBuilder
override OpenTelemetry.Metrics.PeriodicExportingMetricReader.Dispose(bool disposing) -> void
Expand Down Expand Up @@ -138,5 +130,3 @@ virtual OpenTelemetry.BaseExporter<T>.OnForceFlush(int timeoutMilliseconds) -> b
virtual OpenTelemetry.Metrics.MetricReader.Dispose(bool disposing) -> void
virtual OpenTelemetry.Metrics.MetricReader.OnCollect(int timeoutMilliseconds) -> bool
virtual OpenTelemetry.Metrics.MetricReader.OnShutdown(int timeoutMilliseconds) -> bool
virtual OpenTelemetry.Metrics.MetricStreamConfiguration.Aggregation.get -> OpenTelemetry.Metrics.Aggregation
virtual OpenTelemetry.Metrics.MetricStreamConfiguration.Aggregation.set -> void
4 changes: 4 additions & 0 deletions src/OpenTelemetry/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
`GetExplicitBounds`, `GetHistogramCount`, and `GetHistogramSum`
([#2657](https://github.com/open-telemetry/opentelemetry-dotnet/pull/2657))

* Remove MetricStreamConfiguration.Aggregation, as the feature to customize
aggregation is not implemented yet.
([#2660](https://github.com/open-telemetry/opentelemetry-dotnet/pull/2660))

## 1.2.0-beta2

Released 2021-Nov-19
Expand Down
4 changes: 2 additions & 2 deletions src/OpenTelemetry/Metrics/AggregatorStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ internal void SnapshotCumulative(int indexSnapshot)
}
}

internal BatchMetricPoint GetMetricPoints()
internal MetricPointsAccessor GetMetricPoints()
{
return new BatchMetricPoint(this.metricPoints, this.currentMetricPointBatch, this.batchSize, this.startTimeExclusive, this.endTimeInclusive);
return new MetricPointsAccessor(this.metricPoints, this.currentMetricPointBatch, this.batchSize, this.startTimeExclusive, this.endTimeInclusive);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
Expand Down
19 changes: 0 additions & 19 deletions src/OpenTelemetry/Metrics/ExplicitBucketHistogramConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,10 @@
// limitations under the License.
// </copyright>

using System;

namespace OpenTelemetry.Metrics
{
public class ExplicitBucketHistogramConfiguration : MetricStreamConfiguration
{
private Aggregation aggregation = Aggregation.Histogram;

/// <summary>
/// Gets or sets the values representing explicit histogram bucket
/// boundary values.
Expand All @@ -30,20 +26,5 @@ public class ExplicitBucketHistogramConfiguration : MetricStreamConfiguration
/// The array must be in ascending order with distinct values.
/// </remarks>
public double[] Boundaries { get; set; }

public override Aggregation Aggregation
{
get => this.aggregation;

set
{
if (value != Aggregation.Histogram)
{
throw new ArgumentException($"Aggregation must be Histogram.");
}

this.aggregation = value;
}
}
}
}
2 changes: 1 addition & 1 deletion src/OpenTelemetry/Metrics/Metric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ internal Metric(

internal bool InstrumentDisposed { get; set; }

public BatchMetricPoint GetMetricPoints()
public MetricPointsAccessor GetMetricPoints()
{
return this.aggStore.GetMetricPoints();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="BatchMetricPoint.cs" company="OpenTelemetry Authors">
// <copyright file="MetricPointsAccessor.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -20,15 +20,15 @@

namespace OpenTelemetry.Metrics
{
public readonly struct BatchMetricPoint : IDisposable
public readonly struct MetricPointsAccessor : IDisposable
{
private readonly MetricPoint[] metricsPoints;
private readonly int[] metricPointsToProcess;
private readonly long targetCount;
private readonly DateTimeOffset start;
private readonly DateTimeOffset end;

internal BatchMetricPoint(MetricPoint[] metricsPoints, int[] metricPointsToProcess, long targetCount, DateTimeOffset start, DateTimeOffset end)
internal MetricPointsAccessor(MetricPoint[] metricsPoints, int[] metricPointsToProcess, long targetCount, DateTimeOffset start, DateTimeOffset end)
{
Guard.Null(metricsPoints, nameof(metricsPoints));

Expand Down
6 changes: 3 additions & 3 deletions src/OpenTelemetry/Metrics/MetricStreamConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
namespace OpenTelemetry.Metrics
{
// TODO: can be optimized like MetricType
public enum Aggregation
internal enum Aggregation
{
#pragma warning disable SA1602 // Enumeration items should be documented
Default,
Expand All @@ -38,13 +38,13 @@ public class MetricStreamConfiguration

public string[] TagKeys { get; set; }

public virtual Aggregation Aggregation { get; set; }
internal virtual Aggregation Aggregation { get; set; }

// TODO: MetricPoints caps can be configured here

private sealed class DropConfiguration : MetricStreamConfiguration
{
public override Aggregation Aggregation
internal override Aggregation Aggregation
{
get => Aggregation.Drop;
set { }
Expand Down
7 changes: 5 additions & 2 deletions test/Benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@ Use the following example to run Benchmarks from command line:

Navigate to `./test/Benchmarks` directory and run the following command:

`dotnet run --framework netcoreapp3.1 --configuration Release --filter
*TraceBenchmarks*`
<!-- markdownlint-disable MD013 -->
```sh
dotnet run --framework netcoreapp3.1 --configuration Release --filter *TraceBenchmarks*
```
<!-- markdownlint-enable MD013 -->
3 changes: 0 additions & 3 deletions test/OpenTelemetry.Tests.Stress.Metrics/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,10 @@
// </copyright>

using System;
using System.Diagnostics;
using System.Diagnostics.Metrics;
using System.Runtime.CompilerServices;
using System.Threading;
using OpenTelemetry;
using OpenTelemetry.Metrics;
using OpenTelemetry.Tests;

namespace OpenTelemetry.Tests.Stress;

Expand Down
14 changes: 14 additions & 0 deletions test/OpenTelemetry.Tests.Stress.Metrics/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# OpenTelemetry Stress Tests for Metrics

This is Stress Test specifically for Metrics SDK, and is
based on the [OpenTelemetry.Tests.Stress](../OpenTelemetry.Tests.Stress/README.md).

* [Running the stress test](#running-the-stress-test)

## Running the stress test

Open a console, run the following command from the current folder:

```sh
dotnet run --framework net6.0 --configuration Release
```

0 comments on commit aefbf9d

Please sign in to comment.