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

Metrics are obsolete #1611

Merged
merged 3 commits into from
Nov 24, 2020
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
1 change: 1 addition & 0 deletions examples/Console/Examples.Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<IsPackable>false</IsPackable>
<NoWarn>$(NoWarn),CS0618</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions src/OpenTelemetry.Api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
extension) will now be set as the `Unset`, `Error`, or `Ok` string
representation instead of the `0`, `1`, or `2` integer representation.
([#1579](https://github.com/open-telemetry/opentelemetry-dotnet/pull/1579))
* Metrics API/SDK support is in an experimental state and is not recommended for
production use. All metric APIs have been marked with the `Obsolete`
attribute. See
[#1501](https://github.com/open-telemetry/opentelemetry-dotnet/issues/1501)
for more information.
([#1611](https://github.com/open-telemetry/opentelemetry-dotnet/pull/1611))

## 1.0.0-rc1.1

Expand Down
3 changes: 3 additions & 0 deletions src/OpenTelemetry.Api/Metrics/BlankLabelSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@
// limitations under the License.
// </copyright>

using System;

namespace OpenTelemetry.Metrics
{
/// <summary>
/// Blank or No-op labelset.
/// </summary>
[Obsolete("Metrics API/SDK is not recommended for production. See https://github.com/open-telemetry/opentelemetry-dotnet/issues/1501 for more information on metrics support.")]
public sealed class BlankLabelSet : LabelSet
{
}
Expand Down
2 changes: 2 additions & 0 deletions src/OpenTelemetry.Api/Metrics/BoundCounterMetric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// limitations under the License.
// </copyright>

using System;
using OpenTelemetry.Trace;

namespace OpenTelemetry.Metrics
Expand All @@ -22,6 +23,7 @@ namespace OpenTelemetry.Metrics
/// Bound counter metric with the defined <see cref="LabelSet"/>.
/// </summary>
/// <typeparam name="T">The type of counter. Only long and double are supported now.</typeparam>
[Obsolete("Metrics API/SDK is not recommended for production. See https://github.com/open-telemetry/opentelemetry-dotnet/issues/1501 for more information on metrics support.")]
public abstract class BoundCounterMetric<T>
where T : struct
{
Expand Down
2 changes: 2 additions & 0 deletions src/OpenTelemetry.Api/Metrics/BoundMeasureMetric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// limitations under the License.
// </copyright>

using System;
using OpenTelemetry.Trace;

namespace OpenTelemetry.Metrics
Expand All @@ -22,6 +23,7 @@ namespace OpenTelemetry.Metrics
/// Bound measure metric with the defined <see cref="LabelSet"/>.
/// </summary>
/// <typeparam name="T">The type of Measure. Only long and double are supported now.</typeparam>
[Obsolete("Metrics API/SDK is not recommended for production. See https://github.com/open-telemetry/opentelemetry-dotnet/issues/1501 for more information on metrics support.")]
public abstract class BoundMeasureMetric<T>
where T : struct
{
Expand Down
2 changes: 2 additions & 0 deletions src/OpenTelemetry.Api/Metrics/CounterMetric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// limitations under the License.
// </copyright>

using System;
using System.Collections.Generic;
using OpenTelemetry.Trace;

Expand All @@ -23,6 +24,7 @@ namespace OpenTelemetry.Metrics
/// Counter instrument.
/// </summary>
/// <typeparam name="T">The type of counter. Only long and double are supported now.</typeparam>
[Obsolete("Metrics API/SDK is not recommended for production. See https://github.com/open-telemetry/opentelemetry-dotnet/issues/1501 for more information on metrics support.")]
public abstract class CounterMetric<T>
where T : struct
{
Expand Down
2 changes: 2 additions & 0 deletions src/OpenTelemetry.Api/Metrics/DoubleObserverMetric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
// limitations under the License.
// </copyright>

using System;
using System.Collections.Generic;

namespace OpenTelemetry.Metrics
{
/// <summary>
/// Observer instrument for Double values.
/// </summary>
[Obsolete("Metrics API/SDK is not recommended for production. See https://github.com/open-telemetry/opentelemetry-dotnet/issues/1501 for more information on metrics support.")]
public abstract class DoubleObserverMetric
{
/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions src/OpenTelemetry.Api/Metrics/DoubleObserverMetricHandle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@
// limitations under the License.
// </copyright>

using System;

namespace OpenTelemetry.Metrics
{
/// <summary>
/// Handle to the metrics observer with the defined <see cref="LabelSet"/>.
/// </summary>
[Obsolete("Metrics API/SDK is not recommended for production. See https://github.com/open-telemetry/opentelemetry-dotnet/issues/1501 for more information on metrics support.")]
public abstract class DoubleObserverMetricHandle
{
/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions src/OpenTelemetry.Api/Metrics/Int64ObserverMetric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
// limitations under the License.
// </copyright>

using System;
using System.Collections.Generic;

namespace OpenTelemetry.Metrics
{
/// <summary>
/// Observer instrument for Int64 values.
/// </summary>
[Obsolete("Metrics API/SDK is not recommended for production. See https://github.com/open-telemetry/opentelemetry-dotnet/issues/1501 for more information on metrics support.")]
public abstract class Int64ObserverMetric
{
/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions src/OpenTelemetry.Api/Metrics/Int64ObserverMetricHandle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@
// limitations under the License.
// </copyright>

using System;

namespace OpenTelemetry.Metrics
{
/// <summary>
/// Handle to the metrics observer with the defined <see cref="LabelSet"/>.
/// </summary>
[Obsolete("Metrics API/SDK is not recommended for production. See https://github.com/open-telemetry/opentelemetry-dotnet/issues/1501 for more information on metrics support.")]
public abstract class Int64ObserverMetricHandle
{
/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions src/OpenTelemetry.Api/Metrics/LabelSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>

using System;
using System.Collections.Generic;
using System.Linq;

Expand All @@ -21,6 +23,7 @@ namespace OpenTelemetry.Metrics
/// <summary>
/// Normalized name value pairs of metric labels.
/// </summary>
[Obsolete("Metrics API/SDK is not recommended for production. See https://github.com/open-telemetry/opentelemetry-dotnet/issues/1501 for more information on metrics support.")]
public abstract class LabelSet
{
/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions src/OpenTelemetry.Api/Metrics/MeasureMetric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// limitations under the License.
// </copyright>

using System;
using System.Collections.Generic;
using OpenTelemetry.Trace;

Expand All @@ -23,6 +24,7 @@ namespace OpenTelemetry.Metrics
/// Measure instrument.
/// </summary>
/// <typeparam name="T">The type of measure. Only long and double are supported now.</typeparam>
[Obsolete("Metrics API/SDK is not recommended for production. See https://github.com/open-telemetry/opentelemetry-dotnet/issues/1501 for more information on metrics support.")]
public abstract class MeasureMetric<T>
where T : struct
{
Expand Down
1 change: 1 addition & 0 deletions src/OpenTelemetry.Api/Metrics/Meter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace OpenTelemetry.Metrics
/// <summary>
/// Main interface to obtain metric instruments.
/// </summary>
[Obsolete("Metrics API/SDK is not recommended for production. See https://github.com/open-telemetry/opentelemetry-dotnet/issues/1501 for more information on metrics support.")]
public abstract class Meter
{
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions src/OpenTelemetry.Api/Metrics/MeterFactoryBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace OpenTelemetry.Metrics
/// Libraries should use this class as follows to obtain Meter instance.
/// MeterFactoryBase.Default.GetMeter("libraryname", "version").
/// </summary>
[Obsolete("Metrics API/SDK is not recommended for production. See https://github.com/open-telemetry/opentelemetry-dotnet/issues/1501 for more information on metrics support.")]
public class MeterFactoryBase
{
private static ProxyMeter proxyMeter = new ProxyMeter();
Expand Down
1 change: 1 addition & 0 deletions src/OpenTelemetry.Api/Metrics/MeterProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace OpenTelemetry.Metrics
/// <summary>
/// MeterProvider is the entry point of the OpenTelemetry Metrics API. It provides access to Meters.
/// </summary>
[Obsolete("Metrics API/SDK is not recommended for production. See https://github.com/open-telemetry/opentelemetry-dotnet/issues/1501 for more information on metrics support.")]
public class MeterProvider : BaseProvider
{
private static ProxyMeter proxyMeter = new ProxyMeter();
Expand Down
2 changes: 2 additions & 0 deletions src/OpenTelemetry.Api/Metrics/NoopBoundCounterMetric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// limitations under the License.
// </copyright>

using System;
using OpenTelemetry.Trace;

namespace OpenTelemetry.Metrics
Expand All @@ -22,6 +23,7 @@ namespace OpenTelemetry.Metrics
/// No-Op bound counter metric.
/// </summary>
/// <typeparam name="T">The type of counter. Only long and double are supported now.</typeparam>
[Obsolete("Metrics API/SDK is not recommended for production. See https://github.com/open-telemetry/opentelemetry-dotnet/issues/1501 for more information on metrics support.")]
public sealed class NoopBoundCounterMetric<T> : BoundCounterMetric<T>
where T : struct
{
Expand Down
2 changes: 2 additions & 0 deletions src/OpenTelemetry.Api/Metrics/NoopBoundMeasureMetric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// limitations under the License.
// </copyright>

using System;
using OpenTelemetry.Trace;

namespace OpenTelemetry.Metrics
Expand All @@ -22,6 +23,7 @@ namespace OpenTelemetry.Metrics
/// No op measure handle.
/// </summary>
/// <typeparam name="T">The type of Measure. Only long and double are supported now.</typeparam>
[Obsolete("Metrics API/SDK is not recommended for production. See https://github.com/open-telemetry/opentelemetry-dotnet/issues/1501 for more information on metrics support.")]
public sealed class NoopBoundMeasureMetric<T> : BoundMeasureMetric<T>
where T : struct
{
Expand Down
2 changes: 2 additions & 0 deletions src/OpenTelemetry.Api/Metrics/NoopCounterMetric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// limitations under the License.
// </copyright>

using System;
using System.Collections.Generic;
using OpenTelemetry.Trace;

Expand All @@ -23,6 +24,7 @@ namespace OpenTelemetry.Metrics
/// A no-op counter instrument.
/// </summary>
/// <typeparam name="T">The type of counter. Only long and double are supported now.</typeparam>
[Obsolete("Metrics API/SDK is not recommended for production. See https://github.com/open-telemetry/opentelemetry-dotnet/issues/1501 for more information on metrics support.")]
public sealed class NoopCounterMetric<T> : CounterMetric<T>
where T : struct
{
Expand Down
2 changes: 2 additions & 0 deletions src/OpenTelemetry.Api/Metrics/NoopDoubleObserverMetric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
// limitations under the License.
// </copyright>

using System;
using System.Collections.Generic;

namespace OpenTelemetry.Metrics
{
/// <summary>
/// A no-op observer instrument.
/// </summary>
[Obsolete("Metrics API/SDK is not recommended for production. See https://github.com/open-telemetry/opentelemetry-dotnet/issues/1501 for more information on metrics support.")]
public sealed class NoopDoubleObserverMetric : DoubleObserverMetric
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@
// limitations under the License.
// </copyright>

using System;

namespace OpenTelemetry.Metrics
{
/// <summary>
/// No-Op observer handle.
/// </summary>
[Obsolete("Metrics API/SDK is not recommended for production. See https://github.com/open-telemetry/opentelemetry-dotnet/issues/1501 for more information on metrics support.")]
public sealed class NoopDoubleObserverMetricHandle : DoubleObserverMetricHandle
{
/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions src/OpenTelemetry.Api/Metrics/NoopInt64ObserverMetric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
// limitations under the License.
// </copyright>

using System;
using System.Collections.Generic;

namespace OpenTelemetry.Metrics
{
/// <summary>
/// A no-op observer instrument.
/// </summary>
[Obsolete("Metrics API/SDK is not recommended for production. See https://github.com/open-telemetry/opentelemetry-dotnet/issues/1501 for more information on metrics support.")]
public sealed class NoopInt64ObserverMetric : Int64ObserverMetric
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@
// limitations under the License.
// </copyright>

using System;

namespace OpenTelemetry.Metrics
{
/// <summary>
/// No-Op observer handle.
/// </summary>
[Obsolete("Metrics API/SDK is not recommended for production. See https://github.com/open-telemetry/opentelemetry-dotnet/issues/1501 for more information on metrics support.")]
public sealed class NoopInt64ObserverMetricHandle : Int64ObserverMetricHandle
{
/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions src/OpenTelemetry.Api/Metrics/NoopMeasureMetric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// limitations under the License.
// </copyright>

using System;
using System.Collections.Generic;

namespace OpenTelemetry.Metrics
Expand All @@ -22,6 +23,7 @@ namespace OpenTelemetry.Metrics
/// No op measure instrument.
/// </summary>
/// <typeparam name="T">The type of counter. Only long and double are supported now.</typeparam>
[Obsolete("Metrics API/SDK is not recommended for production. See https://github.com/open-telemetry/opentelemetry-dotnet/issues/1501 for more information on metrics support.")]
public sealed class NoopMeasureMetric<T> : MeasureMetric<T>
where T : struct
{
Expand Down
2 changes: 2 additions & 0 deletions src/OpenTelemetry.Api/OpenTelemetry.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<TargetFrameworks>net452;netstandard2.0</TargetFrameworks>
<Description>OpenTelemetry .NET API</Description>
<RootNamespace>OpenTelemetry</RootNamespace>

<NoWarn>$(NoWarn),CS0618</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<TargetFrameworks>net452;net46;netstandard2.0</TargetFrameworks>
<Description>Prometheus exporter for OpenTelemetry .NET</Description>
<PackageTags>$(PackageTags);Prometheus</PackageTags>
<NoWarn>$(NoWarn),CS0618</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions src/OpenTelemetry/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
`AddEnvironmentVariableDetector`, `AddAttributes`, `AddService`, and
`AddTelemetrySdk`.
([#1576](https://github.com/open-telemetry/opentelemetry-dotnet/pull/1576))
* Metrics API/SDK support is in an experimental state and is not recommended for
production use. All metric APIs have been marked with the `Obsolete`
attribute. See
[#1501](https://github.com/open-telemetry/opentelemetry-dotnet/issues/1501)
for more information.
([#1611](https://github.com/open-telemetry/opentelemetry-dotnet/pull/1611))

## 1.0.0-rc1.1

Expand Down
1 change: 1 addition & 0 deletions src/OpenTelemetry/Metrics/Aggregators/Aggregator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ namespace OpenTelemetry.Metrics.Aggregators
/// Aggregator base class.
/// </summary>
/// <typeparam name="T">The type.</typeparam>
[Obsolete("Metrics API/SDK is not recommended for production. See https://github.com/open-telemetry/opentelemetry-dotnet/issues/1501 for more information on metrics support.")]
public abstract class Aggregator<T>
where T : struct
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ namespace OpenTelemetry.Metrics.Aggregators
/// <summary>
/// Basic aggregator which calculates a Sum from individual measurements.
/// </summary>
[Obsolete("Metrics API/SDK is not recommended for production. See https://github.com/open-telemetry/opentelemetry-dotnet/issues/1501 for more information on metrics support.")]
public class DoubleCounterSumAggregator : Aggregator<double>
{
private double sum;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ namespace OpenTelemetry.Metrics.Aggregators
/// <summary>
/// Simple aggregator that only keeps the last value.
/// </summary>
[Obsolete("Metrics API/SDK is not recommended for production. See https://github.com/open-telemetry/opentelemetry-dotnet/issues/1501 for more information on metrics support.")]
public class DoubleLastValueAggregator : Aggregator<double>
{
private double value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ namespace OpenTelemetry.Metrics.Aggregators
/// <summary>
/// Aggregator which calculates summary (Min,Max,Sum,Count) from measures.
/// </summary>
[Obsolete("Metrics API/SDK is not recommended for production. See https://github.com/open-telemetry/opentelemetry-dotnet/issues/1501 for more information on metrics support.")]
public class DoubleMeasureMinMaxSumCountAggregator : Aggregator<double>
{
private DoubleSummary summary = new DoubleSummary();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ namespace OpenTelemetry.Metrics.Aggregators
/// <summary>
/// Basic aggregator which calculates a Sum from individual measurements.
/// </summary>
[Obsolete("Metrics API/SDK is not recommended for production. See https://github.com/open-telemetry/opentelemetry-dotnet/issues/1501 for more information on metrics support.")]
public class Int64CounterSumAggregator : Aggregator<long>
{
private long sum;
Expand Down
Loading