Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove View public API to change aggregation as it is not supported #2660

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 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 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
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 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
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;
}
}
}
}
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