Remove metrics from 1.0.0 release (#1743)

* Remove metrics from 1.0.0 release

* remove docs for metrics

* public api change
This commit is contained in:
Cijo Thomas 2021-01-29 10:05:50 -08:00 committed by GitHub
parent ccc191f0c6
commit 29995ec245
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
114 changed files with 8 additions and 7575 deletions

View File

@ -42,8 +42,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Exporter.Zipk
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Api", "src\OpenTelemetry.Api\OpenTelemetry.Api.csproj", "{99F8A331-05E9-45A5-89BA-4C54E825E5B2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Exporter.Prometheus", "src\OpenTelemetry.Exporter.Prometheus\OpenTelemetry.Exporter.Prometheus.csproj", "{AD9B2B54-EC9C-448E-BD3C-EDCC3F7AD022}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Instrumentation.AspNetCore", "src\OpenTelemetry.Instrumentation.AspNetCore\OpenTelemetry.Instrumentation.AspNetCore.csproj", "{752D2182-A351-41D8-99EE-DD363D7D5B43}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Instrumentation.AspNetCore.Tests", "test\OpenTelemetry.Instrumentation.AspNetCore.Tests\OpenTelemetry.Instrumentation.AspNetCore.Tests.csproj", "{2A47F6A8-63E5-4237-8046-94CAF321E797}"
@ -74,8 +72,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Extensions.Ho
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Exporter.OpenTelemetryProtocol", "src\OpenTelemetry.Exporter.OpenTelemetryProtocol\OpenTelemetry.Exporter.OpenTelemetryProtocol.csproj", "{A38AC295-2745-4B85-8B6B-DCA864CEDD5B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Exporter.Prometheus.Tests", "test\OpenTelemetry.Exporter.Prometheus.Tests\OpenTelemetry.Exporter.Prometheus.Tests.csproj", "{393128EC-454D-45E8-A204-EC54904E5B3F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Exporter.ZPages", "src\OpenTelemetry.Exporter.ZPages\OpenTelemetry.Exporter.ZPages.csproj", "{56A34828-621A-478B-A0B8-C065FE938383}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Exporter.Console", "src\OpenTelemetry.Exporter.Console\OpenTelemetry.Exporter.Console.csproj", "{1AFFF251-3B0C-47CA-BE94-937083732C0A}"
@ -162,12 +158,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "trace", "trace", "{5B7FB835
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "getting-started", "docs\trace\getting-started\getting-started.csproj", "{BE60E3D5-DE30-4BAB-8E7A-63B21D0E80D7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "metrics", "metrics", "{3277B1C0-BDFE-4460-9B0D-D9A661FB48DB}"
ProjectSection(SolutionItems) = preProject
docs\metrics\building-your-own-exporter.md = docs\metrics\building-your-own-exporter.md
docs\metrics\getting-started.md = docs\metrics\getting-started.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "logs", "logs", "{3862190B-E2C5-418E-AFDC-DB281FB5C705}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MicroserviceExample", "MicroserviceExample", "{4D492D62-5150-45F9-817F-C99562E364E2}"
@ -228,10 +218,6 @@ Global
{99F8A331-05E9-45A5-89BA-4C54E825E5B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{99F8A331-05E9-45A5-89BA-4C54E825E5B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{99F8A331-05E9-45A5-89BA-4C54E825E5B2}.Release|Any CPU.Build.0 = Release|Any CPU
{AD9B2B54-EC9C-448E-BD3C-EDCC3F7AD022}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AD9B2B54-EC9C-448E-BD3C-EDCC3F7AD022}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AD9B2B54-EC9C-448E-BD3C-EDCC3F7AD022}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AD9B2B54-EC9C-448E-BD3C-EDCC3F7AD022}.Release|Any CPU.Build.0 = Release|Any CPU
{752D2182-A351-41D8-99EE-DD363D7D5B43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{752D2182-A351-41D8-99EE-DD363D7D5B43}.Debug|Any CPU.Build.0 = Debug|Any CPU
{752D2182-A351-41D8-99EE-DD363D7D5B43}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -280,10 +266,6 @@ Global
{A38AC295-2745-4B85-8B6B-DCA864CEDD5B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A38AC295-2745-4B85-8B6B-DCA864CEDD5B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A38AC295-2745-4B85-8B6B-DCA864CEDD5B}.Release|Any CPU.Build.0 = Release|Any CPU
{393128EC-454D-45E8-A204-EC54904E5B3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{393128EC-454D-45E8-A204-EC54904E5B3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{393128EC-454D-45E8-A204-EC54904E5B3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{393128EC-454D-45E8-A204-EC54904E5B3F}.Release|Any CPU.Build.0 = Release|Any CPU
{56A34828-621A-478B-A0B8-C065FE938383}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{56A34828-621A-478B-A0B8-C065FE938383}.Debug|Any CPU.Build.0 = Debug|Any CPU
{56A34828-621A-478B-A0B8-C065FE938383}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -422,7 +404,6 @@ Global
{2C7DD1DA-C229-4D9E-9AF0-BCD5CD3E4948} = {7CB2F02E-03FA-4FFF-89A5-C51F107623FD}
{5B7FB835-3FFF-4BC2-99C5-A5B5FAE3C818} = {7C87CAF9-79D7-4C26-9FFB-F3F1FB6911F1}
{BE60E3D5-DE30-4BAB-8E7A-63B21D0E80D7} = {5B7FB835-3FFF-4BC2-99C5-A5B5FAE3C818}
{3277B1C0-BDFE-4460-9B0D-D9A661FB48DB} = {7C87CAF9-79D7-4C26-9FFB-F3F1FB6911F1}
{3862190B-E2C5-418E-AFDC-DB281FB5C705} = {7C87CAF9-79D7-4C26-9FFB-F3F1FB6911F1}
{4D492D62-5150-45F9-817F-C99562E364E2} = {E359BB2B-9AEC-497D-B321-7DF2450C3B8E}
{07336602-860B-4975-95DD-405D19C00901} = {4D492D62-5150-45F9-817F-C99562E364E2}

View File

@ -23,7 +23,6 @@ Framework](https://dotnet.microsoft.com/download/dotnet-framework) except for
If you are new here, please see getting started docs for
[logs](./docs/logs/getting-started/README.md),
[metrics](./docs/metrics/getting-started.md), and
[trace](./docs/trace/getting-started/README.md).
This repository includes multiple installable components, available on
@ -55,7 +54,6 @@ libraries](https://github.com/open-telemetry/opentelemetry-specification/blob/ma
* [Jaeger](./src/OpenTelemetry.Exporter.Jaeger/README.md)
* [OTLP](./src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md)
(OpenTelemetry Protocol)
* [Prometheus](./src/OpenTelemetry.Exporter.Prometheus/README.md)
* [Zipkin](./src/OpenTelemetry.Exporter.Zipkin/README.md)
See the [OpenTelemetry registry](https://opentelemetry.io/registry/?s=net) for

View File

@ -1,3 +0,0 @@
# Building your own Exporter
Under construction.

View File

@ -1,17 +0,0 @@
# Getting Started with OpenTelemetry .NET for Metrics in 5 Minutes
## IMPORTANT NOTE
Metrics API and SDK is in alpha/experimental stage, and are not recommended for
any production use. Both the API, and SDK implementation is subject to
significant changes.
Please check the [Metric support
plan](https://github.com/open-telemetry/opentelemetry-dotnet/issues/1501).
## Sample usage
Check
[TestPrometheusExporter.cs](../../examples/Console/TestPrometheusExporter.cs)
for an example usage of currently implemented Metrics API/SDK along with
Prometheus exporter.

View File

@ -30,7 +30,6 @@
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Instrumentation.StackExchangeRedis\OpenTelemetry.Instrumentation.StackExchangeRedis.csproj" />
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.Console\OpenTelemetry.Exporter.Console.csproj" />
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.OpenTelemetryProtocol\OpenTelemetry.Exporter.OpenTelemetryProtocol.csproj" />
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.Prometheus\OpenTelemetry.Exporter.Prometheus.csproj" />
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.ZPages\OpenTelemetry.Exporter.ZPages.csproj" />
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Shims.OpenTracing\OpenTelemetry.Shims.OpenTracing.csproj" />
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry\OpenTelemetry.csproj" />

View File

@ -41,11 +41,10 @@ namespace Examples.Console
/// <param name="args">Arguments from command line.</param>
public static void Main(string[] args)
{
Parser.Default.ParseArguments<JaegerOptions, ZipkinOptions, PrometheusOptions, GrpcNetClientOptions, HttpClientOptions, RedisOptions, ZPagesOptions, ConsoleOptions, OpenTelemetryShimOptions, OpenTracingShimOptions, OtlpOptions, InMemoryOptions>(args)
Parser.Default.ParseArguments<JaegerOptions, ZipkinOptions, GrpcNetClientOptions, HttpClientOptions, RedisOptions, ZPagesOptions, ConsoleOptions, OpenTelemetryShimOptions, OpenTracingShimOptions, OtlpOptions, InMemoryOptions>(args)
.MapResult(
(JaegerOptions options) => TestJaegerExporter.Run(options.Host, options.Port),
(ZipkinOptions options) => TestZipkinExporter.Run(options.Uri),
(PrometheusOptions options) => TestPrometheusExporter.RunAsync(options.Port, options.PushIntervalInSecs, options.DurationInMins),
(GrpcNetClientOptions options) => TestGrpcNetClient.Run(),
(HttpClientOptions options) => TestHttpClient.Run(),
(RedisOptions options) => TestRedis.Run(options.Uri),
@ -80,19 +79,6 @@ namespace Examples.Console
public string Uri { get; set; }
}
[Verb("prometheus", HelpText = "Specify the options required to test Prometheus")]
internal class PrometheusOptions
{
[Option('i', "pushIntervalInSecs", Default = 15, HelpText = "The interval at which Push controller pushes metrics.", Required = false)]
public int PushIntervalInSecs { get; set; }
[Option('p', "port", Default = 9184, HelpText = "The port to expose metrics. The endpoint will be http://localhost:port/metrics (This is the port from which your Prometheus server scraps metrics from.)", Required = false)]
public int Port { get; set; }
[Option('d', "duration", Default = 2, HelpText = "Total duration in minutes to run the demo. Run atleast for a min to see metrics flowing.", Required = false)]
public int DurationInMins { get; set; }
}
[Verb("grpc", HelpText = "Specify the options required to test Grpc.Net.Client")]
internal class GrpcNetClientOptions
{

View File

@ -1,118 +0,0 @@
// <copyright file="TestPrometheusExporter.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
using OpenTelemetry;
using OpenTelemetry.Exporter.Prometheus;
using OpenTelemetry.Metrics;
using OpenTelemetry.Metrics.Export;
using OpenTelemetry.Trace;
namespace Examples.Console
{
internal class TestPrometheusExporter
{
internal static async Task<object> RunAsync(int port, int pushIntervalInSecs, int totalDurationInMins)
{
System.Console.WriteLine($"OpenTelemetry Prometheus Exporter is making metrics available at http://localhost:{port}/metrics/");
/*
Following is sample prometheus.yml config. Adjust port,interval as needed.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'OpenTelemetryTest'
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs:
- targets: ['localhost:9184']
*/
// Create and Setup Prometheus Exporter
var promOptions = new PrometheusExporterOptions() { Url = $"http://localhost:{port}/metrics/" };
var promExporter = new PrometheusExporter(promOptions);
var metricsHttpServer = new PrometheusExporterMetricsHttpServer(promExporter);
metricsHttpServer.Start();
// Create Processor (called Batcher in Metric spec, this is still not decided)
var processor = new UngroupedBatcher();
// Application which decides to enable OpenTelemetry metrics
// would setup a MeterProvider and make it default.
// All meters from this factory will be configured with the common processing pipeline.
MeterProvider.SetDefault(Sdk.CreateMeterProviderBuilder()
.SetProcessor(processor)
.SetExporter(promExporter)
.SetPushInterval(TimeSpan.FromSeconds(pushIntervalInSecs))
.Build());
// The following shows how libraries would obtain a MeterProvider.
// MeterProvider is the entry point, which provides Meter.
// If user did not set the Default MeterProvider (shown in earlier lines),
// all metric operations become no-ops.
var meterProvider = MeterProvider.Default;
var meter = meterProvider.GetMeter("MyMeter");
// the rest is purely from Metrics API.
var testCounter = meter.CreateInt64Counter("MyCounter");
var testMeasure = meter.CreateInt64Measure("MyMeasure");
var testObserver = meter.CreateInt64Observer("MyObservation", CallBackForMyObservation);
var labels1 = new List<KeyValuePair<string, string>>();
labels1.Add(new KeyValuePair<string, string>("dim1", "value1"));
var labels2 = new List<KeyValuePair<string, string>>();
labels2.Add(new KeyValuePair<string, string>("dim1", "value2"));
var defaultContext = default(SpanContext);
Stopwatch sw = Stopwatch.StartNew();
while (sw.Elapsed.TotalMinutes < totalDurationInMins)
{
testCounter.Add(defaultContext, 100, meter.GetLabelSet(labels1));
testMeasure.Record(defaultContext, 100, meter.GetLabelSet(labels1));
testMeasure.Record(defaultContext, 500, meter.GetLabelSet(labels1));
testMeasure.Record(defaultContext, 5, meter.GetLabelSet(labels1));
testMeasure.Record(defaultContext, 750, meter.GetLabelSet(labels1));
// Obviously there is no testObserver.Oberve() here, as Observer instruments
// have callbacks that are called by the Meter automatically at each collection interval.
await Task.Delay(1000);
var remaining = (totalDurationInMins * 60) - sw.Elapsed.TotalSeconds;
System.Console.WriteLine("Running and emitting metrics. Remaining time:" + (int)remaining + " seconds");
}
// Stopping
metricsHttpServer.Stop();
System.Console.WriteLine("Metrics server shutdown.");
System.Console.WriteLine("Press Enter key to exit.");
return null;
}
internal static void CallBackForMyObservation(Int64ObserverMetric observerMetric)
{
var labels1 = new List<KeyValuePair<string, string>>();
labels1.Add(new KeyValuePair<string, string>("dim1", "value1"));
observerMetric.Observe(Process.GetCurrentProcess().WorkingSet64, labels1);
}
}
}

View File

@ -47,52 +47,6 @@ OpenTelemetry.Context.RuntimeContextSlot<T>.Name.get -> string
OpenTelemetry.Context.RuntimeContextSlot<T>.RuntimeContextSlot(string name) -> void
OpenTelemetry.Context.ThreadLocalRuntimeContextSlot<T>
OpenTelemetry.Context.ThreadLocalRuntimeContextSlot<T>.ThreadLocalRuntimeContextSlot(string name) -> void
OpenTelemetry.Metrics.BlankLabelSet
OpenTelemetry.Metrics.BlankLabelSet.BlankLabelSet() -> void
OpenTelemetry.Metrics.BoundCounterMetric<T>
OpenTelemetry.Metrics.BoundCounterMetric<T>.BoundCounterMetric() -> void
OpenTelemetry.Metrics.BoundMeasureMetric<T>
OpenTelemetry.Metrics.BoundMeasureMetric<T>.BoundMeasureMetric() -> void
OpenTelemetry.Metrics.CounterMetric<T>
OpenTelemetry.Metrics.CounterMetric<T>.CounterMetric() -> void
OpenTelemetry.Metrics.DoubleObserverMetric
OpenTelemetry.Metrics.DoubleObserverMetric.DoubleObserverMetric() -> void
OpenTelemetry.Metrics.DoubleObserverMetricHandle
OpenTelemetry.Metrics.DoubleObserverMetricHandle.DoubleObserverMetricHandle() -> void
OpenTelemetry.Metrics.Int64ObserverMetric
OpenTelemetry.Metrics.Int64ObserverMetric.Int64ObserverMetric() -> void
OpenTelemetry.Metrics.Int64ObserverMetricHandle
OpenTelemetry.Metrics.Int64ObserverMetricHandle.Int64ObserverMetricHandle() -> void
OpenTelemetry.Metrics.LabelSet
OpenTelemetry.Metrics.LabelSet.LabelSet() -> void
OpenTelemetry.Metrics.MeasureMetric<T>
OpenTelemetry.Metrics.MeasureMetric<T>.MeasureMetric() -> void
OpenTelemetry.Metrics.MeasureMetric<T>.Record(in OpenTelemetry.Baggage context, T value, OpenTelemetry.Metrics.LabelSet labelset) -> void
OpenTelemetry.Metrics.MeasureMetric<T>.Record(in OpenTelemetry.Baggage context, T value, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> void
OpenTelemetry.Metrics.MeasureMetric<T>.Record(in OpenTelemetry.Trace.SpanContext context, T value, OpenTelemetry.Metrics.LabelSet labelset) -> void
OpenTelemetry.Metrics.MeasureMetric<T>.Record(in OpenTelemetry.Trace.SpanContext context, T value, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> void
OpenTelemetry.Metrics.Meter
OpenTelemetry.Metrics.Meter.Meter() -> void
OpenTelemetry.Metrics.MeterFactoryBase
OpenTelemetry.Metrics.MeterFactoryBase.MeterFactoryBase() -> void
OpenTelemetry.Metrics.MeterProvider
OpenTelemetry.Metrics.MeterProvider.MeterProvider() -> void
OpenTelemetry.Metrics.NoopBoundCounterMetric<T>
OpenTelemetry.Metrics.NoopBoundCounterMetric<T>.NoopBoundCounterMetric() -> void
OpenTelemetry.Metrics.NoopBoundMeasureMetric<T>
OpenTelemetry.Metrics.NoopBoundMeasureMetric<T>.NoopBoundMeasureMetric() -> void
OpenTelemetry.Metrics.NoopCounterMetric<T>
OpenTelemetry.Metrics.NoopCounterMetric<T>.NoopCounterMetric() -> void
OpenTelemetry.Metrics.NoopDoubleObserverMetric
OpenTelemetry.Metrics.NoopDoubleObserverMetric.NoopDoubleObserverMetric() -> void
OpenTelemetry.Metrics.NoopDoubleObserverMetricHandle
OpenTelemetry.Metrics.NoopDoubleObserverMetricHandle.NoopDoubleObserverMetricHandle() -> void
OpenTelemetry.Metrics.NoopInt64ObserverMetric
OpenTelemetry.Metrics.NoopInt64ObserverMetric.NoopInt64ObserverMetric() -> void
OpenTelemetry.Metrics.NoopInt64ObserverMetricHandle
OpenTelemetry.Metrics.NoopInt64ObserverMetricHandle.NoopInt64ObserverMetricHandle() -> void
OpenTelemetry.Metrics.NoopMeasureMetric<T>
OpenTelemetry.Metrics.NoopMeasureMetric<T>.NoopMeasureMetric() -> void
OpenTelemetry.Trace.ActivityExtensions
OpenTelemetry.Trace.Link
OpenTelemetry.Trace.Link.Attributes.get -> System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, object>>
@ -172,31 +126,6 @@ OpenTelemetry.Trace.TracerProvider.GetTracer(string name, string version = null)
OpenTelemetry.Trace.TracerProvider.TracerProvider() -> void
abstract OpenTelemetry.Context.RuntimeContextSlot<T>.Get() -> T
abstract OpenTelemetry.Context.RuntimeContextSlot<T>.Set(T value) -> void
abstract OpenTelemetry.Metrics.BoundCounterMetric<T>.Add(in OpenTelemetry.Baggage context, T value) -> void
abstract OpenTelemetry.Metrics.BoundCounterMetric<T>.Add(in OpenTelemetry.Trace.SpanContext context, T value) -> void
abstract OpenTelemetry.Metrics.BoundMeasureMetric<T>.Record(in OpenTelemetry.Baggage context, T value) -> void
abstract OpenTelemetry.Metrics.BoundMeasureMetric<T>.Record(in OpenTelemetry.Trace.SpanContext context, T value) -> void
abstract OpenTelemetry.Metrics.CounterMetric<T>.Add(in OpenTelemetry.Baggage context, T value, OpenTelemetry.Metrics.LabelSet labelset) -> void
abstract OpenTelemetry.Metrics.CounterMetric<T>.Add(in OpenTelemetry.Baggage context, T value, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> void
abstract OpenTelemetry.Metrics.CounterMetric<T>.Add(in OpenTelemetry.Trace.SpanContext context, T value, OpenTelemetry.Metrics.LabelSet labelset) -> void
abstract OpenTelemetry.Metrics.CounterMetric<T>.Add(in OpenTelemetry.Trace.SpanContext context, T value, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> void
abstract OpenTelemetry.Metrics.CounterMetric<T>.Bind(OpenTelemetry.Metrics.LabelSet labelset) -> OpenTelemetry.Metrics.BoundCounterMetric<T>
abstract OpenTelemetry.Metrics.CounterMetric<T>.Bind(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> OpenTelemetry.Metrics.BoundCounterMetric<T>
abstract OpenTelemetry.Metrics.DoubleObserverMetric.Observe(double value, OpenTelemetry.Metrics.LabelSet labelset) -> void
abstract OpenTelemetry.Metrics.DoubleObserverMetric.Observe(double value, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> void
abstract OpenTelemetry.Metrics.DoubleObserverMetricHandle.Observe(double value) -> void
abstract OpenTelemetry.Metrics.Int64ObserverMetric.Observe(long value, OpenTelemetry.Metrics.LabelSet labelset) -> void
abstract OpenTelemetry.Metrics.Int64ObserverMetric.Observe(long value, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> void
abstract OpenTelemetry.Metrics.Int64ObserverMetricHandle.Observe(long value) -> void
abstract OpenTelemetry.Metrics.MeasureMetric<T>.Bind(OpenTelemetry.Metrics.LabelSet labelset) -> OpenTelemetry.Metrics.BoundMeasureMetric<T>
abstract OpenTelemetry.Metrics.MeasureMetric<T>.Bind(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> OpenTelemetry.Metrics.BoundMeasureMetric<T>
abstract OpenTelemetry.Metrics.Meter.CreateDoubleCounter(string name, bool monotonic = true) -> OpenTelemetry.Metrics.CounterMetric<double>
abstract OpenTelemetry.Metrics.Meter.CreateDoubleMeasure(string name, bool absolute = true) -> OpenTelemetry.Metrics.MeasureMetric<double>
abstract OpenTelemetry.Metrics.Meter.CreateDoubleObserver(string name, System.Action<OpenTelemetry.Metrics.DoubleObserverMetric> callback, bool absolute = true) -> OpenTelemetry.Metrics.DoubleObserverMetric
abstract OpenTelemetry.Metrics.Meter.CreateInt64Counter(string name, bool monotonic = true) -> OpenTelemetry.Metrics.CounterMetric<long>
abstract OpenTelemetry.Metrics.Meter.CreateInt64Measure(string name, bool absolute = true) -> OpenTelemetry.Metrics.MeasureMetric<long>
abstract OpenTelemetry.Metrics.Meter.CreateInt64Observer(string name, System.Action<OpenTelemetry.Metrics.Int64ObserverMetric> callback, bool absolute = true) -> OpenTelemetry.Metrics.Int64ObserverMetric
abstract OpenTelemetry.Metrics.Meter.GetLabelSet(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> OpenTelemetry.Metrics.LabelSet
OpenTelemetry.Trace.TracerProviderBuilder
override OpenTelemetry.Baggage.Equals(object obj) -> bool
override OpenTelemetry.Baggage.GetHashCode() -> int
@ -219,24 +148,6 @@ override OpenTelemetry.Context.RemotingRuntimeContextSlot<T>.Set(T value) -> voi
override OpenTelemetry.Context.ThreadLocalRuntimeContextSlot<T>.Dispose(bool disposing) -> void
override OpenTelemetry.Context.ThreadLocalRuntimeContextSlot<T>.Get() -> T
override OpenTelemetry.Context.ThreadLocalRuntimeContextSlot<T>.Set(T value) -> void
override OpenTelemetry.Metrics.NoopBoundCounterMetric<T>.Add(in OpenTelemetry.Baggage context, T value) -> void
override OpenTelemetry.Metrics.NoopBoundCounterMetric<T>.Add(in OpenTelemetry.Trace.SpanContext context, T value) -> void
override OpenTelemetry.Metrics.NoopBoundMeasureMetric<T>.Record(in OpenTelemetry.Baggage context, T value) -> void
override OpenTelemetry.Metrics.NoopBoundMeasureMetric<T>.Record(in OpenTelemetry.Trace.SpanContext context, T value) -> void
override OpenTelemetry.Metrics.NoopCounterMetric<T>.Add(in OpenTelemetry.Baggage context, T value, OpenTelemetry.Metrics.LabelSet labelset) -> void
override OpenTelemetry.Metrics.NoopCounterMetric<T>.Add(in OpenTelemetry.Baggage context, T value, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> void
override OpenTelemetry.Metrics.NoopCounterMetric<T>.Add(in OpenTelemetry.Trace.SpanContext context, T value, OpenTelemetry.Metrics.LabelSet labelset) -> void
override OpenTelemetry.Metrics.NoopCounterMetric<T>.Add(in OpenTelemetry.Trace.SpanContext context, T value, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> void
override OpenTelemetry.Metrics.NoopCounterMetric<T>.Bind(OpenTelemetry.Metrics.LabelSet labelset) -> OpenTelemetry.Metrics.BoundCounterMetric<T>
override OpenTelemetry.Metrics.NoopCounterMetric<T>.Bind(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> OpenTelemetry.Metrics.BoundCounterMetric<T>
override OpenTelemetry.Metrics.NoopDoubleObserverMetric.Observe(double value, OpenTelemetry.Metrics.LabelSet labelset) -> void
override OpenTelemetry.Metrics.NoopDoubleObserverMetric.Observe(double value, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> void
override OpenTelemetry.Metrics.NoopDoubleObserverMetricHandle.Observe(double value) -> void
override OpenTelemetry.Metrics.NoopInt64ObserverMetric.Observe(long value, OpenTelemetry.Metrics.LabelSet labelset) -> void
override OpenTelemetry.Metrics.NoopInt64ObserverMetric.Observe(long value, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> void
override OpenTelemetry.Metrics.NoopInt64ObserverMetricHandle.Observe(long value) -> void
override OpenTelemetry.Metrics.NoopMeasureMetric<T>.Bind(OpenTelemetry.Metrics.LabelSet labelset) -> OpenTelemetry.Metrics.BoundMeasureMetric<T>
override OpenTelemetry.Metrics.NoopMeasureMetric<T>.Bind(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> OpenTelemetry.Metrics.BoundMeasureMetric<T>
override OpenTelemetry.Trace.Link.Equals(object obj) -> bool
override OpenTelemetry.Trace.Link.GetHashCode() -> int
override OpenTelemetry.Trace.SpanContext.Equals(object obj) -> bool
@ -266,10 +177,6 @@ static OpenTelemetry.Context.RuntimeContext.GetSlot<T>(string slotName) -> OpenT
static OpenTelemetry.Context.RuntimeContext.GetValue<T>(string name) -> T
static OpenTelemetry.Context.RuntimeContext.RegisterSlot<T>(string slotName) -> OpenTelemetry.Context.RuntimeContextSlot<T>
static OpenTelemetry.Context.RuntimeContext.SetValue<T>(string name, T value) -> void
static OpenTelemetry.Metrics.MeterFactoryBase.Default.get -> OpenTelemetry.Metrics.MeterFactoryBase
static OpenTelemetry.Metrics.MeterFactoryBase.SetDefault(OpenTelemetry.Metrics.MeterFactoryBase meterFactory) -> void
static OpenTelemetry.Metrics.MeterProvider.Default.get -> OpenTelemetry.Metrics.MeterProvider
static OpenTelemetry.Metrics.MeterProvider.SetDefault(OpenTelemetry.Metrics.MeterProvider meterProvider) -> void
static OpenTelemetry.Trace.ActivityExtensions.GetStatus(this System.Diagnostics.Activity activity) -> OpenTelemetry.Trace.Status
static OpenTelemetry.Trace.ActivityExtensions.RecordException(this System.Diagnostics.Activity activity, System.Exception ex) -> void
static OpenTelemetry.Trace.ActivityExtensions.SetStatus(this System.Diagnostics.Activity activity, OpenTelemetry.Trace.Status status) -> void
@ -283,21 +190,9 @@ static OpenTelemetry.Trace.Status.operator ==(OpenTelemetry.Trace.Status status1
static OpenTelemetry.Trace.Tracer.CurrentSpan.get -> OpenTelemetry.Trace.TelemetrySpan
static OpenTelemetry.Trace.Tracer.WithSpan(OpenTelemetry.Trace.TelemetrySpan span) -> OpenTelemetry.Trace.TelemetrySpan
static OpenTelemetry.Trace.TracerProvider.Default.get -> OpenTelemetry.Trace.TracerProvider
static readonly OpenTelemetry.Metrics.LabelSet.BlankLabelSet -> OpenTelemetry.Metrics.LabelSet
static readonly OpenTelemetry.Metrics.NoopBoundCounterMetric<T>.Instance -> OpenTelemetry.Metrics.NoopBoundCounterMetric<T>
static readonly OpenTelemetry.Metrics.NoopBoundMeasureMetric<T>.Instance -> OpenTelemetry.Metrics.NoopBoundMeasureMetric<T>
static readonly OpenTelemetry.Metrics.NoopCounterMetric<T>.Instance -> OpenTelemetry.Metrics.NoopCounterMetric<T>
static readonly OpenTelemetry.Metrics.NoopDoubleObserverMetric.Instance -> OpenTelemetry.Metrics.NoopDoubleObserverMetric
static readonly OpenTelemetry.Metrics.NoopDoubleObserverMetricHandle.Instance -> OpenTelemetry.Metrics.NoopDoubleObserverMetricHandle
static readonly OpenTelemetry.Metrics.NoopInt64ObserverMetric.Instance -> OpenTelemetry.Metrics.Int64ObserverMetric
static readonly OpenTelemetry.Metrics.NoopInt64ObserverMetricHandle.Instance -> OpenTelemetry.Metrics.NoopInt64ObserverMetricHandle
static readonly OpenTelemetry.Metrics.NoopMeasureMetric<T>.Instance -> OpenTelemetry.Metrics.NoopMeasureMetric<T>
static readonly OpenTelemetry.Trace.Status.Error -> OpenTelemetry.Trace.Status
static readonly OpenTelemetry.Trace.Status.Ok -> OpenTelemetry.Trace.Status
static readonly OpenTelemetry.Trace.Status.Unset -> OpenTelemetry.Trace.Status
virtual OpenTelemetry.BaseProvider.Dispose(bool disposing) -> void
virtual OpenTelemetry.Context.RuntimeContextSlot<T>.Dispose(bool disposing) -> void
virtual OpenTelemetry.Metrics.LabelSet.Labels.get -> System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>>
virtual OpenTelemetry.Metrics.LabelSet.Labels.set -> void
virtual OpenTelemetry.Metrics.MeterFactoryBase.GetMeter(string name, string version = null) -> OpenTelemetry.Metrics.Meter
virtual OpenTelemetry.Metrics.MeterProvider.GetMeter(string name, string version = null) -> OpenTelemetry.Metrics.Meter

View File

@ -47,52 +47,6 @@ OpenTelemetry.Context.RuntimeContextSlot<T>.Name.get -> string
OpenTelemetry.Context.RuntimeContextSlot<T>.RuntimeContextSlot(string name) -> void
OpenTelemetry.Context.ThreadLocalRuntimeContextSlot<T>
OpenTelemetry.Context.ThreadLocalRuntimeContextSlot<T>.ThreadLocalRuntimeContextSlot(string name) -> void
OpenTelemetry.Metrics.BlankLabelSet
OpenTelemetry.Metrics.BlankLabelSet.BlankLabelSet() -> void
OpenTelemetry.Metrics.BoundCounterMetric<T>
OpenTelemetry.Metrics.BoundCounterMetric<T>.BoundCounterMetric() -> void
OpenTelemetry.Metrics.BoundMeasureMetric<T>
OpenTelemetry.Metrics.BoundMeasureMetric<T>.BoundMeasureMetric() -> void
OpenTelemetry.Metrics.CounterMetric<T>
OpenTelemetry.Metrics.CounterMetric<T>.CounterMetric() -> void
OpenTelemetry.Metrics.DoubleObserverMetric
OpenTelemetry.Metrics.DoubleObserverMetric.DoubleObserverMetric() -> void
OpenTelemetry.Metrics.DoubleObserverMetricHandle
OpenTelemetry.Metrics.DoubleObserverMetricHandle.DoubleObserverMetricHandle() -> void
OpenTelemetry.Metrics.Int64ObserverMetric
OpenTelemetry.Metrics.Int64ObserverMetric.Int64ObserverMetric() -> void
OpenTelemetry.Metrics.Int64ObserverMetricHandle
OpenTelemetry.Metrics.Int64ObserverMetricHandle.Int64ObserverMetricHandle() -> void
OpenTelemetry.Metrics.LabelSet
OpenTelemetry.Metrics.LabelSet.LabelSet() -> void
OpenTelemetry.Metrics.MeasureMetric<T>
OpenTelemetry.Metrics.MeasureMetric<T>.MeasureMetric() -> void
OpenTelemetry.Metrics.MeasureMetric<T>.Record(in OpenTelemetry.Baggage context, T value, OpenTelemetry.Metrics.LabelSet labelset) -> void
OpenTelemetry.Metrics.MeasureMetric<T>.Record(in OpenTelemetry.Baggage context, T value, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> void
OpenTelemetry.Metrics.MeasureMetric<T>.Record(in OpenTelemetry.Trace.SpanContext context, T value, OpenTelemetry.Metrics.LabelSet labelset) -> void
OpenTelemetry.Metrics.MeasureMetric<T>.Record(in OpenTelemetry.Trace.SpanContext context, T value, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> void
OpenTelemetry.Metrics.Meter
OpenTelemetry.Metrics.Meter.Meter() -> void
OpenTelemetry.Metrics.MeterFactoryBase
OpenTelemetry.Metrics.MeterFactoryBase.MeterFactoryBase() -> void
OpenTelemetry.Metrics.MeterProvider
OpenTelemetry.Metrics.MeterProvider.MeterProvider() -> void
OpenTelemetry.Metrics.NoopBoundCounterMetric<T>
OpenTelemetry.Metrics.NoopBoundCounterMetric<T>.NoopBoundCounterMetric() -> void
OpenTelemetry.Metrics.NoopBoundMeasureMetric<T>
OpenTelemetry.Metrics.NoopBoundMeasureMetric<T>.NoopBoundMeasureMetric() -> void
OpenTelemetry.Metrics.NoopCounterMetric<T>
OpenTelemetry.Metrics.NoopCounterMetric<T>.NoopCounterMetric() -> void
OpenTelemetry.Metrics.NoopDoubleObserverMetric
OpenTelemetry.Metrics.NoopDoubleObserverMetric.NoopDoubleObserverMetric() -> void
OpenTelemetry.Metrics.NoopDoubleObserverMetricHandle
OpenTelemetry.Metrics.NoopDoubleObserverMetricHandle.NoopDoubleObserverMetricHandle() -> void
OpenTelemetry.Metrics.NoopInt64ObserverMetric
OpenTelemetry.Metrics.NoopInt64ObserverMetric.NoopInt64ObserverMetric() -> void
OpenTelemetry.Metrics.NoopInt64ObserverMetricHandle
OpenTelemetry.Metrics.NoopInt64ObserverMetricHandle.NoopInt64ObserverMetricHandle() -> void
OpenTelemetry.Metrics.NoopMeasureMetric<T>
OpenTelemetry.Metrics.NoopMeasureMetric<T>.NoopMeasureMetric() -> void
OpenTelemetry.Trace.ActivityExtensions
OpenTelemetry.Trace.Link
OpenTelemetry.Trace.Link.Attributes.get -> System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, object>>
@ -172,31 +126,6 @@ OpenTelemetry.Trace.TracerProvider.GetTracer(string name, string version = null)
OpenTelemetry.Trace.TracerProvider.TracerProvider() -> void
abstract OpenTelemetry.Context.RuntimeContextSlot<T>.Get() -> T
abstract OpenTelemetry.Context.RuntimeContextSlot<T>.Set(T value) -> void
abstract OpenTelemetry.Metrics.BoundCounterMetric<T>.Add(in OpenTelemetry.Baggage context, T value) -> void
abstract OpenTelemetry.Metrics.BoundCounterMetric<T>.Add(in OpenTelemetry.Trace.SpanContext context, T value) -> void
abstract OpenTelemetry.Metrics.BoundMeasureMetric<T>.Record(in OpenTelemetry.Baggage context, T value) -> void
abstract OpenTelemetry.Metrics.BoundMeasureMetric<T>.Record(in OpenTelemetry.Trace.SpanContext context, T value) -> void
abstract OpenTelemetry.Metrics.CounterMetric<T>.Add(in OpenTelemetry.Baggage context, T value, OpenTelemetry.Metrics.LabelSet labelset) -> void
abstract OpenTelemetry.Metrics.CounterMetric<T>.Add(in OpenTelemetry.Baggage context, T value, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> void
abstract OpenTelemetry.Metrics.CounterMetric<T>.Add(in OpenTelemetry.Trace.SpanContext context, T value, OpenTelemetry.Metrics.LabelSet labelset) -> void
abstract OpenTelemetry.Metrics.CounterMetric<T>.Add(in OpenTelemetry.Trace.SpanContext context, T value, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> void
abstract OpenTelemetry.Metrics.CounterMetric<T>.Bind(OpenTelemetry.Metrics.LabelSet labelset) -> OpenTelemetry.Metrics.BoundCounterMetric<T>
abstract OpenTelemetry.Metrics.CounterMetric<T>.Bind(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> OpenTelemetry.Metrics.BoundCounterMetric<T>
abstract OpenTelemetry.Metrics.DoubleObserverMetric.Observe(double value, OpenTelemetry.Metrics.LabelSet labelset) -> void
abstract OpenTelemetry.Metrics.DoubleObserverMetric.Observe(double value, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> void
abstract OpenTelemetry.Metrics.DoubleObserverMetricHandle.Observe(double value) -> void
abstract OpenTelemetry.Metrics.Int64ObserverMetric.Observe(long value, OpenTelemetry.Metrics.LabelSet labelset) -> void
abstract OpenTelemetry.Metrics.Int64ObserverMetric.Observe(long value, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> void
abstract OpenTelemetry.Metrics.Int64ObserverMetricHandle.Observe(long value) -> void
abstract OpenTelemetry.Metrics.MeasureMetric<T>.Bind(OpenTelemetry.Metrics.LabelSet labelset) -> OpenTelemetry.Metrics.BoundMeasureMetric<T>
abstract OpenTelemetry.Metrics.MeasureMetric<T>.Bind(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> OpenTelemetry.Metrics.BoundMeasureMetric<T>
abstract OpenTelemetry.Metrics.Meter.CreateDoubleCounter(string name, bool monotonic = true) -> OpenTelemetry.Metrics.CounterMetric<double>
abstract OpenTelemetry.Metrics.Meter.CreateDoubleMeasure(string name, bool absolute = true) -> OpenTelemetry.Metrics.MeasureMetric<double>
abstract OpenTelemetry.Metrics.Meter.CreateDoubleObserver(string name, System.Action<OpenTelemetry.Metrics.DoubleObserverMetric> callback, bool absolute = true) -> OpenTelemetry.Metrics.DoubleObserverMetric
abstract OpenTelemetry.Metrics.Meter.CreateInt64Counter(string name, bool monotonic = true) -> OpenTelemetry.Metrics.CounterMetric<long>
abstract OpenTelemetry.Metrics.Meter.CreateInt64Measure(string name, bool absolute = true) -> OpenTelemetry.Metrics.MeasureMetric<long>
abstract OpenTelemetry.Metrics.Meter.CreateInt64Observer(string name, System.Action<OpenTelemetry.Metrics.Int64ObserverMetric> callback, bool absolute = true) -> OpenTelemetry.Metrics.Int64ObserverMetric
abstract OpenTelemetry.Metrics.Meter.GetLabelSet(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> OpenTelemetry.Metrics.LabelSet
override OpenTelemetry.Baggage.Equals(object obj) -> bool
override OpenTelemetry.Baggage.GetHashCode() -> int
OpenTelemetry.Trace.TracerProviderBuilder
@ -219,24 +148,6 @@ override OpenTelemetry.Context.Propagation.TraceContextPropagator.Inject<T>(Open
override OpenTelemetry.Context.ThreadLocalRuntimeContextSlot<T>.Dispose(bool disposing) -> void
override OpenTelemetry.Context.ThreadLocalRuntimeContextSlot<T>.Get() -> T
override OpenTelemetry.Context.ThreadLocalRuntimeContextSlot<T>.Set(T value) -> void
override OpenTelemetry.Metrics.NoopBoundCounterMetric<T>.Add(in OpenTelemetry.Baggage context, T value) -> void
override OpenTelemetry.Metrics.NoopBoundCounterMetric<T>.Add(in OpenTelemetry.Trace.SpanContext context, T value) -> void
override OpenTelemetry.Metrics.NoopBoundMeasureMetric<T>.Record(in OpenTelemetry.Baggage context, T value) -> void
override OpenTelemetry.Metrics.NoopBoundMeasureMetric<T>.Record(in OpenTelemetry.Trace.SpanContext context, T value) -> void
override OpenTelemetry.Metrics.NoopCounterMetric<T>.Add(in OpenTelemetry.Baggage context, T value, OpenTelemetry.Metrics.LabelSet labelset) -> void
override OpenTelemetry.Metrics.NoopCounterMetric<T>.Add(in OpenTelemetry.Baggage context, T value, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> void
override OpenTelemetry.Metrics.NoopCounterMetric<T>.Add(in OpenTelemetry.Trace.SpanContext context, T value, OpenTelemetry.Metrics.LabelSet labelset) -> void
override OpenTelemetry.Metrics.NoopCounterMetric<T>.Add(in OpenTelemetry.Trace.SpanContext context, T value, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> void
override OpenTelemetry.Metrics.NoopCounterMetric<T>.Bind(OpenTelemetry.Metrics.LabelSet labelset) -> OpenTelemetry.Metrics.BoundCounterMetric<T>
override OpenTelemetry.Metrics.NoopCounterMetric<T>.Bind(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> OpenTelemetry.Metrics.BoundCounterMetric<T>
override OpenTelemetry.Metrics.NoopDoubleObserverMetric.Observe(double value, OpenTelemetry.Metrics.LabelSet labelset) -> void
override OpenTelemetry.Metrics.NoopDoubleObserverMetric.Observe(double value, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> void
override OpenTelemetry.Metrics.NoopDoubleObserverMetricHandle.Observe(double value) -> void
override OpenTelemetry.Metrics.NoopInt64ObserverMetric.Observe(long value, OpenTelemetry.Metrics.LabelSet labelset) -> void
override OpenTelemetry.Metrics.NoopInt64ObserverMetric.Observe(long value, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> void
override OpenTelemetry.Metrics.NoopInt64ObserverMetricHandle.Observe(long value) -> void
override OpenTelemetry.Metrics.NoopMeasureMetric<T>.Bind(OpenTelemetry.Metrics.LabelSet labelset) -> OpenTelemetry.Metrics.BoundMeasureMetric<T>
override OpenTelemetry.Metrics.NoopMeasureMetric<T>.Bind(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> labels) -> OpenTelemetry.Metrics.BoundMeasureMetric<T>
override OpenTelemetry.Trace.Link.Equals(object obj) -> bool
override OpenTelemetry.Trace.Link.GetHashCode() -> int
override OpenTelemetry.Trace.SpanContext.Equals(object obj) -> bool
@ -266,10 +177,6 @@ static OpenTelemetry.Context.RuntimeContext.GetSlot<T>(string slotName) -> OpenT
static OpenTelemetry.Context.RuntimeContext.GetValue<T>(string name) -> T
static OpenTelemetry.Context.RuntimeContext.RegisterSlot<T>(string slotName) -> OpenTelemetry.Context.RuntimeContextSlot<T>
static OpenTelemetry.Context.RuntimeContext.SetValue<T>(string name, T value) -> void
static OpenTelemetry.Metrics.MeterFactoryBase.Default.get -> OpenTelemetry.Metrics.MeterFactoryBase
static OpenTelemetry.Metrics.MeterFactoryBase.SetDefault(OpenTelemetry.Metrics.MeterFactoryBase meterFactory) -> void
static OpenTelemetry.Metrics.MeterProvider.Default.get -> OpenTelemetry.Metrics.MeterProvider
static OpenTelemetry.Metrics.MeterProvider.SetDefault(OpenTelemetry.Metrics.MeterProvider meterProvider) -> void
static OpenTelemetry.Trace.ActivityExtensions.GetStatus(this System.Diagnostics.Activity activity) -> OpenTelemetry.Trace.Status
static OpenTelemetry.Trace.ActivityExtensions.RecordException(this System.Diagnostics.Activity activity, System.Exception ex) -> void
static OpenTelemetry.Trace.ActivityExtensions.SetStatus(this System.Diagnostics.Activity activity, OpenTelemetry.Trace.Status status) -> void
@ -283,21 +190,8 @@ static OpenTelemetry.Trace.Status.operator ==(OpenTelemetry.Trace.Status status1
static OpenTelemetry.Trace.Tracer.CurrentSpan.get -> OpenTelemetry.Trace.TelemetrySpan
static OpenTelemetry.Trace.Tracer.WithSpan(OpenTelemetry.Trace.TelemetrySpan span) -> OpenTelemetry.Trace.TelemetrySpan
static OpenTelemetry.Trace.TracerProvider.Default.get -> OpenTelemetry.Trace.TracerProvider
static readonly OpenTelemetry.Metrics.LabelSet.BlankLabelSet -> OpenTelemetry.Metrics.LabelSet
static readonly OpenTelemetry.Metrics.NoopBoundCounterMetric<T>.Instance -> OpenTelemetry.Metrics.NoopBoundCounterMetric<T>
static readonly OpenTelemetry.Metrics.NoopBoundMeasureMetric<T>.Instance -> OpenTelemetry.Metrics.NoopBoundMeasureMetric<T>
static readonly OpenTelemetry.Metrics.NoopCounterMetric<T>.Instance -> OpenTelemetry.Metrics.NoopCounterMetric<T>
static readonly OpenTelemetry.Metrics.NoopDoubleObserverMetric.Instance -> OpenTelemetry.Metrics.NoopDoubleObserverMetric
static readonly OpenTelemetry.Metrics.NoopDoubleObserverMetricHandle.Instance -> OpenTelemetry.Metrics.NoopDoubleObserverMetricHandle
static readonly OpenTelemetry.Metrics.NoopInt64ObserverMetric.Instance -> OpenTelemetry.Metrics.Int64ObserverMetric
static readonly OpenTelemetry.Metrics.NoopInt64ObserverMetricHandle.Instance -> OpenTelemetry.Metrics.NoopInt64ObserverMetricHandle
static readonly OpenTelemetry.Metrics.NoopMeasureMetric<T>.Instance -> OpenTelemetry.Metrics.NoopMeasureMetric<T>
static readonly OpenTelemetry.Trace.Status.Error -> OpenTelemetry.Trace.Status
static readonly OpenTelemetry.Trace.Status.Ok -> OpenTelemetry.Trace.Status
static readonly OpenTelemetry.Trace.Status.Unset -> OpenTelemetry.Trace.Status
virtual OpenTelemetry.BaseProvider.Dispose(bool disposing) -> void
virtual OpenTelemetry.Context.RuntimeContextSlot<T>.Dispose(bool disposing) -> void
virtual OpenTelemetry.Metrics.LabelSet.Labels.get -> System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>>
virtual OpenTelemetry.Metrics.LabelSet.Labels.set -> void
virtual OpenTelemetry.Metrics.MeterFactoryBase.GetMeter(string name, string version = null) -> OpenTelemetry.Metrics.Meter
virtual OpenTelemetry.Metrics.MeterProvider.GetMeter(string name, string version = null) -> OpenTelemetry.Metrics.Meter

View File

@ -18,6 +18,9 @@
* `Status.WithDescription` will now ignore the provided description if the
`Status.StatusCode` is anything other than `ERROR`.
([#1655](https://github.com/open-telemetry/opentelemetry-dotnet/pull/1655))
* Metrics removed as it is not part 1.0.0 release. See issue
[#1501](https://github.com/open-telemetry/opentelemetry-dotnet/pull/1655)
for details on Metric release plans.
## 1.0.0-rc1.1

View File

@ -1,28 +0,0 @@
// <copyright file="BlankLabelSet.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// 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
{
}
}

View File

@ -1,44 +0,0 @@
// <copyright file="BoundCounterMetric.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using OpenTelemetry.Trace;
namespace OpenTelemetry.Metrics
{
/// <summary>
/// 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
{
/// <summary>
/// Adds the given value to the bound counter metric.
/// </summary>
/// <param name="context">the associated <see cref="SpanContext"/>.</param>
/// <param name="value">value by which the bound counter metric should be added.</param>
public abstract void Add(in SpanContext context, T value);
/// <summary>
/// Adds the given value to the bound counter metric.
/// </summary>
/// <param name="context">the associated <see cref="Baggage"/>.</param>
/// <param name="value">value by which the bound counter metric should be added.</param>
public abstract void Add(in Baggage context, T value);
}
}

View File

@ -1,44 +0,0 @@
// <copyright file="BoundMeasureMetric.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using OpenTelemetry.Trace;
namespace OpenTelemetry.Metrics
{
/// <summary>
/// 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
{
/// <summary>
/// Record the given value to the bound measure metric.
/// </summary>
/// <param name="context">the associated <see cref="SpanContext"/>.</param>
/// <param name="value">the measurement to be recorded.</param>
public abstract void Record(in SpanContext context, T value);
/// <summary>
/// Record the given value to the bound measure metric.
/// </summary>
/// <param name="context">the associated <see cref="Baggage"/>.</param>
/// <param name="value">the measurement to be recorded.</param>
public abstract void Record(in Baggage context, T value);
}
}

View File

@ -1,77 +0,0 @@
// <copyright file="CounterMetric.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Collections.Generic;
using OpenTelemetry.Trace;
namespace OpenTelemetry.Metrics
{
/// <summary>
/// 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
{
/// <summary>
/// Adds or Increments the counter.
/// </summary>
/// <param name="context">the associated <see cref="SpanContext"/>.</param>
/// <param name="value">value by which the counter should be incremented.</param>
/// <param name="labelset">The labelset associated with this value.</param>
public abstract void Add(in SpanContext context, T value, LabelSet labelset);
/// <summary>
/// Adds or Increments the counter.
/// </summary>
/// <param name="context">the associated <see cref="SpanContext"/>.</param>
/// <param name="value">value by which the counter should be incremented.</param>
/// <param name="labels">The labels or dimensions associated with this value.</param>
public abstract void Add(in SpanContext context, T value, IEnumerable<KeyValuePair<string, string>> labels);
/// <summary>
/// Adds or Increments the counter.
/// </summary>
/// <param name="context">the associated <see cref="Baggage"/>.</param>
/// <param name="value">value by which the counter should be incremented.</param>
/// <param name="labelset">The labelset associated with this value.</param>
public abstract void Add(in Baggage context, T value, LabelSet labelset);
/// <summary>
/// Adds or Increments the counter.
/// </summary>
/// <param name="context">the associated <see cref="Baggage"/>.</param>
/// <param name="value">value by which the counter should be incremented.</param>
/// <param name="labels">The labels or dimensions associated with this value.</param>
public abstract void Add(in Baggage context, T value, IEnumerable<KeyValuePair<string, string>> labels);
/// <summary>
/// Gets the bound counter metric with given labelset.
/// </summary>
/// <param name="labelset">The labelset from which bound instrument should be constructed.</param>
/// <returns>The bound counter metric.</returns>
public abstract BoundCounterMetric<T> Bind(LabelSet labelset);
/// <summary>
/// Gets the bound counter metric with given labels.
/// </summary>
/// <param name="labels">The labels or dimensions associated with this value.</param>
/// <returns>The bound counter metric.</returns>
public abstract BoundCounterMetric<T> Bind(IEnumerable<KeyValuePair<string, string>> labels);
}
}

View File

@ -1,42 +0,0 @@
// <copyright file="DoubleObserverMetric.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// 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>
/// Observes a value.
/// </summary>
/// <param name="value">value to observe.</param>
/// <param name="labelset">The labelset associated with this value.</param>
public abstract void Observe(double value, LabelSet labelset);
/// <summary>
/// Observes a value.
/// </summary>
/// <param name="value">value to observe.</param>
/// <param name="labels">The labels or dimensions associated with this value.</param>
public abstract void Observe(double value, IEnumerable<KeyValuePair<string, string>> labels);
}
}

View File

@ -1,33 +0,0 @@
// <copyright file="DoubleObserverMetricHandle.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// 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>
/// Observes the given value.
/// </summary>
/// <param name="value">value by which the observer handle should be Recorded.</param>
public abstract void Observe(double value);
}
}

View File

@ -1,42 +0,0 @@
// <copyright file="Int64ObserverMetric.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// 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>
/// Observes a value.
/// </summary>
/// <param name="value">value to observe.</param>
/// <param name="labelset">The labelset associated with this value.</param>
public abstract void Observe(long value, LabelSet labelset);
/// <summary>
/// Observes a value.
/// </summary>
/// <param name="value">value to observe.</param>
/// <param name="labels">The labels or dimensions associated with this value.</param>
public abstract void Observe(long value, IEnumerable<KeyValuePair<string, string>> labels);
}
}

View File

@ -1,33 +0,0 @@
// <copyright file="Int64ObserverMetricHandle.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// 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>
/// Observes the given value.
/// </summary>
/// <param name="value">value by which the observer handle should be Recorded.</param>
public abstract void Observe(long value);
}
}

View File

@ -1,39 +0,0 @@
// <copyright file="LabelSet.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Collections.Generic;
using System.Linq;
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>
/// Empty LabelSet.
/// </summary>
public static readonly LabelSet BlankLabelSet = new BlankLabelSet();
/// <summary>
/// Gets or sets the labels after sorting and removing duplicates.
/// </summary>
public virtual IEnumerable<KeyValuePair<string, string>> Labels { get; set; } = Enumerable.Empty<KeyValuePair<string, string>>();
}
}

View File

@ -1,77 +0,0 @@
// <copyright file="MeasureMetric.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Collections.Generic;
using OpenTelemetry.Trace;
namespace OpenTelemetry.Metrics
{
/// <summary>
/// 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
{
/// <summary>
/// Records a measure.
/// </summary>
/// <param name="context">the associated <see cref="SpanContext"/>.</param>
/// <param name="value">value to record.</param>
/// <param name="labelset">The labelset associated with this value.</param>
public void Record(in SpanContext context, T value, LabelSet labelset) => this.Bind(labelset).Record(context, value);
/// <summary>
/// Records a measure.
/// </summary>
/// <param name="context">the associated <see cref="SpanContext"/>.</param>
/// <param name="value">value to record.</param>
/// <param name="labels">The labels or dimensions associated with this value.</param>
public void Record(in SpanContext context, T value, IEnumerable<KeyValuePair<string, string>> labels) => this.Bind(labels).Record(context, value);
/// <summary>
/// Records a measure.
/// </summary>
/// <param name="context">the associated <see cref="Baggage"/>.</param>
/// <param name="value">value to record.</param>
/// <param name="labelset">The labelset associated with this value.</param>
public void Record(in Baggage context, T value, LabelSet labelset) => this.Bind(labelset).Record(context, value);
/// <summary>
/// Records a measure.
/// </summary>
/// <param name="context">the associated <see cref="Baggage"/>.</param>
/// <param name="value">value to record.</param>
/// <param name="labels">The labels or dimensions associated with this value.</param>
public void Record(in Baggage context, T value, IEnumerable<KeyValuePair<string, string>> labels) => this.Bind(labels).Record(context, value);
/// <summary>
/// Gets the bound measure metric with given labelset.
/// </summary>
/// <param name="labelset">The labelset from which bound instrument should be constructed.</param>
/// <returns>The bound measure metric.</returns>
public abstract BoundMeasureMetric<T> Bind(LabelSet labelset);
/// <summary>
/// Gets the bound measure metric with given labelset.
/// </summary>
/// <param name="labels">The labels or dimensions associated with this value.</param>
/// <returns>The bound measure metric.</returns>
public abstract BoundMeasureMetric<T> Bind(IEnumerable<KeyValuePair<string, string>> labels);
}
}

View File

@ -1,85 +0,0 @@
// <copyright file="Meter.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Collections.Generic;
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>
/// Creates Int64 counter with given name.
/// </summary>
/// <param name="name">The name of the counter.</param>
/// <param name="monotonic">indicates if only positive values are expected.</param>
/// <returns>The counter instance.</returns>
public abstract CounterMetric<long> CreateInt64Counter(string name, bool monotonic = true);
/// <summary>
/// Creates double counter with given name.
/// </summary>
/// <param name="name">The name of the counter.</param>
/// <param name="monotonic">indicates if only positive values are expected.</param>
/// <returns>The counter instance.</returns>
public abstract CounterMetric<double> CreateDoubleCounter(string name, bool monotonic = true);
/// <summary>
/// Creates Int64 Measure with given name.
/// </summary>
/// <param name="name">The name of the measure.</param>
/// <param name="absolute">indicates if only positive values are expected.</param>
/// <returns>The measure instance.</returns>
public abstract MeasureMetric<long> CreateInt64Measure(string name, bool absolute = true);
/// <summary>
/// Creates double Measure with given name.
/// </summary>
/// <param name="name">The name of the measure.</param>
/// <param name="absolute">indicates if only positive values are expected.</param>
/// <returns>The measure instance.</returns>
public abstract MeasureMetric<double> CreateDoubleMeasure(string name, bool absolute = true);
/// <summary>
/// Creates Int64 Observer with given name.
/// </summary>
/// <param name="name">The name of the observer.</param>
/// <param name="callback">The callback to be called to observe metric value.</param>
/// <param name="absolute">indicates if only positive values are expected.</param>
/// <returns>The observer instance.</returns>
public abstract Int64ObserverMetric CreateInt64Observer(string name, Action<Int64ObserverMetric> callback, bool absolute = true);
/// <summary>
/// Creates Double Observer with given name.
/// </summary>
/// <param name="name">The name of the observer.</param>
/// <param name="callback">The callback to be called to observe metric value.</param>
/// <param name="absolute">indicates if only positive values are expected.</param>
/// <returns>The observer instance.</returns>
public abstract DoubleObserverMetric CreateDoubleObserver(string name, Action<DoubleObserverMetric> callback, bool absolute = true);
/// <summary>
/// Constructs or retrieves the <see cref="LabelSet"/> from the given label key-value pairs.
/// </summary>
/// <param name="labels">Label key-value pairs.</param>
/// <returns>The <see cref="LabelSet"/> with given label key value pairs.</returns>
public abstract LabelSet GetLabelSet(IEnumerable<KeyValuePair<string, string>> labels);
}
}

View File

@ -1,87 +0,0 @@
// <copyright file="MeterFactoryBase.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
namespace OpenTelemetry.Metrics
{
/// <summary>
/// Creates Meters for an instrumentation library.
/// 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();
private static bool isInitialized;
private static MeterFactoryBase defaultFactory = new MeterFactoryBase();
/// <summary>
/// Gets the dafult instance of a <see cref="MeterFactoryBase"/>.
/// </summary>
public static MeterFactoryBase Default
{
get => defaultFactory;
}
/// <summary>
/// Sets the default instance of <see cref="MeterFactoryBase"/>.
/// </summary>
/// <param name="meterFactory">Instance of <see cref="MeterFactoryBase"/>.</param>
/// <remarks>
/// This method can only be called once. Calling it multiple times will throw an <see cref="System.InvalidOperationException"/>.
/// </remarks>
/// <exception cref="System.InvalidOperationException">Thrown when called multiple times.</exception>
public static void SetDefault(MeterFactoryBase meterFactory)
{
if (isInitialized)
{
throw new InvalidOperationException("Default factory is already set");
}
defaultFactory = meterFactory ?? throw new ArgumentNullException(nameof(meterFactory));
// some libraries might have already used and cached ProxyMeter.
// let's update it to real one and forward all calls.
// resource assignment is not possible for libraries that cache tracer before SDK is initialized.
// SDK (Tracer) must be at least partially initialized before any collection starts to capture resources.
// we might be able to work this around with events.
proxyMeter.UpdateMeter(defaultFactory.GetMeter(null));
isInitialized = true;
}
/// <summary>
/// Returns a Meter for a given name and version.
/// </summary>
/// <param name="name">Name of the instrumentation library.</param>
/// <param name="version">Version of the instrumentation library (optional).</param>
/// <returns>Meter for the given name and version information.</returns>
public virtual Meter GetMeter(string name, string version = null)
{
return isInitialized ? defaultFactory.GetMeter(name, version) : proxyMeter;
}
// for tests
internal static void Reset()
{
proxyMeter = new ProxyMeter();
isInitialized = false;
defaultFactory = new MeterFactoryBase();
}
}
}

View File

@ -1,94 +0,0 @@
// <copyright file="MeterProvider.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
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();
private static bool isInitialized;
private static MeterProvider defaultProvider = new MeterProvider();
/// <summary>
/// Initializes a new instance of the <see cref="MeterProvider"/> class.
/// </summary>
protected MeterProvider()
{
}
/// <summary>
/// Gets the dafult instance of a <see cref="MeterProvider"/>.
/// </summary>
public static MeterProvider Default
{
get => defaultProvider;
}
/// <summary>
/// Sets the default instance of <see cref="MeterProvider"/>.
/// </summary>
/// <param name="meterProvider">Instance of <see cref="MeterProvider"/>.</param>
/// <remarks>
/// This method can only be called once. Calling it multiple times will throw an <see cref="System.InvalidOperationException"/>.
/// </remarks>
/// <exception cref="InvalidOperationException">Thrown when called multiple times.</exception>
public static void SetDefault(MeterProvider meterProvider)
{
if (isInitialized)
{
throw new InvalidOperationException("Default factory is already set");
}
defaultProvider = meterProvider ?? throw new ArgumentNullException(nameof(meterProvider));
// some libraries might have already used and cached ProxyMeter.
// let's update it to real one and forward all calls.
// TODO:
// resource assignment is not possible for libraries that cache meter before SDK is initialized.
// SDK (Meter) must be at least partially initialized before any collection starts to capture resources.
// we might be able to work this around in future.
proxyMeter.UpdateMeter(defaultProvider.GetMeter(null));
isInitialized = true;
}
/// <summary>
/// Returns a Meter for a given name and version.
/// </summary>
/// <param name="name">Name of the instrumentation library.</param>
/// <param name="version">Version of the instrumentation library (optional).</param>
/// <returns>Meter for the given name and version information.</returns>
public virtual Meter GetMeter(string name, string version = null)
{
return isInitialized ? defaultProvider.GetMeter(name, version) : proxyMeter;
}
// for tests
internal static void Reset()
{
proxyMeter = new ProxyMeter();
isInitialized = false;
defaultProvider = new MeterProvider();
}
}
}

View File

@ -1,45 +0,0 @@
// <copyright file="NoopBoundCounterMetric.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using OpenTelemetry.Trace;
namespace OpenTelemetry.Metrics
{
/// <summary>
/// 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
{
/// <summary>
/// No op counter bound instrument instance.
/// </summary>
public static readonly NoopBoundCounterMetric<T> Instance = new NoopBoundCounterMetric<T>();
/// <inheritdoc/>
public override void Add(in SpanContext context, T value)
{
}
/// <inheritdoc/>
public override void Add(in Baggage context, T value)
{
}
}
}

View File

@ -1,45 +0,0 @@
// <copyright file="NoopBoundMeasureMetric.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using OpenTelemetry.Trace;
namespace OpenTelemetry.Metrics
{
/// <summary>
/// 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
{
/// <summary>
/// No op measure bound instrument instance.
/// </summary>
public static readonly NoopBoundMeasureMetric<T> Instance = new NoopBoundMeasureMetric<T>();
/// <inheritdoc/>
public override void Record(in SpanContext context, T value)
{
}
/// <inheritdoc/>
public override void Record(in Baggage context, T value)
{
}
}
}

View File

@ -1,68 +0,0 @@
// <copyright file="NoopCounterMetric.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Collections.Generic;
using OpenTelemetry.Trace;
namespace OpenTelemetry.Metrics
{
/// <summary>
/// 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
{
/// <summary>
/// No op counter instance.
/// </summary>
public static readonly NoopCounterMetric<T> Instance = new NoopCounterMetric<T>();
/// <inheritdoc/>
public override void Add(in SpanContext context, T value, LabelSet labelset)
{
}
/// <inheritdoc/>
public override void Add(in SpanContext context, T value, IEnumerable<KeyValuePair<string, string>> labels)
{
}
/// <inheritdoc/>
public override void Add(in Baggage context, T value, LabelSet labelset)
{
}
/// <inheritdoc/>
public override void Add(in Baggage context, T value, IEnumerable<KeyValuePair<string, string>> labels)
{
}
/// <inheritdoc/>
public override BoundCounterMetric<T> Bind(LabelSet labelset)
{
return NoopBoundCounterMetric<T>.Instance;
}
/// <inheritdoc/>
public override BoundCounterMetric<T> Bind(IEnumerable<KeyValuePair<string, string>> labels)
{
return NoopBoundCounterMetric<T>.Instance;
}
}
}

View File

@ -1,43 +0,0 @@
// <copyright file="NoopDoubleObserverMetric.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// 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>
/// No op observer instance.
/// </summary>
public static readonly NoopDoubleObserverMetric Instance = new NoopDoubleObserverMetric();
/// <inheritdoc/>
public override void Observe(double value, LabelSet labelset)
{
}
/// <inheritdoc/>
public override void Observe(double value, IEnumerable<KeyValuePair<string, string>> labels)
{
}
}
}

View File

@ -1,37 +0,0 @@
// <copyright file="NoopDoubleObserverMetricHandle.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// 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>
/// No op observer handle instance.
/// </summary>
public static readonly NoopDoubleObserverMetricHandle Instance = new NoopDoubleObserverMetricHandle();
/// <inheritdoc/>
public override void Observe(double value)
{
}
}
}

View File

@ -1,43 +0,0 @@
// <copyright file="NoopInt64ObserverMetric.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// 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>
/// No op observer instance.
/// </summary>
public static readonly Int64ObserverMetric Instance = new NoopInt64ObserverMetric();
/// <inheritdoc/>
public override void Observe(long value, LabelSet labelset)
{
}
/// <inheritdoc/>
public override void Observe(long value, IEnumerable<KeyValuePair<string, string>> labels)
{
}
}
}

View File

@ -1,37 +0,0 @@
// <copyright file="NoopInt64ObserverMetricHandle.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// 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>
/// No op observer handle instance.
/// </summary>
public static readonly NoopInt64ObserverMetricHandle Instance = new NoopInt64ObserverMetricHandle();
/// <inheritdoc/>
public override void Observe(long value)
{
}
}
}

View File

@ -1,47 +0,0 @@
// <copyright file="NoopMeasureMetric.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Collections.Generic;
namespace OpenTelemetry.Metrics
{
/// <summary>
/// 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
{
/// <summary>
/// No op measure instance.
/// </summary>
public static readonly NoopMeasureMetric<T> Instance = new NoopMeasureMetric<T>();
/// <inheritdoc/>
public override BoundMeasureMetric<T> Bind(LabelSet labelset)
{
return NoopBoundMeasureMetric<T>.Instance;
}
/// <inheritdoc/>
public override BoundMeasureMetric<T> Bind(IEnumerable<KeyValuePair<string, string>> labels)
{
return NoopBoundMeasureMetric<T>.Instance;
}
}
}

View File

@ -1,80 +0,0 @@
// <copyright file="ProxyMeter.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Collections.Generic;
using System.Threading;
namespace OpenTelemetry.Metrics
{
/// <summary>
/// Proxy Meter which act as a No-Op Meter, until real meter is provided.
/// </summary>
internal sealed class ProxyMeter : Meter
{
private Meter realMeter;
public ProxyMeter()
{
}
public override CounterMetric<double> CreateDoubleCounter(string name, bool monotonic = true)
{
return this.realMeter != null ? this.realMeter.CreateDoubleCounter(name, monotonic) : NoopCounterMetric<double>.Instance;
}
public override MeasureMetric<double> CreateDoubleMeasure(string name, bool absolute = true)
{
return this.realMeter != null ? this.realMeter.CreateDoubleMeasure(name, absolute) : NoopMeasureMetric<double>.Instance;
}
public override DoubleObserverMetric CreateDoubleObserver(string name, Action<DoubleObserverMetric> callback, bool absolute = true)
{
return this.realMeter != null ? this.realMeter.CreateDoubleObserver(name, callback, absolute) : NoopDoubleObserverMetric.Instance;
}
public override CounterMetric<long> CreateInt64Counter(string name, bool monotonic = true)
{
return this.realMeter != null ? this.realMeter.CreateInt64Counter(name, monotonic) : NoopCounterMetric<long>.Instance;
}
public override MeasureMetric<long> CreateInt64Measure(string name, bool absolute = true)
{
return this.realMeter != null ? this.realMeter.CreateInt64Measure(name, absolute) : NoopMeasureMetric<long>.Instance;
}
public override Int64ObserverMetric CreateInt64Observer(string name, Action<Int64ObserverMetric> callback, bool absolute = true)
{
return this.realMeter != null ? this.realMeter.CreateInt64Observer(name, callback, absolute) : NoopInt64ObserverMetric.Instance;
}
public override LabelSet GetLabelSet(IEnumerable<KeyValuePair<string, string>> labels)
{
// return no op
return this.realMeter != null ? this.realMeter.GetLabelSet(labels) : LabelSet.BlankLabelSet;
}
public void UpdateMeter(Meter realMeter)
{
if (this.realMeter != null)
{
return;
}
// just in case user calls init concurrently
Interlocked.CompareExchange(ref this.realMeter, realMeter, null);
}
}
}

View File

@ -1,16 +0,0 @@
OpenTelemetry.Exporter.Prometheus.PrometheusExporter
OpenTelemetry.Exporter.Prometheus.PrometheusExporter.PrometheusExporter(OpenTelemetry.Exporter.Prometheus.PrometheusExporterOptions options) -> void
OpenTelemetry.Exporter.Prometheus.PrometheusExporterExtensions
OpenTelemetry.Exporter.Prometheus.PrometheusExporterMetricsHttpServer
OpenTelemetry.Exporter.Prometheus.PrometheusExporterMetricsHttpServer.Dispose() -> void
OpenTelemetry.Exporter.Prometheus.PrometheusExporterMetricsHttpServer.PrometheusExporterMetricsHttpServer(OpenTelemetry.Exporter.Prometheus.PrometheusExporter exporter) -> void
OpenTelemetry.Exporter.Prometheus.PrometheusExporterMetricsHttpServer.Start(System.Threading.CancellationToken token = default(System.Threading.CancellationToken)) -> void
OpenTelemetry.Exporter.Prometheus.PrometheusExporterMetricsHttpServer.Stop() -> void
OpenTelemetry.Exporter.Prometheus.PrometheusExporterOptions
OpenTelemetry.Exporter.Prometheus.PrometheusExporterOptions.PrometheusExporterOptions() -> void
OpenTelemetry.Exporter.Prometheus.PrometheusExporterOptions.Url.get -> string
OpenTelemetry.Exporter.Prometheus.PrometheusExporterOptions.Url.set -> void
override OpenTelemetry.Exporter.Prometheus.PrometheusExporter.ExportAsync(System.Collections.Generic.IEnumerable<OpenTelemetry.Metrics.Export.Metric> metrics, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task<OpenTelemetry.Metrics.Export.MetricExporter.ExportResult>
static OpenTelemetry.Exporter.Prometheus.PrometheusExporterExtensions.GetMetricsCollection(this OpenTelemetry.Exporter.Prometheus.PrometheusExporter exporter) -> string
static OpenTelemetry.Exporter.Prometheus.PrometheusExporterExtensions.WriteMetricsCollection(this OpenTelemetry.Exporter.Prometheus.PrometheusExporter exporter, System.IO.StreamWriter writer) -> void
virtual OpenTelemetry.Exporter.Prometheus.PrometheusExporterMetricsHttpServer.Dispose(bool disposing) -> void

View File

@ -1,16 +0,0 @@
OpenTelemetry.Exporter.Prometheus.PrometheusExporter
OpenTelemetry.Exporter.Prometheus.PrometheusExporter.PrometheusExporter(OpenTelemetry.Exporter.Prometheus.PrometheusExporterOptions options) -> void
OpenTelemetry.Exporter.Prometheus.PrometheusExporterExtensions
OpenTelemetry.Exporter.Prometheus.PrometheusExporterMetricsHttpServer
OpenTelemetry.Exporter.Prometheus.PrometheusExporterMetricsHttpServer.Dispose() -> void
OpenTelemetry.Exporter.Prometheus.PrometheusExporterMetricsHttpServer.PrometheusExporterMetricsHttpServer(OpenTelemetry.Exporter.Prometheus.PrometheusExporter exporter) -> void
OpenTelemetry.Exporter.Prometheus.PrometheusExporterMetricsHttpServer.Start(System.Threading.CancellationToken token = default(System.Threading.CancellationToken)) -> void
OpenTelemetry.Exporter.Prometheus.PrometheusExporterMetricsHttpServer.Stop() -> void
OpenTelemetry.Exporter.Prometheus.PrometheusExporterOptions
OpenTelemetry.Exporter.Prometheus.PrometheusExporterOptions.PrometheusExporterOptions() -> void
OpenTelemetry.Exporter.Prometheus.PrometheusExporterOptions.Url.get -> string
OpenTelemetry.Exporter.Prometheus.PrometheusExporterOptions.Url.set -> void
override OpenTelemetry.Exporter.Prometheus.PrometheusExporter.ExportAsync(System.Collections.Generic.IEnumerable<OpenTelemetry.Metrics.Export.Metric> metrics, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task<OpenTelemetry.Metrics.Export.MetricExporter.ExportResult>
static OpenTelemetry.Exporter.Prometheus.PrometheusExporterExtensions.GetMetricsCollection(this OpenTelemetry.Exporter.Prometheus.PrometheusExporter exporter) -> string
static OpenTelemetry.Exporter.Prometheus.PrometheusExporterExtensions.WriteMetricsCollection(this OpenTelemetry.Exporter.Prometheus.PrometheusExporter exporter, System.IO.StreamWriter writer) -> void
virtual OpenTelemetry.Exporter.Prometheus.PrometheusExporterMetricsHttpServer.Dispose(bool disposing) -> void

View File

@ -1,21 +0,0 @@
OpenTelemetry.Exporter.Prometheus.PrometheusExporter
OpenTelemetry.Exporter.Prometheus.PrometheusExporter.PrometheusExporter(OpenTelemetry.Exporter.Prometheus.PrometheusExporterOptions options) -> void
OpenTelemetry.Exporter.Prometheus.PrometheusExporterExtensions
OpenTelemetry.Exporter.Prometheus.PrometheusExporterMetricsHttpServer
OpenTelemetry.Exporter.Prometheus.PrometheusExporterMetricsHttpServer.Dispose() -> void
OpenTelemetry.Exporter.Prometheus.PrometheusExporterMetricsHttpServer.PrometheusExporterMetricsHttpServer(OpenTelemetry.Exporter.Prometheus.PrometheusExporter exporter) -> void
OpenTelemetry.Exporter.Prometheus.PrometheusExporterMetricsHttpServer.Start(System.Threading.CancellationToken token = default(System.Threading.CancellationToken)) -> void
OpenTelemetry.Exporter.Prometheus.PrometheusExporterMetricsHttpServer.Stop() -> void
OpenTelemetry.Exporter.Prometheus.PrometheusExporterMiddleware
OpenTelemetry.Exporter.Prometheus.PrometheusExporterMiddleware.InvokeAsync(Microsoft.AspNetCore.Http.HttpContext httpContext) -> System.Threading.Tasks.Task
OpenTelemetry.Exporter.Prometheus.PrometheusExporterMiddleware.PrometheusExporterMiddleware(Microsoft.AspNetCore.Http.RequestDelegate next, OpenTelemetry.Exporter.Prometheus.PrometheusExporter exporter) -> void
OpenTelemetry.Exporter.Prometheus.PrometheusExporterOptions
OpenTelemetry.Exporter.Prometheus.PrometheusExporterOptions.PrometheusExporterOptions() -> void
OpenTelemetry.Exporter.Prometheus.PrometheusExporterOptions.Url.get -> string
OpenTelemetry.Exporter.Prometheus.PrometheusExporterOptions.Url.set -> void
Microsoft.AspNetCore.Builder.PrometheusRouteBuilderExtensions
override OpenTelemetry.Exporter.Prometheus.PrometheusExporter.ExportAsync(System.Collections.Generic.IEnumerable<OpenTelemetry.Metrics.Export.Metric> metrics, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task<OpenTelemetry.Metrics.Export.MetricExporter.ExportResult>
static OpenTelemetry.Exporter.Prometheus.PrometheusExporterExtensions.GetMetricsCollection(this OpenTelemetry.Exporter.Prometheus.PrometheusExporter exporter) -> string
static OpenTelemetry.Exporter.Prometheus.PrometheusExporterExtensions.WriteMetricsCollection(this OpenTelemetry.Exporter.Prometheus.PrometheusExporter exporter, System.IO.StreamWriter writer) -> void
static Microsoft.AspNetCore.Builder.PrometheusRouteBuilderExtensions.UsePrometheus(this Microsoft.AspNetCore.Builder.IApplicationBuilder app) -> Microsoft.AspNetCore.Builder.IApplicationBuilder
virtual OpenTelemetry.Exporter.Prometheus.PrometheusExporterMetricsHttpServer.Dispose(bool disposing) -> void

View File

@ -1,22 +0,0 @@
// <copyright file="AssemblyInfo.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System.Runtime.CompilerServices;
#if SIGNED
[assembly: InternalsVisibleTo("OpenTelemetry.Exporter.Prometheus.Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010051c1562a090fb0c9f391012a32198b5e5d9a60e9b80fa2d7b434c9e5ccb7259bd606e66f9660676afc6692b8cdc6793d190904551d2103b7b22fa636dcbb8208839785ba402ea08fc00c8f1500ccef28bbf599aa64ffb1e1d5dc1bf3420a3777badfe697856e9d52070a50c3ea5821c80bef17ca3acffa28f89dd413f096f898")]
#else
[assembly: InternalsVisibleTo("OpenTelemetry.Exporter.Prometheus.Tests")]
#endif

View File

@ -1,40 +0,0 @@
# Changelog
## Unreleased
* `UsePrometheus` extension method for adding middleware to an ASP.NET Core
application moved from `OpenTelemetry.Exporter.Prometheus` namespace to
`Microsoft.AspNetCore.Builder` namespace.
([#1576](https://github.com/open-telemetry/opentelemetry-dotnet/pull/1576))
## 1.0.0-rc1.1
Released 2020-Nov-17
## 0.8.0-beta.1
Released 2020-Nov-5
## 0.7.0-beta.1
Released 2020-Oct-16
## 0.6.0-beta.1
Released 2020-Sep-15
## 0.5.0-beta.2
Released 2020-08-28
## 0.4.0-beta.2
Released 2020-07-24
* First beta release
## 0.3.0-beta
Released 2020-07-23
* Initial release

View File

@ -1,61 +0,0 @@
// <copyright file="PrometheusExporterEventSource.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Diagnostics.Tracing;
using OpenTelemetry.Internal;
namespace OpenTelemetry.Exporter.Prometheus.Implementation
{
/// <summary>
/// EventSource events emitted from the project.
/// </summary>
[EventSource(Name = "OpenTelemetry-Exporter-Prometheus")]
internal class PrometheusExporterEventSource : EventSource
{
public static PrometheusExporterEventSource Log = new PrometheusExporterEventSource();
[NonEvent]
public void FailedExport(Exception ex)
{
if (this.IsEnabled(EventLevel.Error, (EventKeywords)(-1)))
{
this.FailedExport(ex.ToInvariantString());
}
}
[NonEvent]
public void CanceledExport(Exception ex)
{
if (this.IsEnabled(EventLevel.Error, (EventKeywords)(-1)))
{
this.CanceledExport(ex.ToInvariantString());
}
}
[Event(1, Message = "Failed to export activities: '{0}'", Level = EventLevel.Error)]
public void FailedExport(string exception)
{
this.WriteEvent(1, exception);
}
[Event(2, Message = "Canceled to export activities: '{0}'", Level = EventLevel.Error)]
public void CanceledExport(string exception)
{
this.WriteEvent(2, exception);
}
}
}

View File

@ -1,276 +0,0 @@
// <copyright file="PrometheusMetricBuilder.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
#if NET452
using OpenTelemetry.Internal;
#endif
namespace OpenTelemetry.Exporter.Prometheus.Implementation
{
internal class PrometheusMetricBuilder
{
public const string ContentType = "text/plain; version = 0.0.4";
private static readonly char[] FirstCharacterNameCharset =
{
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'_', ':',
};
private static readonly char[] NameCharset =
{
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'_', ':',
};
private static readonly char[] FirstCharacterLabelCharset =
{
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'_',
};
private static readonly char[] LabelCharset =
{
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'_',
};
private readonly ICollection<PrometheusMetricValueBuilder> values = new List<PrometheusMetricValueBuilder>();
private string name;
private string description;
private string type;
public PrometheusMetricBuilder WithName(string name)
{
this.name = name;
return this;
}
public PrometheusMetricBuilder WithDescription(string description)
{
this.description = description;
return this;
}
public PrometheusMetricBuilder WithType(string type)
{
this.type = type;
return this;
}
public PrometheusMetricValueBuilder AddValue()
{
var val = new PrometheusMetricValueBuilder();
this.values.Add(val);
return val;
}
public void Write(StreamWriter writer)
{
// https://prometheus.io/docs/instrumenting/exposition_formats/
if (string.IsNullOrEmpty(this.name))
{
throw new InvalidOperationException("Metric name should not be empty");
}
this.name = GetSafeMetricName(this.name);
if (!string.IsNullOrEmpty(this.description))
{
// Lines with a # as the first non-whitespace character are comments.
// They are ignored unless the first token after # is either HELP or TYPE.
// Those lines are treated as follows: If the token is HELP, at least one
// more token is expected, which is the metric name. All remaining tokens
// are considered the docstring for that metric name. HELP lines may contain
// any sequence of UTF-8 characters (after the metric name), but the backslash
// and the line feed characters have to be escaped as \\ and \n, respectively.
// Only one HELP line may exist for any given metric name.
writer.Write("# HELP ");
writer.Write(this.name);
writer.Write(GetSafeMetricDescription(this.description));
writer.Write("\n");
}
if (!string.IsNullOrEmpty(this.type))
{
// If the token is TYPE, exactly two more tokens are expected. The first is the
// metric name, and the second is either counter, gauge, histogram, summary, or
// untyped, defining the type for the metric of that name. Only one TYPE line
// may exist for a given metric name. The TYPE line for a metric name must appear
// before the first sample is reported for that metric name. If there is no TYPE
// line for a metric name, the type is set to untyped.
writer.Write("# TYPE ");
writer.Write(this.name);
writer.Write(" ");
writer.Write(this.type);
writer.Write("\n");
}
// The remaining lines describe samples (one per line) using the following syntax (EBNF):
// metric_name [
// "{" label_name "=" `"` label_value `"` { "," label_name "=" `"` label_value `"` } [ "," ] "}"
// ] value [ timestamp ]
// In the sample syntax:
var now = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString(CultureInfo.InvariantCulture);
foreach (var m in this.values)
{
// metric_name and label_name carry the usual Prometheus expression language restrictions.
writer.Write(m.Name != null ? GetSafeMetricName(m.Name) : this.name);
// label_value can be any sequence of UTF-8 characters, but the backslash
// (\, double-quote ("}, and line feed (\n) characters have to be escaped
// as \\, \", and \n, respectively.
if (m.Labels.Count > 0)
{
writer.Write(@"{");
writer.Write(string.Join(",", m.Labels.Select(x => GetLabelAndValue(x.Item1, x.Item2))));
writer.Write(@"}");
}
// value is a float represented as required by Go's ParseFloat() function. In addition to
// standard numerical values, Nan, +Inf, and -Inf are valid values representing not a number,
// positive infinity, and negative infinity, respectively.
writer.Write(" ");
writer.Write(m.Value.ToString(CultureInfo.InvariantCulture));
writer.Write(" ");
// The timestamp is an int64 (milliseconds since epoch, i.e. 1970-01-01 00:00:00 UTC, excluding
// leap seconds), represented as required by Go's ParseInt() function.
writer.Write(now);
// Prometheus' text-based format is line oriented. Lines are separated
// by a line feed character (\n). The last line must end with a line
// feed character. Empty lines are ignored.
writer.Write("\n");
}
static string GetLabelAndValue(string label, string value)
{
var safeKey = GetSafeLabelName(label);
var safeValue = GetSafeLabelValue(value);
return $"{safeKey}=\"{safeValue}\"";
}
}
private static string GetSafeName(string name, char[] firstCharNameCharset, char[] charNameCharset)
{
// https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels
//
// Metric names and labels
// Every time series is uniquely identified by its metric name and a set of key-value pairs, also known as labels.
// The metric name specifies the general feature of a system that is measured (e.g. http_requests_total - the total number of HTTP requests received). It may contain ASCII letters and digits, as well as underscores and colons. It must match the regex [a-zA-Z_:][a-zA-Z0-9_:]*.
// Note: The colons are reserved for user defined recording rules. They should not be used by exporters or direct instrumentation.
// Labels enable Prometheus's dimensional data model: any given combination of labels for the same metric name identifies a particular dimensional instantiation of that metric (for example: all HTTP requests that used the method POST to the /api/tracks handler). The query language allows filtering and aggregation based on these dimensions. Changing any label value, including adding or removing a label, will create a new time series.
// Label names may contain ASCII letters, numbers, as well as underscores. They must match the regex [a-zA-Z_][a-zA-Z0-9_]*. Label names beginning with __ are reserved for internal use.
// Label values may contain any Unicode characters.
var sb = new StringBuilder();
var firstChar = name[0];
sb.Append(firstCharNameCharset.Contains(firstChar)
? firstChar
: GetSafeChar(char.ToLowerInvariant(firstChar), firstCharNameCharset));
for (var i = 1; i < name.Length; ++i)
{
sb.Append(GetSafeChar(name[i], charNameCharset));
}
return sb.ToString();
static char GetSafeChar(char c, char[] charset) => charset.Contains(c) ? c : '_';
}
private static string GetSafeMetricName(string name) => GetSafeName(name, FirstCharacterNameCharset, NameCharset);
private static string GetSafeLabelName(string name) => GetSafeName(name, FirstCharacterLabelCharset, LabelCharset);
private static string GetSafeLabelValue(string value)
{
// label_value can be any sequence of UTF-8 characters, but the backslash
// (\), double-quote ("), and line feed (\n) characters have to be escaped
// as \\, \", and \n, respectively.
var result = value.Replace("\\", "\\\\");
result = result.Replace("\n", "\\n");
result = result.Replace("\"", "\\\"");
return result;
}
private static string GetSafeMetricDescription(string description)
{
// HELP lines may contain any sequence of UTF-8 characters(after the metric name), but the backslash
// and the line feed characters have to be escaped as \\ and \n, respectively.Only one HELP line may
// exist for any given metric name.
var result = description.Replace(@"\", @"\\");
result = result.Replace("\n", @"\n");
return result;
}
internal class PrometheusMetricValueBuilder
{
public readonly ICollection<Tuple<string, string>> Labels = new List<Tuple<string, string>>();
public double Value;
public string Name;
public PrometheusMetricValueBuilder WithLabel(string name, string value)
{
this.Labels.Add(new Tuple<string, string>(name, value));
return this;
}
public PrometheusMetricValueBuilder WithValue(long metricValue)
{
this.Value = metricValue;
return this;
}
public PrometheusMetricValueBuilder WithValue(double metricValue)
{
this.Value = metricValue;
return this;
}
public PrometheusMetricValueBuilder WithName(string name)
{
this.Name = name;
return this;
}
}
}
}

View File

@ -1,19 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net452;net46;netstandard2.0</TargetFrameworks>
<Description>Prometheus exporter for OpenTelemetry .NET</Description>
<PackageTags>$(PackageTags);Prometheus</PackageTags>
<NoWarn>$(NoWarn),CS0618</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry\OpenTelemetry.csproj" />
<Compile Include="$(RepoRoot)\src\OpenTelemetry.Api\Internal\ExceptionExtensions.cs" Link="Includes\ExceptionExtensions.cs" />
<Compile Include="$(RepoRoot)\src\OpenTelemetry\Internal\DateTimeOffsetExtensions.net452.cs" Link="Includes\DateTimeOffsetExtensions.net452.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="$(MicrosoftAspNetCoreHttpAbstractionsPkgVer)" />
</ItemGroup>
</Project>

View File

@ -1,62 +0,0 @@
// <copyright file="PrometheusExporter.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using OpenTelemetry.Metrics.Export;
namespace OpenTelemetry.Exporter.Prometheus
{
/// <summary>
/// Exporter of OpenTelemetry metrics to Prometheus.
/// </summary>
public class PrometheusExporter : MetricExporter
{
internal readonly PrometheusExporterOptions Options;
/// <summary>
/// Initializes a new instance of the <see cref="PrometheusExporter"/> class.
/// </summary>
/// <param name="options">Options for the exporter.</param>
public PrometheusExporter(PrometheusExporterOptions options)
{
this.Options = options;
this.Metrics = new List<Metric>();
}
private List<Metric> Metrics { get; set; }
/// <inheritdoc/>
public override Task<ExportResult> ExportAsync(IEnumerable<Metric> metrics, CancellationToken cancellationToken)
{
// Prometheus uses a pull model, not a push.
// Accumulate the exported metrics internally, return success.
// The pull process will read this internally stored metrics
// at its own schedule.
this.Metrics.AddRange(metrics);
return Task.FromResult(ExportResult.Success);
}
internal List<Metric> GetAndClearMetrics()
{
// TODO harden this so as to not lose data if Export fails.
List<Metric> current = this.Metrics;
this.Metrics = new List<Metric>();
return current;
}
}
}

View File

@ -1,175 +0,0 @@
// <copyright file="PrometheusExporterExtensions.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System.Collections.Generic;
using System.IO;
using System.Text;
using OpenTelemetry.Exporter.Prometheus.Implementation;
using OpenTelemetry.Metrics.Export;
namespace OpenTelemetry.Exporter.Prometheus
{
/// <summary>
/// Helper to write metrics collection from exporter in Prometheus format.
/// </summary>
public static class PrometheusExporterExtensions
{
private const string PrometheusCounterType = "counter";
private const string PrometheusSummaryType = "summary";
private const string PrometheusSummarySumPostFix = "_sum";
private const string PrometheusSummaryCountPostFix = "_count";
private const string PrometheusSummaryQuantileLabelName = "quantile";
private const string PrometheusSummaryQuantileLabelValueForMin = "0";
private const string PrometheusSummaryQuantileLabelValueForMax = "1";
/// <summary>
/// Serialize to Prometheus Format.
/// </summary>
/// <param name="exporter">Prometheus Exporter.</param>
/// <param name="writer">StreamWriter to write to.</param>
public static void WriteMetricsCollection(this PrometheusExporter exporter, StreamWriter writer)
{
foreach (var metric in exporter.GetAndClearMetrics())
{
var builder = new PrometheusMetricBuilder()
.WithName(metric.MetricName)
.WithDescription(metric.MetricDescription);
foreach (var metricData in metric.Data)
{
var labels = metricData.Labels;
switch (metric.AggregationType)
{
case AggregationType.DoubleSum:
{
var sum = metricData as DoubleSumData;
var sumValue = sum.Sum;
WriteSum(writer, builder, labels, sumValue);
break;
}
case AggregationType.LongSum:
{
var sum = metricData as Int64SumData;
var sumValue = sum.Sum;
WriteSum(writer, builder, labels, sumValue);
break;
}
case AggregationType.DoubleSummary:
{
var summary = metricData as DoubleSummaryData;
var count = summary.Count;
var sum = summary.Sum;
var min = summary.Min;
var max = summary.Max;
WriteSummary(writer, builder, labels, metric.MetricName, sum, count, min, max);
break;
}
case AggregationType.Int64Summary:
{
var summary = metricData as Int64SummaryData;
var count = summary.Count;
var sum = summary.Sum;
var min = summary.Min;
var max = summary.Max;
WriteSummary(writer, builder, labels, metric.MetricName, sum, count, min, max);
break;
}
}
}
}
}
/// <summary>
/// Get Metrics Collection as a string.
/// </summary>
/// <param name="exporter"> Prometheus Exporter. </param>
/// <returns>Metrics serialized to string in Prometheus format.</returns>
public static string GetMetricsCollection(this PrometheusExporter exporter)
{
using var stream = new MemoryStream();
using var writer = new StreamWriter(stream);
WriteMetricsCollection(exporter, writer);
writer.Flush();
return Encoding.UTF8.GetString(stream.ToArray(), 0, (int)stream.Length);
}
private static void WriteSum(StreamWriter writer, PrometheusMetricBuilder builder, IEnumerable<KeyValuePair<string, string>> labels, double doubleValue)
{
builder = builder.WithType(PrometheusCounterType);
var metricValueBuilder = builder.AddValue();
metricValueBuilder = metricValueBuilder.WithValue(doubleValue);
foreach (var label in labels)
{
metricValueBuilder.WithLabel(label.Key, label.Value);
}
builder.Write(writer);
}
private static void WriteSummary(
StreamWriter writer,
PrometheusMetricBuilder builder,
IEnumerable<KeyValuePair<string, string>> labels,
string metricName,
double sum,
long count,
double min,
double max)
{
builder = builder.WithType(PrometheusSummaryType);
foreach (var label in labels)
{
/* For Summary we emit one row for Sum, Count, Min, Max.
Min,Max exports as quantile 0 and 1.
In future, when OpenTelemetry implements more aggregation
algorithms, this section will need to be revisited.
Sample output:
MyMeasure_sum{dim1="value1"} 750 1587013352982
MyMeasure_count{dim1="value1"} 5 1587013352982
MyMeasure{dim1="value2",quantile="0"} 150 1587013352982
MyMeasure{dim1="value2",quantile="1"} 150 1587013352982
*/
builder.AddValue()
.WithName(metricName + PrometheusSummarySumPostFix)
.WithLabel(label.Key, label.Value)
.WithValue(sum);
builder.AddValue()
.WithName(metricName + PrometheusSummaryCountPostFix)
.WithLabel(label.Key, label.Value)
.WithValue(count);
builder.AddValue()
.WithName(metricName)
.WithLabel(label.Key, label.Value)
.WithLabel(PrometheusSummaryQuantileLabelName, PrometheusSummaryQuantileLabelValueForMin)
.WithValue(min);
builder.AddValue()
.WithName(metricName)
.WithLabel(label.Key, label.Value)
.WithLabel(PrometheusSummaryQuantileLabelName, PrometheusSummaryQuantileLabelValueForMax)
.WithValue(max);
}
builder.Write(writer);
}
}
}

View File

@ -1,144 +0,0 @@
// <copyright file="PrometheusExporterMetricsHttpServer.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.IO;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using OpenTelemetry.Exporter.Prometheus.Implementation;
namespace OpenTelemetry.Exporter.Prometheus
{
/// <summary>
/// A HTTP listener used to expose Prometheus metrics.
/// </summary>
public class PrometheusExporterMetricsHttpServer : IDisposable
{
private readonly PrometheusExporter exporter;
private readonly HttpListener httpListener = new HttpListener();
private readonly object syncObject = new object();
private CancellationTokenSource tokenSource;
private Task workerThread;
/// <summary>
/// Initializes a new instance of the <see cref="PrometheusExporterMetricsHttpServer"/> class.
/// </summary>
/// <param name="exporter">The <see cref="PrometheusExporter"/> instance.</param>
public PrometheusExporterMetricsHttpServer(PrometheusExporter exporter)
{
this.exporter = exporter ?? throw new ArgumentNullException(nameof(exporter));
this.httpListener.Prefixes.Add(exporter.Options.Url);
}
/// <summary>
/// Start exporter.
/// </summary>
/// <param name="token">An optional <see cref="CancellationToken"/> that can be used to stop the htto server.</param>
public void Start(CancellationToken token = default)
{
lock (this.syncObject)
{
if (this.tokenSource != null)
{
return;
}
// link the passed in token if not null
this.tokenSource = token == default ?
new CancellationTokenSource() :
CancellationTokenSource.CreateLinkedTokenSource(token);
this.workerThread = Task.Factory.StartNew(this.WorkerThread, default, TaskCreationOptions.LongRunning, TaskScheduler.Default);
}
}
/// <summary>
/// Stop exporter.
/// </summary>
public void Stop()
{
lock (this.syncObject)
{
if (this.tokenSource == null)
{
return;
}
this.tokenSource.Cancel();
this.workerThread.Wait();
this.tokenSource = null;
}
}
/// <inheritdoc/>
public void Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
/// <summary>
/// Releases the unmanaged resources used by this class and optionally releases the managed resources.
/// </summary>
/// <param name="disposing"><see langword="true"/> to release both managed and unmanaged resources; <see langword="false"/> to release only unmanaged resources.</param>
protected virtual void Dispose(bool disposing)
{
if (this.httpListener != null && this.httpListener.IsListening)
{
this.Stop();
this.httpListener.Close();
}
}
private void WorkerThread()
{
this.httpListener.Start();
try
{
while (!this.tokenSource.IsCancellationRequested)
{
var ctxTask = this.httpListener.GetContextAsync();
ctxTask.Wait(this.tokenSource.Token);
var ctx = ctxTask.Result;
ctx.Response.StatusCode = 200;
ctx.Response.ContentType = PrometheusMetricBuilder.ContentType;
using var output = ctx.Response.OutputStream;
using var writer = new StreamWriter(output);
this.exporter.WriteMetricsCollection(writer);
}
}
catch (OperationCanceledException ex)
{
PrometheusExporterEventSource.Log.CanceledExport(ex);
}
catch (Exception ex)
{
PrometheusExporterEventSource.Log.FailedExport(ex);
}
finally
{
this.httpListener.Stop();
this.httpListener.Close();
}
}
}
}

View File

@ -1,60 +0,0 @@
// <copyright file="PrometheusExporterMiddleware.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Threading.Tasks;
#if NETSTANDARD2_0
using Microsoft.AspNetCore.Http;
namespace OpenTelemetry.Exporter.Prometheus
{
/// <summary>
/// A middleware used to expose Prometheus metrics.
/// </summary>
public class PrometheusExporterMiddleware
{
private readonly PrometheusExporter exporter;
/// <summary>
/// Initializes a new instance of the <see cref="PrometheusExporterMiddleware"/> class.
/// </summary>
/// <param name="next">The next middleware in the pipeline.</param>
/// <param name="exporter">The <see cref="PrometheusExporter"/> instance.</param>
public PrometheusExporterMiddleware(RequestDelegate next, PrometheusExporter exporter)
{
this.exporter = exporter ?? throw new ArgumentNullException(nameof(exporter));
}
/// <summary>
/// Invoke.
/// </summary>
/// <param name="httpContext"> context. </param>
/// <returns>Task. </returns>
public Task InvokeAsync(HttpContext httpContext)
{
if (httpContext is null)
{
throw new ArgumentNullException(nameof(httpContext));
}
var result = this.exporter.GetMetricsCollection();
return httpContext.Response.WriteAsync(result);
}
}
}
#endif

View File

@ -1,29 +0,0 @@
// <copyright file="PrometheusExporterOptions.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
namespace OpenTelemetry.Exporter.Prometheus
{
/// <summary>
/// Options to run prometheus exporter.
/// </summary>
public class PrometheusExporterOptions
{
/// <summary>
/// Gets or sets the port to listen to. Typically it ends with /metrics like http://localhost:9184/metrics/.
/// </summary>
public string Url { get; set; }
}
}

View File

@ -1,46 +0,0 @@
// <copyright file="PrometheusRouteBuilderExtensions.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
#if NETSTANDARD2_0
using Microsoft.AspNetCore.Http;
using OpenTelemetry.Exporter.Prometheus;
namespace Microsoft.AspNetCore.Builder
{
/// <summary>
/// Provides extension methods for <see cref="IApplicationBuilder"/> to add Prometheus Scraper Endpoint.
/// </summary>
public static class PrometheusRouteBuilderExtensions
{
private const string DefaultPath = "/metrics";
/// <summary>
/// Use prometheus extension.
/// </summary>
/// <param name="app">The <see cref="IApplicationBuilder"/> to add middleware to.</param>
/// <returns>A reference to the <see cref="IApplicationBuilder"/> instance after the operation has completed.</returns>
public static IApplicationBuilder UsePrometheus(this IApplicationBuilder app)
{
var options = app.ApplicationServices.GetService(typeof(PrometheusExporterOptions)) as PrometheusExporterOptions;
var path = new PathString(options?.Url ?? DefaultPath);
return app.Map(
new PathString(path),
builder => builder.UseMiddleware<PrometheusExporterMiddleware>());
}
}
}
#endif

View File

@ -1,29 +0,0 @@
# Prometheus Exporter for OpenTelemetry .NET
[![NuGet](https://img.shields.io/nuget/v/OpenTelemetry.Exporter.Prometheus.svg)](https://www.nuget.org/packages/OpenTelemetry.Exporter.Prometheus)
[![NuGet](https://img.shields.io/nuget/dt/OpenTelemetry.Exporter.Prometheus.svg)](https://www.nuget.org/packages/OpenTelemetry.Exporter.Prometheus)
## Prerequisite
* [Get Prometheus](https://prometheus.io/docs/introduction/first_steps/)
## Installation
```shell
dotnet add package OpenTelemetry.Exporter.Prometheus
```
## Configuration
You can configure the `PrometheusExporter` by following the directions below:
* `Url`: The url to listen to. Typically it ends with `/metrics` like `http://localhost:9184/metrics/`.
See
[`TestPrometheusExporter.cs`](../../examples/Console/TestPrometheusExporter.cs)
for example use.
## References
* [OpenTelemetry Project](https://opentelemetry.io/)
* [Prometheus](https://prometheus.io)

View File

@ -44,86 +44,6 @@ OpenTelemetry.ExportProcessorType.Simple = 0 -> OpenTelemetry.ExportProcessorTyp
OpenTelemetry.ExportResult
OpenTelemetry.ExportResult.Failure = 1 -> OpenTelemetry.ExportResult
OpenTelemetry.ExportResult.Success = 0 -> OpenTelemetry.ExportResult
OpenTelemetry.Metrics.Aggregators.Aggregator<T>
OpenTelemetry.Metrics.Aggregators.Aggregator<T>.Aggregator() -> void
OpenTelemetry.Metrics.Aggregators.Aggregator<T>.GetLastEndTimestamp() -> System.DateTimeOffset
OpenTelemetry.Metrics.Aggregators.Aggregator<T>.GetLastStartTimestamp() -> System.DateTimeOffset
OpenTelemetry.Metrics.Aggregators.DoubleCounterSumAggregator
OpenTelemetry.Metrics.Aggregators.DoubleCounterSumAggregator.DoubleCounterSumAggregator() -> void
OpenTelemetry.Metrics.Aggregators.DoubleLastValueAggregator
OpenTelemetry.Metrics.Aggregators.DoubleLastValueAggregator.DoubleLastValueAggregator() -> void
OpenTelemetry.Metrics.Aggregators.DoubleMeasureMinMaxSumCountAggregator
OpenTelemetry.Metrics.Aggregators.DoubleMeasureMinMaxSumCountAggregator.DoubleMeasureMinMaxSumCountAggregator() -> void
OpenTelemetry.Metrics.Aggregators.Int64CounterSumAggregator
OpenTelemetry.Metrics.Aggregators.Int64CounterSumAggregator.Int64CounterSumAggregator() -> void
OpenTelemetry.Metrics.Aggregators.Int64LastValueAggregator
OpenTelemetry.Metrics.Aggregators.Int64LastValueAggregator.Int64LastValueAggregator() -> void
OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator
OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator.Int64MeasureMinMaxSumCountAggregator() -> void
OpenTelemetry.Metrics.BoundCounterMetricSdkBase<T>
OpenTelemetry.Metrics.Export.AggregationType
OpenTelemetry.Metrics.Export.AggregationType.DoubleSum = 0 -> OpenTelemetry.Metrics.Export.AggregationType
OpenTelemetry.Metrics.Export.AggregationType.DoubleSummary = 2 -> OpenTelemetry.Metrics.Export.AggregationType
OpenTelemetry.Metrics.Export.AggregationType.Int64Summary = 3 -> OpenTelemetry.Metrics.Export.AggregationType
OpenTelemetry.Metrics.Export.AggregationType.LongSum = 1 -> OpenTelemetry.Metrics.Export.AggregationType
OpenTelemetry.Metrics.Export.DoubleSumData
OpenTelemetry.Metrics.Export.DoubleSumData.DoubleSumData() -> void
OpenTelemetry.Metrics.Export.DoubleSumData.Sum.get -> double
OpenTelemetry.Metrics.Export.DoubleSumData.Sum.set -> void
OpenTelemetry.Metrics.Export.DoubleSummaryData
OpenTelemetry.Metrics.Export.DoubleSummaryData.Count.get -> long
OpenTelemetry.Metrics.Export.DoubleSummaryData.Count.set -> void
OpenTelemetry.Metrics.Export.DoubleSummaryData.DoubleSummaryData() -> void
OpenTelemetry.Metrics.Export.DoubleSummaryData.Max.get -> double
OpenTelemetry.Metrics.Export.DoubleSummaryData.Max.set -> void
OpenTelemetry.Metrics.Export.DoubleSummaryData.Min.get -> double
OpenTelemetry.Metrics.Export.DoubleSummaryData.Min.set -> void
OpenTelemetry.Metrics.Export.DoubleSummaryData.Sum.get -> double
OpenTelemetry.Metrics.Export.DoubleSummaryData.Sum.set -> void
OpenTelemetry.Metrics.Export.Int64SumData
OpenTelemetry.Metrics.Export.Int64SumData.Int64SumData() -> void
OpenTelemetry.Metrics.Export.Int64SumData.Sum.get -> long
OpenTelemetry.Metrics.Export.Int64SumData.Sum.set -> void
OpenTelemetry.Metrics.Export.Int64SummaryData
OpenTelemetry.Metrics.Export.Int64SummaryData.Count.get -> long
OpenTelemetry.Metrics.Export.Int64SummaryData.Count.set -> void
OpenTelemetry.Metrics.Export.Int64SummaryData.Int64SummaryData() -> void
OpenTelemetry.Metrics.Export.Int64SummaryData.Max.get -> long
OpenTelemetry.Metrics.Export.Int64SummaryData.Max.set -> void
OpenTelemetry.Metrics.Export.Int64SummaryData.Min.get -> long
OpenTelemetry.Metrics.Export.Int64SummaryData.Min.set -> void
OpenTelemetry.Metrics.Export.Int64SummaryData.Sum.get -> long
OpenTelemetry.Metrics.Export.Int64SummaryData.Sum.set -> void
OpenTelemetry.Metrics.Export.Metric
OpenTelemetry.Metrics.Export.Metric.AggregationType.get -> OpenTelemetry.Metrics.Export.AggregationType
OpenTelemetry.Metrics.Export.Metric.Data.get -> System.Collections.Generic.List<OpenTelemetry.Metrics.Export.MetricData>
OpenTelemetry.Metrics.Export.Metric.Metric(string metricNamespace, string metricName, string desc, OpenTelemetry.Metrics.Export.AggregationType type) -> void
OpenTelemetry.Metrics.Export.Metric.MetricDescription.get -> string
OpenTelemetry.Metrics.Export.Metric.MetricName.get -> string
OpenTelemetry.Metrics.Export.Metric.MetricNamespace.get -> string
OpenTelemetry.Metrics.Export.MetricData
OpenTelemetry.Metrics.Export.MetricData.Labels.get -> System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>>
OpenTelemetry.Metrics.Export.MetricData.Labels.set -> void
OpenTelemetry.Metrics.Export.MetricData.MetricData() -> void
OpenTelemetry.Metrics.Export.MetricData.StartTimestamp.get -> System.DateTime
OpenTelemetry.Metrics.Export.MetricData.StartTimestamp.set -> void
OpenTelemetry.Metrics.Export.MetricData.Timestamp.get -> System.DateTime
OpenTelemetry.Metrics.Export.MetricData.Timestamp.set -> void
OpenTelemetry.Metrics.Export.MetricExporter
OpenTelemetry.Metrics.Export.MetricExporter.ExportResult
OpenTelemetry.Metrics.Export.MetricExporter.ExportResult.FailedNotRetryable = 1 -> OpenTelemetry.Metrics.Export.MetricExporter.ExportResult
OpenTelemetry.Metrics.Export.MetricExporter.ExportResult.FailedRetryable = 2 -> OpenTelemetry.Metrics.Export.MetricExporter.ExportResult
OpenTelemetry.Metrics.Export.MetricExporter.ExportResult.Success = 0 -> OpenTelemetry.Metrics.Export.MetricExporter.ExportResult
OpenTelemetry.Metrics.Export.MetricExporter.MetricExporter() -> void
OpenTelemetry.Metrics.Export.MetricProcessor
OpenTelemetry.Metrics.Export.MetricProcessor.MetricProcessor() -> void
OpenTelemetry.Metrics.Export.UngroupedBatcher
OpenTelemetry.Metrics.Export.UngroupedBatcher.UngroupedBatcher() -> void
OpenTelemetry.Metrics.MeterProviderBuilder
OpenTelemetry.Metrics.MeterProviderBuilder.Build() -> OpenTelemetry.Metrics.MeterProvider
OpenTelemetry.Metrics.MeterProviderBuilder.SetExporter(OpenTelemetry.Metrics.Export.MetricExporter exporter) -> OpenTelemetry.Metrics.MeterProviderBuilder
OpenTelemetry.Metrics.MeterProviderBuilder.SetProcessor(OpenTelemetry.Metrics.Export.MetricProcessor processor) -> OpenTelemetry.Metrics.MeterProviderBuilder
OpenTelemetry.Metrics.MeterProviderBuilder.SetPushInterval(System.TimeSpan pushInterval) -> OpenTelemetry.Metrics.MeterProviderBuilder
OpenTelemetry.ProviderExtensions
OpenTelemetry.Resources.Resource
OpenTelemetry.Resources.Resource.Attributes.get -> System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, object>>
@ -175,12 +95,6 @@ OpenTelemetry.Trace.TraceIdRatioBasedSampler.TraceIdRatioBasedSampler(double pro
OpenTelemetry.Trace.TracerProviderBuilderExtensions
OpenTelemetry.Trace.TracerProviderExtensions
abstract OpenTelemetry.BaseExporter<T>.Export(in OpenTelemetry.Batch<T> batch) -> OpenTelemetry.ExportResult
abstract OpenTelemetry.Metrics.Aggregators.Aggregator<T>.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
abstract OpenTelemetry.Metrics.Aggregators.Aggregator<T>.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
abstract OpenTelemetry.Metrics.BoundCounterMetricSdkBase<T>.GetAggregator() -> OpenTelemetry.Metrics.Aggregators.Aggregator<T>
abstract OpenTelemetry.Metrics.Export.MetricExporter.ExportAsync(System.Collections.Generic.IEnumerable<OpenTelemetry.Metrics.Export.Metric> metrics, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task<OpenTelemetry.Metrics.Export.MetricExporter.ExportResult>
abstract OpenTelemetry.Metrics.Export.MetricProcessor.FinishCollectionCycle(out System.Collections.Generic.IEnumerable<OpenTelemetry.Metrics.Export.Metric> metrics) -> void
abstract OpenTelemetry.Metrics.Export.MetricProcessor.Process(OpenTelemetry.Metrics.Export.Metric metric) -> void
abstract OpenTelemetry.Trace.Sampler.ShouldSample(in OpenTelemetry.Trace.SamplingParameters samplingParameters) -> OpenTelemetry.Trace.SamplingResult
override OpenTelemetry.BaseExportProcessor<T>.Dispose(bool disposing) -> void
override OpenTelemetry.BaseExportProcessor<T>.OnEnd(T data) -> void
@ -194,32 +108,6 @@ override OpenTelemetry.CompositeProcessor<T>.OnEnd(T data) -> void
override OpenTelemetry.CompositeProcessor<T>.OnForceFlush(int timeoutMilliseconds) -> bool
override OpenTelemetry.CompositeProcessor<T>.OnShutdown(int timeoutMilliseconds) -> bool
override OpenTelemetry.CompositeProcessor<T>.OnStart(T data) -> void
override OpenTelemetry.Metrics.Aggregators.DoubleCounterSumAggregator.Checkpoint() -> void
override OpenTelemetry.Metrics.Aggregators.DoubleCounterSumAggregator.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
override OpenTelemetry.Metrics.Aggregators.DoubleCounterSumAggregator.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
override OpenTelemetry.Metrics.Aggregators.DoubleCounterSumAggregator.Update(double value) -> void
override OpenTelemetry.Metrics.Aggregators.DoubleLastValueAggregator.Checkpoint() -> void
override OpenTelemetry.Metrics.Aggregators.DoubleLastValueAggregator.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
override OpenTelemetry.Metrics.Aggregators.DoubleLastValueAggregator.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
override OpenTelemetry.Metrics.Aggregators.DoubleLastValueAggregator.Update(double newValue) -> void
override OpenTelemetry.Metrics.Aggregators.DoubleMeasureMinMaxSumCountAggregator.Checkpoint() -> void
override OpenTelemetry.Metrics.Aggregators.DoubleMeasureMinMaxSumCountAggregator.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
override OpenTelemetry.Metrics.Aggregators.DoubleMeasureMinMaxSumCountAggregator.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
override OpenTelemetry.Metrics.Aggregators.DoubleMeasureMinMaxSumCountAggregator.Update(double value) -> void
override OpenTelemetry.Metrics.Aggregators.Int64CounterSumAggregator.Checkpoint() -> void
override OpenTelemetry.Metrics.Aggregators.Int64CounterSumAggregator.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
override OpenTelemetry.Metrics.Aggregators.Int64CounterSumAggregator.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
override OpenTelemetry.Metrics.Aggregators.Int64CounterSumAggregator.Update(long value) -> void
override OpenTelemetry.Metrics.Aggregators.Int64LastValueAggregator.Checkpoint() -> void
override OpenTelemetry.Metrics.Aggregators.Int64LastValueAggregator.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
override OpenTelemetry.Metrics.Aggregators.Int64LastValueAggregator.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
override OpenTelemetry.Metrics.Aggregators.Int64LastValueAggregator.Update(long newValue) -> void
override OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator.Checkpoint() -> void
override OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
override OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
override OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator.Update(long value) -> void
override OpenTelemetry.Metrics.Export.UngroupedBatcher.FinishCollectionCycle(out System.Collections.Generic.IEnumerable<OpenTelemetry.Metrics.Export.Metric> metrics) -> void
override OpenTelemetry.Metrics.Export.UngroupedBatcher.Process(OpenTelemetry.Metrics.Export.Metric metric) -> void
override OpenTelemetry.SimpleActivityExportProcessor.OnEnd(System.Diagnostics.Activity data) -> void
override OpenTelemetry.SimpleExportProcessor<T>.OnExport(T data) -> void
override OpenTelemetry.Trace.AlwaysOffSampler.ShouldSample(in OpenTelemetry.Trace.SamplingParameters samplingParameters) -> OpenTelemetry.Trace.SamplingResult
@ -239,7 +127,6 @@ static OpenTelemetry.Resources.ResourceBuilderExtensions.AddService(this OpenTel
static OpenTelemetry.Resources.ResourceBuilderExtensions.AddTelemetrySdk(this OpenTelemetry.Resources.ResourceBuilder resourceBuilder) -> OpenTelemetry.Resources.ResourceBuilder
static OpenTelemetry.Resources.ResourceBuilder.CreateDefault() -> OpenTelemetry.Resources.ResourceBuilder
static OpenTelemetry.Resources.ResourceBuilder.CreateEmpty() -> OpenTelemetry.Resources.ResourceBuilder
static OpenTelemetry.Sdk.CreateMeterProviderBuilder() -> OpenTelemetry.Metrics.MeterProviderBuilder
static OpenTelemetry.Sdk.CreateTracerProviderBuilder() -> OpenTelemetry.Trace.TracerProviderBuilder
static OpenTelemetry.Sdk.SetDefaultTextMapPropagator(OpenTelemetry.Context.Propagation.TextMapPropagator textMapPropagator) -> void
static OpenTelemetry.Sdk.SuppressInstrumentation.get -> bool
@ -260,6 +147,3 @@ virtual OpenTelemetry.BaseProcessor<T>.OnEnd(T data) -> void
virtual OpenTelemetry.BaseProcessor<T>.OnForceFlush(int timeoutMilliseconds) -> bool
virtual OpenTelemetry.BaseProcessor<T>.OnShutdown(int timeoutMilliseconds) -> bool
virtual OpenTelemetry.BaseProcessor<T>.OnStart(T data) -> void
virtual OpenTelemetry.Metrics.Aggregators.Aggregator<T>.Checkpoint() -> void
virtual OpenTelemetry.Metrics.Aggregators.Aggregator<T>.HasCheckpointData() -> bool
virtual OpenTelemetry.Metrics.Aggregators.Aggregator<T>.Update(T value) -> void

View File

@ -44,86 +44,6 @@ OpenTelemetry.ExportProcessorType.Simple = 0 -> OpenTelemetry.ExportProcessorTyp
OpenTelemetry.ExportResult
OpenTelemetry.ExportResult.Failure = 1 -> OpenTelemetry.ExportResult
OpenTelemetry.ExportResult.Success = 0 -> OpenTelemetry.ExportResult
OpenTelemetry.Metrics.Aggregators.Aggregator<T>
OpenTelemetry.Metrics.Aggregators.Aggregator<T>.Aggregator() -> void
OpenTelemetry.Metrics.Aggregators.Aggregator<T>.GetLastEndTimestamp() -> System.DateTimeOffset
OpenTelemetry.Metrics.Aggregators.Aggregator<T>.GetLastStartTimestamp() -> System.DateTimeOffset
OpenTelemetry.Metrics.Aggregators.DoubleCounterSumAggregator
OpenTelemetry.Metrics.Aggregators.DoubleCounterSumAggregator.DoubleCounterSumAggregator() -> void
OpenTelemetry.Metrics.Aggregators.DoubleLastValueAggregator
OpenTelemetry.Metrics.Aggregators.DoubleLastValueAggregator.DoubleLastValueAggregator() -> void
OpenTelemetry.Metrics.Aggregators.DoubleMeasureMinMaxSumCountAggregator
OpenTelemetry.Metrics.Aggregators.DoubleMeasureMinMaxSumCountAggregator.DoubleMeasureMinMaxSumCountAggregator() -> void
OpenTelemetry.Metrics.Aggregators.Int64CounterSumAggregator
OpenTelemetry.Metrics.Aggregators.Int64CounterSumAggregator.Int64CounterSumAggregator() -> void
OpenTelemetry.Metrics.Aggregators.Int64LastValueAggregator
OpenTelemetry.Metrics.Aggregators.Int64LastValueAggregator.Int64LastValueAggregator() -> void
OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator
OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator.Int64MeasureMinMaxSumCountAggregator() -> void
OpenTelemetry.Metrics.BoundCounterMetricSdkBase<T>
OpenTelemetry.Metrics.Export.AggregationType
OpenTelemetry.Metrics.Export.AggregationType.DoubleSum = 0 -> OpenTelemetry.Metrics.Export.AggregationType
OpenTelemetry.Metrics.Export.AggregationType.DoubleSummary = 2 -> OpenTelemetry.Metrics.Export.AggregationType
OpenTelemetry.Metrics.Export.AggregationType.Int64Summary = 3 -> OpenTelemetry.Metrics.Export.AggregationType
OpenTelemetry.Metrics.Export.AggregationType.LongSum = 1 -> OpenTelemetry.Metrics.Export.AggregationType
OpenTelemetry.Metrics.Export.DoubleSumData
OpenTelemetry.Metrics.Export.DoubleSumData.DoubleSumData() -> void
OpenTelemetry.Metrics.Export.DoubleSumData.Sum.get -> double
OpenTelemetry.Metrics.Export.DoubleSumData.Sum.set -> void
OpenTelemetry.Metrics.Export.DoubleSummaryData
OpenTelemetry.Metrics.Export.DoubleSummaryData.Count.get -> long
OpenTelemetry.Metrics.Export.DoubleSummaryData.Count.set -> void
OpenTelemetry.Metrics.Export.DoubleSummaryData.DoubleSummaryData() -> void
OpenTelemetry.Metrics.Export.DoubleSummaryData.Max.get -> double
OpenTelemetry.Metrics.Export.DoubleSummaryData.Max.set -> void
OpenTelemetry.Metrics.Export.DoubleSummaryData.Min.get -> double
OpenTelemetry.Metrics.Export.DoubleSummaryData.Min.set -> void
OpenTelemetry.Metrics.Export.DoubleSummaryData.Sum.get -> double
OpenTelemetry.Metrics.Export.DoubleSummaryData.Sum.set -> void
OpenTelemetry.Metrics.Export.Int64SumData
OpenTelemetry.Metrics.Export.Int64SumData.Int64SumData() -> void
OpenTelemetry.Metrics.Export.Int64SumData.Sum.get -> long
OpenTelemetry.Metrics.Export.Int64SumData.Sum.set -> void
OpenTelemetry.Metrics.Export.Int64SummaryData
OpenTelemetry.Metrics.Export.Int64SummaryData.Count.get -> long
OpenTelemetry.Metrics.Export.Int64SummaryData.Count.set -> void
OpenTelemetry.Metrics.Export.Int64SummaryData.Int64SummaryData() -> void
OpenTelemetry.Metrics.Export.Int64SummaryData.Max.get -> long
OpenTelemetry.Metrics.Export.Int64SummaryData.Max.set -> void
OpenTelemetry.Metrics.Export.Int64SummaryData.Min.get -> long
OpenTelemetry.Metrics.Export.Int64SummaryData.Min.set -> void
OpenTelemetry.Metrics.Export.Int64SummaryData.Sum.get -> long
OpenTelemetry.Metrics.Export.Int64SummaryData.Sum.set -> void
OpenTelemetry.Metrics.Export.Metric
OpenTelemetry.Metrics.Export.Metric.AggregationType.get -> OpenTelemetry.Metrics.Export.AggregationType
OpenTelemetry.Metrics.Export.Metric.Data.get -> System.Collections.Generic.List<OpenTelemetry.Metrics.Export.MetricData>
OpenTelemetry.Metrics.Export.Metric.Metric(string metricNamespace, string metricName, string desc, OpenTelemetry.Metrics.Export.AggregationType type) -> void
OpenTelemetry.Metrics.Export.Metric.MetricDescription.get -> string
OpenTelemetry.Metrics.Export.Metric.MetricName.get -> string
OpenTelemetry.Metrics.Export.Metric.MetricNamespace.get -> string
OpenTelemetry.Metrics.Export.MetricData
OpenTelemetry.Metrics.Export.MetricData.Labels.get -> System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>>
OpenTelemetry.Metrics.Export.MetricData.Labels.set -> void
OpenTelemetry.Metrics.Export.MetricData.MetricData() -> void
OpenTelemetry.Metrics.Export.MetricData.StartTimestamp.get -> System.DateTime
OpenTelemetry.Metrics.Export.MetricData.StartTimestamp.set -> void
OpenTelemetry.Metrics.Export.MetricData.Timestamp.get -> System.DateTime
OpenTelemetry.Metrics.Export.MetricData.Timestamp.set -> void
OpenTelemetry.Metrics.Export.MetricExporter
OpenTelemetry.Metrics.Export.MetricExporter.ExportResult
OpenTelemetry.Metrics.Export.MetricExporter.ExportResult.FailedNotRetryable = 1 -> OpenTelemetry.Metrics.Export.MetricExporter.ExportResult
OpenTelemetry.Metrics.Export.MetricExporter.ExportResult.FailedRetryable = 2 -> OpenTelemetry.Metrics.Export.MetricExporter.ExportResult
OpenTelemetry.Metrics.Export.MetricExporter.ExportResult.Success = 0 -> OpenTelemetry.Metrics.Export.MetricExporter.ExportResult
OpenTelemetry.Metrics.Export.MetricExporter.MetricExporter() -> void
OpenTelemetry.Metrics.Export.MetricProcessor
OpenTelemetry.Metrics.Export.MetricProcessor.MetricProcessor() -> void
OpenTelemetry.Metrics.Export.UngroupedBatcher
OpenTelemetry.Metrics.Export.UngroupedBatcher.UngroupedBatcher() -> void
OpenTelemetry.Metrics.MeterProviderBuilder
OpenTelemetry.Metrics.MeterProviderBuilder.Build() -> OpenTelemetry.Metrics.MeterProvider
OpenTelemetry.Metrics.MeterProviderBuilder.SetExporter(OpenTelemetry.Metrics.Export.MetricExporter exporter) -> OpenTelemetry.Metrics.MeterProviderBuilder
OpenTelemetry.Metrics.MeterProviderBuilder.SetProcessor(OpenTelemetry.Metrics.Export.MetricProcessor processor) -> OpenTelemetry.Metrics.MeterProviderBuilder
OpenTelemetry.Metrics.MeterProviderBuilder.SetPushInterval(System.TimeSpan pushInterval) -> OpenTelemetry.Metrics.MeterProviderBuilder
OpenTelemetry.ProviderExtensions
OpenTelemetry.Resources.Resource
OpenTelemetry.Resources.Resource.Attributes.get -> System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, object>>
@ -175,12 +95,6 @@ OpenTelemetry.Trace.TraceIdRatioBasedSampler.TraceIdRatioBasedSampler(double pro
OpenTelemetry.Trace.TracerProviderBuilderExtensions
OpenTelemetry.Trace.TracerProviderExtensions
abstract OpenTelemetry.BaseExporter<T>.Export(in OpenTelemetry.Batch<T> batch) -> OpenTelemetry.ExportResult
abstract OpenTelemetry.Metrics.Aggregators.Aggregator<T>.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
abstract OpenTelemetry.Metrics.Aggregators.Aggregator<T>.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
abstract OpenTelemetry.Metrics.BoundCounterMetricSdkBase<T>.GetAggregator() -> OpenTelemetry.Metrics.Aggregators.Aggregator<T>
abstract OpenTelemetry.Metrics.Export.MetricExporter.ExportAsync(System.Collections.Generic.IEnumerable<OpenTelemetry.Metrics.Export.Metric> metrics, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task<OpenTelemetry.Metrics.Export.MetricExporter.ExportResult>
abstract OpenTelemetry.Metrics.Export.MetricProcessor.FinishCollectionCycle(out System.Collections.Generic.IEnumerable<OpenTelemetry.Metrics.Export.Metric> metrics) -> void
abstract OpenTelemetry.Metrics.Export.MetricProcessor.Process(OpenTelemetry.Metrics.Export.Metric metric) -> void
abstract OpenTelemetry.Trace.Sampler.ShouldSample(in OpenTelemetry.Trace.SamplingParameters samplingParameters) -> OpenTelemetry.Trace.SamplingResult
override OpenTelemetry.BaseExportProcessor<T>.Dispose(bool disposing) -> void
override OpenTelemetry.BaseExportProcessor<T>.OnEnd(T data) -> void
@ -194,32 +108,6 @@ override OpenTelemetry.CompositeProcessor<T>.OnEnd(T data) -> void
override OpenTelemetry.CompositeProcessor<T>.OnForceFlush(int timeoutMilliseconds) -> bool
override OpenTelemetry.CompositeProcessor<T>.OnShutdown(int timeoutMilliseconds) -> bool
override OpenTelemetry.CompositeProcessor<T>.OnStart(T data) -> void
override OpenTelemetry.Metrics.Aggregators.DoubleCounterSumAggregator.Checkpoint() -> void
override OpenTelemetry.Metrics.Aggregators.DoubleCounterSumAggregator.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
override OpenTelemetry.Metrics.Aggregators.DoubleCounterSumAggregator.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
override OpenTelemetry.Metrics.Aggregators.DoubleCounterSumAggregator.Update(double value) -> void
override OpenTelemetry.Metrics.Aggregators.DoubleLastValueAggregator.Checkpoint() -> void
override OpenTelemetry.Metrics.Aggregators.DoubleLastValueAggregator.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
override OpenTelemetry.Metrics.Aggregators.DoubleLastValueAggregator.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
override OpenTelemetry.Metrics.Aggregators.DoubleLastValueAggregator.Update(double newValue) -> void
override OpenTelemetry.Metrics.Aggregators.DoubleMeasureMinMaxSumCountAggregator.Checkpoint() -> void
override OpenTelemetry.Metrics.Aggregators.DoubleMeasureMinMaxSumCountAggregator.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
override OpenTelemetry.Metrics.Aggregators.DoubleMeasureMinMaxSumCountAggregator.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
override OpenTelemetry.Metrics.Aggregators.DoubleMeasureMinMaxSumCountAggregator.Update(double value) -> void
override OpenTelemetry.Metrics.Aggregators.Int64CounterSumAggregator.Checkpoint() -> void
override OpenTelemetry.Metrics.Aggregators.Int64CounterSumAggregator.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
override OpenTelemetry.Metrics.Aggregators.Int64CounterSumAggregator.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
override OpenTelemetry.Metrics.Aggregators.Int64CounterSumAggregator.Update(long value) -> void
override OpenTelemetry.Metrics.Aggregators.Int64LastValueAggregator.Checkpoint() -> void
override OpenTelemetry.Metrics.Aggregators.Int64LastValueAggregator.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
override OpenTelemetry.Metrics.Aggregators.Int64LastValueAggregator.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
override OpenTelemetry.Metrics.Aggregators.Int64LastValueAggregator.Update(long newValue) -> void
override OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator.Checkpoint() -> void
override OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
override OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
override OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator.Update(long value) -> void
override OpenTelemetry.Metrics.Export.UngroupedBatcher.FinishCollectionCycle(out System.Collections.Generic.IEnumerable<OpenTelemetry.Metrics.Export.Metric> metrics) -> void
override OpenTelemetry.Metrics.Export.UngroupedBatcher.Process(OpenTelemetry.Metrics.Export.Metric metric) -> void
override OpenTelemetry.SimpleActivityExportProcessor.OnEnd(System.Diagnostics.Activity data) -> void
override OpenTelemetry.SimpleExportProcessor<T>.OnExport(T data) -> void
override OpenTelemetry.Trace.AlwaysOffSampler.ShouldSample(in OpenTelemetry.Trace.SamplingParameters samplingParameters) -> OpenTelemetry.Trace.SamplingResult
@ -239,7 +127,6 @@ static OpenTelemetry.Resources.ResourceBuilderExtensions.AddService(this OpenTel
static OpenTelemetry.Resources.ResourceBuilderExtensions.AddTelemetrySdk(this OpenTelemetry.Resources.ResourceBuilder resourceBuilder) -> OpenTelemetry.Resources.ResourceBuilder
static OpenTelemetry.Resources.ResourceBuilder.CreateDefault() -> OpenTelemetry.Resources.ResourceBuilder
static OpenTelemetry.Resources.ResourceBuilder.CreateEmpty() -> OpenTelemetry.Resources.ResourceBuilder
static OpenTelemetry.Sdk.CreateMeterProviderBuilder() -> OpenTelemetry.Metrics.MeterProviderBuilder
static OpenTelemetry.Sdk.CreateTracerProviderBuilder() -> OpenTelemetry.Trace.TracerProviderBuilder
static OpenTelemetry.Sdk.SetDefaultTextMapPropagator(OpenTelemetry.Context.Propagation.TextMapPropagator textMapPropagator) -> void
static OpenTelemetry.Sdk.SuppressInstrumentation.get -> bool
@ -260,6 +147,3 @@ virtual OpenTelemetry.BaseProcessor<T>.OnEnd(T data) -> void
virtual OpenTelemetry.BaseProcessor<T>.OnForceFlush(int timeoutMilliseconds) -> bool
virtual OpenTelemetry.BaseProcessor<T>.OnShutdown(int timeoutMilliseconds) -> bool
virtual OpenTelemetry.BaseProcessor<T>.OnStart(T data) -> void
virtual OpenTelemetry.Metrics.Aggregators.Aggregator<T>.Checkpoint() -> void
virtual OpenTelemetry.Metrics.Aggregators.Aggregator<T>.HasCheckpointData() -> bool
virtual OpenTelemetry.Metrics.Aggregators.Aggregator<T>.Update(T value) -> void

View File

@ -65,86 +65,6 @@ OpenTelemetry.Logs.OpenTelemetryLoggerProvider
OpenTelemetry.Logs.OpenTelemetryLoggerProvider.CreateLogger(string categoryName) -> Microsoft.Extensions.Logging.ILogger
OpenTelemetry.Logs.OpenTelemetryLoggerProvider.Dispose() -> void
OpenTelemetry.Logs.OpenTelemetryLoggerProvider.OpenTelemetryLoggerProvider(Microsoft.Extensions.Options.IOptionsMonitor<OpenTelemetry.Logs.OpenTelemetryLoggerOptions> options) -> void
OpenTelemetry.Metrics.Aggregators.Aggregator<T>
OpenTelemetry.Metrics.Aggregators.Aggregator<T>.Aggregator() -> void
OpenTelemetry.Metrics.Aggregators.Aggregator<T>.GetLastEndTimestamp() -> System.DateTimeOffset
OpenTelemetry.Metrics.Aggregators.Aggregator<T>.GetLastStartTimestamp() -> System.DateTimeOffset
OpenTelemetry.Metrics.Aggregators.DoubleCounterSumAggregator
OpenTelemetry.Metrics.Aggregators.DoubleCounterSumAggregator.DoubleCounterSumAggregator() -> void
OpenTelemetry.Metrics.Aggregators.DoubleLastValueAggregator
OpenTelemetry.Metrics.Aggregators.DoubleLastValueAggregator.DoubleLastValueAggregator() -> void
OpenTelemetry.Metrics.Aggregators.DoubleMeasureMinMaxSumCountAggregator
OpenTelemetry.Metrics.Aggregators.DoubleMeasureMinMaxSumCountAggregator.DoubleMeasureMinMaxSumCountAggregator() -> void
OpenTelemetry.Metrics.Aggregators.Int64CounterSumAggregator
OpenTelemetry.Metrics.Aggregators.Int64CounterSumAggregator.Int64CounterSumAggregator() -> void
OpenTelemetry.Metrics.Aggregators.Int64LastValueAggregator
OpenTelemetry.Metrics.Aggregators.Int64LastValueAggregator.Int64LastValueAggregator() -> void
OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator
OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator.Int64MeasureMinMaxSumCountAggregator() -> void
OpenTelemetry.Metrics.BoundCounterMetricSdkBase<T>
OpenTelemetry.Metrics.Export.AggregationType
OpenTelemetry.Metrics.Export.AggregationType.DoubleSum = 0 -> OpenTelemetry.Metrics.Export.AggregationType
OpenTelemetry.Metrics.Export.AggregationType.DoubleSummary = 2 -> OpenTelemetry.Metrics.Export.AggregationType
OpenTelemetry.Metrics.Export.AggregationType.Int64Summary = 3 -> OpenTelemetry.Metrics.Export.AggregationType
OpenTelemetry.Metrics.Export.AggregationType.LongSum = 1 -> OpenTelemetry.Metrics.Export.AggregationType
OpenTelemetry.Metrics.Export.DoubleSumData
OpenTelemetry.Metrics.Export.DoubleSumData.DoubleSumData() -> void
OpenTelemetry.Metrics.Export.DoubleSumData.Sum.get -> double
OpenTelemetry.Metrics.Export.DoubleSumData.Sum.set -> void
OpenTelemetry.Metrics.Export.DoubleSummaryData
OpenTelemetry.Metrics.Export.DoubleSummaryData.Count.get -> long
OpenTelemetry.Metrics.Export.DoubleSummaryData.Count.set -> void
OpenTelemetry.Metrics.Export.DoubleSummaryData.DoubleSummaryData() -> void
OpenTelemetry.Metrics.Export.DoubleSummaryData.Max.get -> double
OpenTelemetry.Metrics.Export.DoubleSummaryData.Max.set -> void
OpenTelemetry.Metrics.Export.DoubleSummaryData.Min.get -> double
OpenTelemetry.Metrics.Export.DoubleSummaryData.Min.set -> void
OpenTelemetry.Metrics.Export.DoubleSummaryData.Sum.get -> double
OpenTelemetry.Metrics.Export.DoubleSummaryData.Sum.set -> void
OpenTelemetry.Metrics.Export.Int64SumData
OpenTelemetry.Metrics.Export.Int64SumData.Int64SumData() -> void
OpenTelemetry.Metrics.Export.Int64SumData.Sum.get -> long
OpenTelemetry.Metrics.Export.Int64SumData.Sum.set -> void
OpenTelemetry.Metrics.Export.Int64SummaryData
OpenTelemetry.Metrics.Export.Int64SummaryData.Count.get -> long
OpenTelemetry.Metrics.Export.Int64SummaryData.Count.set -> void
OpenTelemetry.Metrics.Export.Int64SummaryData.Int64SummaryData() -> void
OpenTelemetry.Metrics.Export.Int64SummaryData.Max.get -> long
OpenTelemetry.Metrics.Export.Int64SummaryData.Max.set -> void
OpenTelemetry.Metrics.Export.Int64SummaryData.Min.get -> long
OpenTelemetry.Metrics.Export.Int64SummaryData.Min.set -> void
OpenTelemetry.Metrics.Export.Int64SummaryData.Sum.get -> long
OpenTelemetry.Metrics.Export.Int64SummaryData.Sum.set -> void
OpenTelemetry.Metrics.Export.Metric
OpenTelemetry.Metrics.Export.Metric.AggregationType.get -> OpenTelemetry.Metrics.Export.AggregationType
OpenTelemetry.Metrics.Export.Metric.Data.get -> System.Collections.Generic.List<OpenTelemetry.Metrics.Export.MetricData>
OpenTelemetry.Metrics.Export.Metric.Metric(string metricNamespace, string metricName, string desc, OpenTelemetry.Metrics.Export.AggregationType type) -> void
OpenTelemetry.Metrics.Export.Metric.MetricDescription.get -> string
OpenTelemetry.Metrics.Export.Metric.MetricName.get -> string
OpenTelemetry.Metrics.Export.Metric.MetricNamespace.get -> string
OpenTelemetry.Metrics.Export.MetricData
OpenTelemetry.Metrics.Export.MetricData.Labels.get -> System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>>
OpenTelemetry.Metrics.Export.MetricData.Labels.set -> void
OpenTelemetry.Metrics.Export.MetricData.MetricData() -> void
OpenTelemetry.Metrics.Export.MetricData.StartTimestamp.get -> System.DateTime
OpenTelemetry.Metrics.Export.MetricData.StartTimestamp.set -> void
OpenTelemetry.Metrics.Export.MetricData.Timestamp.get -> System.DateTime
OpenTelemetry.Metrics.Export.MetricData.Timestamp.set -> void
OpenTelemetry.Metrics.Export.MetricExporter
OpenTelemetry.Metrics.Export.MetricExporter.ExportResult
OpenTelemetry.Metrics.Export.MetricExporter.ExportResult.FailedNotRetryable = 1 -> OpenTelemetry.Metrics.Export.MetricExporter.ExportResult
OpenTelemetry.Metrics.Export.MetricExporter.ExportResult.FailedRetryable = 2 -> OpenTelemetry.Metrics.Export.MetricExporter.ExportResult
OpenTelemetry.Metrics.Export.MetricExporter.ExportResult.Success = 0 -> OpenTelemetry.Metrics.Export.MetricExporter.ExportResult
OpenTelemetry.Metrics.Export.MetricExporter.MetricExporter() -> void
OpenTelemetry.Metrics.Export.MetricProcessor
OpenTelemetry.Metrics.Export.MetricProcessor.MetricProcessor() -> void
OpenTelemetry.Metrics.Export.UngroupedBatcher
OpenTelemetry.Metrics.Export.UngroupedBatcher.UngroupedBatcher() -> void
OpenTelemetry.Metrics.MeterProviderBuilder
OpenTelemetry.Metrics.MeterProviderBuilder.Build() -> OpenTelemetry.Metrics.MeterProvider
OpenTelemetry.Metrics.MeterProviderBuilder.SetExporter(OpenTelemetry.Metrics.Export.MetricExporter exporter) -> OpenTelemetry.Metrics.MeterProviderBuilder
OpenTelemetry.Metrics.MeterProviderBuilder.SetProcessor(OpenTelemetry.Metrics.Export.MetricProcessor processor) -> OpenTelemetry.Metrics.MeterProviderBuilder
OpenTelemetry.Metrics.MeterProviderBuilder.SetPushInterval(System.TimeSpan pushInterval) -> OpenTelemetry.Metrics.MeterProviderBuilder
OpenTelemetry.ProviderExtensions
OpenTelemetry.Resources.Resource
OpenTelemetry.Resources.Resource.Attributes.get -> System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, object>>
@ -198,12 +118,6 @@ OpenTelemetry.Trace.TraceIdRatioBasedSampler.TraceIdRatioBasedSampler(double pro
OpenTelemetry.Trace.TracerProviderBuilderExtensions
OpenTelemetry.Trace.TracerProviderExtensions
abstract OpenTelemetry.BaseExporter<T>.Export(in OpenTelemetry.Batch<T> batch) -> OpenTelemetry.ExportResult
abstract OpenTelemetry.Metrics.Aggregators.Aggregator<T>.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
abstract OpenTelemetry.Metrics.Aggregators.Aggregator<T>.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
abstract OpenTelemetry.Metrics.BoundCounterMetricSdkBase<T>.GetAggregator() -> OpenTelemetry.Metrics.Aggregators.Aggregator<T>
abstract OpenTelemetry.Metrics.Export.MetricExporter.ExportAsync(System.Collections.Generic.IEnumerable<OpenTelemetry.Metrics.Export.Metric> metrics, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task<OpenTelemetry.Metrics.Export.MetricExporter.ExportResult>
abstract OpenTelemetry.Metrics.Export.MetricProcessor.FinishCollectionCycle(out System.Collections.Generic.IEnumerable<OpenTelemetry.Metrics.Export.Metric> metrics) -> void
abstract OpenTelemetry.Metrics.Export.MetricProcessor.Process(OpenTelemetry.Metrics.Export.Metric metric) -> void
abstract OpenTelemetry.Trace.Sampler.ShouldSample(in OpenTelemetry.Trace.SamplingParameters samplingParameters) -> OpenTelemetry.Trace.SamplingResult
override OpenTelemetry.BaseExportProcessor<T>.Dispose(bool disposing) -> void
override OpenTelemetry.BaseExportProcessor<T>.OnEnd(T data) -> void
@ -217,32 +131,6 @@ override OpenTelemetry.CompositeProcessor<T>.OnEnd(T data) -> void
override OpenTelemetry.CompositeProcessor<T>.OnForceFlush(int timeoutMilliseconds) -> bool
override OpenTelemetry.CompositeProcessor<T>.OnShutdown(int timeoutMilliseconds) -> bool
override OpenTelemetry.CompositeProcessor<T>.OnStart(T data) -> void
override OpenTelemetry.Metrics.Aggregators.DoubleCounterSumAggregator.Checkpoint() -> void
override OpenTelemetry.Metrics.Aggregators.DoubleCounterSumAggregator.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
override OpenTelemetry.Metrics.Aggregators.DoubleCounterSumAggregator.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
override OpenTelemetry.Metrics.Aggregators.DoubleCounterSumAggregator.Update(double value) -> void
override OpenTelemetry.Metrics.Aggregators.DoubleLastValueAggregator.Checkpoint() -> void
override OpenTelemetry.Metrics.Aggregators.DoubleLastValueAggregator.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
override OpenTelemetry.Metrics.Aggregators.DoubleLastValueAggregator.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
override OpenTelemetry.Metrics.Aggregators.DoubleLastValueAggregator.Update(double newValue) -> void
override OpenTelemetry.Metrics.Aggregators.DoubleMeasureMinMaxSumCountAggregator.Checkpoint() -> void
override OpenTelemetry.Metrics.Aggregators.DoubleMeasureMinMaxSumCountAggregator.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
override OpenTelemetry.Metrics.Aggregators.DoubleMeasureMinMaxSumCountAggregator.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
override OpenTelemetry.Metrics.Aggregators.DoubleMeasureMinMaxSumCountAggregator.Update(double value) -> void
override OpenTelemetry.Metrics.Aggregators.Int64CounterSumAggregator.Checkpoint() -> void
override OpenTelemetry.Metrics.Aggregators.Int64CounterSumAggregator.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
override OpenTelemetry.Metrics.Aggregators.Int64CounterSumAggregator.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
override OpenTelemetry.Metrics.Aggregators.Int64CounterSumAggregator.Update(long value) -> void
override OpenTelemetry.Metrics.Aggregators.Int64LastValueAggregator.Checkpoint() -> void
override OpenTelemetry.Metrics.Aggregators.Int64LastValueAggregator.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
override OpenTelemetry.Metrics.Aggregators.Int64LastValueAggregator.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
override OpenTelemetry.Metrics.Aggregators.Int64LastValueAggregator.Update(long newValue) -> void
override OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator.Checkpoint() -> void
override OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
override OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
override OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator.Update(long value) -> void
override OpenTelemetry.Metrics.Export.UngroupedBatcher.FinishCollectionCycle(out System.Collections.Generic.IEnumerable<OpenTelemetry.Metrics.Export.Metric> metrics) -> void
override OpenTelemetry.Metrics.Export.UngroupedBatcher.Process(OpenTelemetry.Metrics.Export.Metric metric) -> void
override OpenTelemetry.SimpleActivityExportProcessor.OnEnd(System.Diagnostics.Activity data) -> void
override OpenTelemetry.SimpleExportProcessor<T>.OnExport(T data) -> void
override OpenTelemetry.Trace.AlwaysOffSampler.ShouldSample(in OpenTelemetry.Trace.SamplingParameters samplingParameters) -> OpenTelemetry.Trace.SamplingResult
@ -263,7 +151,6 @@ static OpenTelemetry.Resources.ResourceBuilderExtensions.AddService(this OpenTel
static OpenTelemetry.Resources.ResourceBuilderExtensions.AddTelemetrySdk(this OpenTelemetry.Resources.ResourceBuilder resourceBuilder) -> OpenTelemetry.Resources.ResourceBuilder
static OpenTelemetry.Resources.ResourceBuilder.CreateDefault() -> OpenTelemetry.Resources.ResourceBuilder
static OpenTelemetry.Resources.ResourceBuilder.CreateEmpty() -> OpenTelemetry.Resources.ResourceBuilder
static OpenTelemetry.Sdk.CreateMeterProviderBuilder() -> OpenTelemetry.Metrics.MeterProviderBuilder
static OpenTelemetry.Sdk.CreateTracerProviderBuilder() -> OpenTelemetry.Trace.TracerProviderBuilder
static OpenTelemetry.Sdk.SetDefaultTextMapPropagator(OpenTelemetry.Context.Propagation.TextMapPropagator textMapPropagator) -> void
static OpenTelemetry.Sdk.SuppressInstrumentation.get -> bool
@ -285,6 +172,3 @@ virtual OpenTelemetry.BaseProcessor<T>.OnForceFlush(int timeoutMilliseconds) ->
virtual OpenTelemetry.BaseProcessor<T>.OnShutdown(int timeoutMilliseconds) -> bool
virtual OpenTelemetry.BaseProcessor<T>.OnStart(T data) -> void
virtual OpenTelemetry.Logs.OpenTelemetryLoggerProvider.Dispose(bool disposing) -> void
virtual OpenTelemetry.Metrics.Aggregators.Aggregator<T>.Checkpoint() -> void
virtual OpenTelemetry.Metrics.Aggregators.Aggregator<T>.HasCheckpointData() -> bool
virtual OpenTelemetry.Metrics.Aggregators.Aggregator<T>.Update(T value) -> void

View File

@ -65,86 +65,6 @@ OpenTelemetry.Logs.OpenTelemetryLoggerProvider
OpenTelemetry.Logs.OpenTelemetryLoggerProvider.CreateLogger(string categoryName) -> Microsoft.Extensions.Logging.ILogger
OpenTelemetry.Logs.OpenTelemetryLoggerProvider.Dispose() -> void
OpenTelemetry.Logs.OpenTelemetryLoggerProvider.OpenTelemetryLoggerProvider(Microsoft.Extensions.Options.IOptionsMonitor<OpenTelemetry.Logs.OpenTelemetryLoggerOptions> options) -> void
OpenTelemetry.Metrics.Aggregators.Aggregator<T>
OpenTelemetry.Metrics.Aggregators.Aggregator<T>.Aggregator() -> void
OpenTelemetry.Metrics.Aggregators.Aggregator<T>.GetLastEndTimestamp() -> System.DateTimeOffset
OpenTelemetry.Metrics.Aggregators.Aggregator<T>.GetLastStartTimestamp() -> System.DateTimeOffset
OpenTelemetry.Metrics.Aggregators.DoubleCounterSumAggregator
OpenTelemetry.Metrics.Aggregators.DoubleCounterSumAggregator.DoubleCounterSumAggregator() -> void
OpenTelemetry.Metrics.Aggregators.DoubleLastValueAggregator
OpenTelemetry.Metrics.Aggregators.DoubleLastValueAggregator.DoubleLastValueAggregator() -> void
OpenTelemetry.Metrics.Aggregators.DoubleMeasureMinMaxSumCountAggregator
OpenTelemetry.Metrics.Aggregators.DoubleMeasureMinMaxSumCountAggregator.DoubleMeasureMinMaxSumCountAggregator() -> void
OpenTelemetry.Metrics.Aggregators.Int64CounterSumAggregator
OpenTelemetry.Metrics.Aggregators.Int64CounterSumAggregator.Int64CounterSumAggregator() -> void
OpenTelemetry.Metrics.Aggregators.Int64LastValueAggregator
OpenTelemetry.Metrics.Aggregators.Int64LastValueAggregator.Int64LastValueAggregator() -> void
OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator
OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator.Int64MeasureMinMaxSumCountAggregator() -> void
OpenTelemetry.Metrics.BoundCounterMetricSdkBase<T>
OpenTelemetry.Metrics.Export.AggregationType
OpenTelemetry.Metrics.Export.AggregationType.DoubleSum = 0 -> OpenTelemetry.Metrics.Export.AggregationType
OpenTelemetry.Metrics.Export.AggregationType.DoubleSummary = 2 -> OpenTelemetry.Metrics.Export.AggregationType
OpenTelemetry.Metrics.Export.AggregationType.Int64Summary = 3 -> OpenTelemetry.Metrics.Export.AggregationType
OpenTelemetry.Metrics.Export.AggregationType.LongSum = 1 -> OpenTelemetry.Metrics.Export.AggregationType
OpenTelemetry.Metrics.Export.DoubleSumData
OpenTelemetry.Metrics.Export.DoubleSumData.DoubleSumData() -> void
OpenTelemetry.Metrics.Export.DoubleSumData.Sum.get -> double
OpenTelemetry.Metrics.Export.DoubleSumData.Sum.set -> void
OpenTelemetry.Metrics.Export.DoubleSummaryData
OpenTelemetry.Metrics.Export.DoubleSummaryData.Count.get -> long
OpenTelemetry.Metrics.Export.DoubleSummaryData.Count.set -> void
OpenTelemetry.Metrics.Export.DoubleSummaryData.DoubleSummaryData() -> void
OpenTelemetry.Metrics.Export.DoubleSummaryData.Max.get -> double
OpenTelemetry.Metrics.Export.DoubleSummaryData.Max.set -> void
OpenTelemetry.Metrics.Export.DoubleSummaryData.Min.get -> double
OpenTelemetry.Metrics.Export.DoubleSummaryData.Min.set -> void
OpenTelemetry.Metrics.Export.DoubleSummaryData.Sum.get -> double
OpenTelemetry.Metrics.Export.DoubleSummaryData.Sum.set -> void
OpenTelemetry.Metrics.Export.Int64SumData
OpenTelemetry.Metrics.Export.Int64SumData.Int64SumData() -> void
OpenTelemetry.Metrics.Export.Int64SumData.Sum.get -> long
OpenTelemetry.Metrics.Export.Int64SumData.Sum.set -> void
OpenTelemetry.Metrics.Export.Int64SummaryData
OpenTelemetry.Metrics.Export.Int64SummaryData.Count.get -> long
OpenTelemetry.Metrics.Export.Int64SummaryData.Count.set -> void
OpenTelemetry.Metrics.Export.Int64SummaryData.Int64SummaryData() -> void
OpenTelemetry.Metrics.Export.Int64SummaryData.Max.get -> long
OpenTelemetry.Metrics.Export.Int64SummaryData.Max.set -> void
OpenTelemetry.Metrics.Export.Int64SummaryData.Min.get -> long
OpenTelemetry.Metrics.Export.Int64SummaryData.Min.set -> void
OpenTelemetry.Metrics.Export.Int64SummaryData.Sum.get -> long
OpenTelemetry.Metrics.Export.Int64SummaryData.Sum.set -> void
OpenTelemetry.Metrics.Export.Metric
OpenTelemetry.Metrics.Export.Metric.AggregationType.get -> OpenTelemetry.Metrics.Export.AggregationType
OpenTelemetry.Metrics.Export.Metric.Data.get -> System.Collections.Generic.List<OpenTelemetry.Metrics.Export.MetricData>
OpenTelemetry.Metrics.Export.Metric.Metric(string metricNamespace, string metricName, string desc, OpenTelemetry.Metrics.Export.AggregationType type) -> void
OpenTelemetry.Metrics.Export.Metric.MetricDescription.get -> string
OpenTelemetry.Metrics.Export.Metric.MetricName.get -> string
OpenTelemetry.Metrics.Export.Metric.MetricNamespace.get -> string
OpenTelemetry.Metrics.Export.MetricData
OpenTelemetry.Metrics.Export.MetricData.Labels.get -> System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>>
OpenTelemetry.Metrics.Export.MetricData.Labels.set -> void
OpenTelemetry.Metrics.Export.MetricData.MetricData() -> void
OpenTelemetry.Metrics.Export.MetricData.StartTimestamp.get -> System.DateTime
OpenTelemetry.Metrics.Export.MetricData.StartTimestamp.set -> void
OpenTelemetry.Metrics.Export.MetricData.Timestamp.get -> System.DateTime
OpenTelemetry.Metrics.Export.MetricData.Timestamp.set -> void
OpenTelemetry.Metrics.Export.MetricExporter
OpenTelemetry.Metrics.Export.MetricExporter.ExportResult
OpenTelemetry.Metrics.Export.MetricExporter.ExportResult.FailedNotRetryable = 1 -> OpenTelemetry.Metrics.Export.MetricExporter.ExportResult
OpenTelemetry.Metrics.Export.MetricExporter.ExportResult.FailedRetryable = 2 -> OpenTelemetry.Metrics.Export.MetricExporter.ExportResult
OpenTelemetry.Metrics.Export.MetricExporter.ExportResult.Success = 0 -> OpenTelemetry.Metrics.Export.MetricExporter.ExportResult
OpenTelemetry.Metrics.Export.MetricExporter.MetricExporter() -> void
OpenTelemetry.Metrics.Export.MetricProcessor
OpenTelemetry.Metrics.Export.MetricProcessor.MetricProcessor() -> void
OpenTelemetry.Metrics.Export.UngroupedBatcher
OpenTelemetry.Metrics.Export.UngroupedBatcher.UngroupedBatcher() -> void
OpenTelemetry.Metrics.MeterProviderBuilder
OpenTelemetry.Metrics.MeterProviderBuilder.Build() -> OpenTelemetry.Metrics.MeterProvider
OpenTelemetry.Metrics.MeterProviderBuilder.SetExporter(OpenTelemetry.Metrics.Export.MetricExporter exporter) -> OpenTelemetry.Metrics.MeterProviderBuilder
OpenTelemetry.Metrics.MeterProviderBuilder.SetProcessor(OpenTelemetry.Metrics.Export.MetricProcessor processor) -> OpenTelemetry.Metrics.MeterProviderBuilder
OpenTelemetry.Metrics.MeterProviderBuilder.SetPushInterval(System.TimeSpan pushInterval) -> OpenTelemetry.Metrics.MeterProviderBuilder
OpenTelemetry.ProviderExtensions
OpenTelemetry.Resources.Resource
OpenTelemetry.Resources.Resource.Attributes.get -> System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, object>>
@ -198,12 +118,6 @@ OpenTelemetry.Trace.TraceIdRatioBasedSampler.TraceIdRatioBasedSampler(double pro
OpenTelemetry.Trace.TracerProviderBuilderExtensions
OpenTelemetry.Trace.TracerProviderExtensions
abstract OpenTelemetry.BaseExporter<T>.Export(in OpenTelemetry.Batch<T> batch) -> OpenTelemetry.ExportResult
abstract OpenTelemetry.Metrics.Aggregators.Aggregator<T>.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
abstract OpenTelemetry.Metrics.Aggregators.Aggregator<T>.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
abstract OpenTelemetry.Metrics.BoundCounterMetricSdkBase<T>.GetAggregator() -> OpenTelemetry.Metrics.Aggregators.Aggregator<T>
abstract OpenTelemetry.Metrics.Export.MetricExporter.ExportAsync(System.Collections.Generic.IEnumerable<OpenTelemetry.Metrics.Export.Metric> metrics, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task<OpenTelemetry.Metrics.Export.MetricExporter.ExportResult>
abstract OpenTelemetry.Metrics.Export.MetricProcessor.FinishCollectionCycle(out System.Collections.Generic.IEnumerable<OpenTelemetry.Metrics.Export.Metric> metrics) -> void
abstract OpenTelemetry.Metrics.Export.MetricProcessor.Process(OpenTelemetry.Metrics.Export.Metric metric) -> void
abstract OpenTelemetry.Trace.Sampler.ShouldSample(in OpenTelemetry.Trace.SamplingParameters samplingParameters) -> OpenTelemetry.Trace.SamplingResult
override OpenTelemetry.BaseExportProcessor<T>.Dispose(bool disposing) -> void
override OpenTelemetry.BaseExportProcessor<T>.OnEnd(T data) -> void
@ -217,32 +131,6 @@ override OpenTelemetry.CompositeProcessor<T>.OnEnd(T data) -> void
override OpenTelemetry.CompositeProcessor<T>.OnForceFlush(int timeoutMilliseconds) -> bool
override OpenTelemetry.CompositeProcessor<T>.OnShutdown(int timeoutMilliseconds) -> bool
override OpenTelemetry.CompositeProcessor<T>.OnStart(T data) -> void
override OpenTelemetry.Metrics.Aggregators.DoubleCounterSumAggregator.Checkpoint() -> void
override OpenTelemetry.Metrics.Aggregators.DoubleCounterSumAggregator.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
override OpenTelemetry.Metrics.Aggregators.DoubleCounterSumAggregator.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
override OpenTelemetry.Metrics.Aggregators.DoubleCounterSumAggregator.Update(double value) -> void
override OpenTelemetry.Metrics.Aggregators.DoubleLastValueAggregator.Checkpoint() -> void
override OpenTelemetry.Metrics.Aggregators.DoubleLastValueAggregator.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
override OpenTelemetry.Metrics.Aggregators.DoubleLastValueAggregator.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
override OpenTelemetry.Metrics.Aggregators.DoubleLastValueAggregator.Update(double newValue) -> void
override OpenTelemetry.Metrics.Aggregators.DoubleMeasureMinMaxSumCountAggregator.Checkpoint() -> void
override OpenTelemetry.Metrics.Aggregators.DoubleMeasureMinMaxSumCountAggregator.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
override OpenTelemetry.Metrics.Aggregators.DoubleMeasureMinMaxSumCountAggregator.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
override OpenTelemetry.Metrics.Aggregators.DoubleMeasureMinMaxSumCountAggregator.Update(double value) -> void
override OpenTelemetry.Metrics.Aggregators.Int64CounterSumAggregator.Checkpoint() -> void
override OpenTelemetry.Metrics.Aggregators.Int64CounterSumAggregator.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
override OpenTelemetry.Metrics.Aggregators.Int64CounterSumAggregator.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
override OpenTelemetry.Metrics.Aggregators.Int64CounterSumAggregator.Update(long value) -> void
override OpenTelemetry.Metrics.Aggregators.Int64LastValueAggregator.Checkpoint() -> void
override OpenTelemetry.Metrics.Aggregators.Int64LastValueAggregator.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
override OpenTelemetry.Metrics.Aggregators.Int64LastValueAggregator.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
override OpenTelemetry.Metrics.Aggregators.Int64LastValueAggregator.Update(long newValue) -> void
override OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator.Checkpoint() -> void
override OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator.GetAggregationType() -> OpenTelemetry.Metrics.Export.AggregationType
override OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator.ToMetricData() -> OpenTelemetry.Metrics.Export.MetricData
override OpenTelemetry.Metrics.Aggregators.Int64MeasureMinMaxSumCountAggregator.Update(long value) -> void
override OpenTelemetry.Metrics.Export.UngroupedBatcher.FinishCollectionCycle(out System.Collections.Generic.IEnumerable<OpenTelemetry.Metrics.Export.Metric> metrics) -> void
override OpenTelemetry.Metrics.Export.UngroupedBatcher.Process(OpenTelemetry.Metrics.Export.Metric metric) -> void
override OpenTelemetry.SimpleActivityExportProcessor.OnEnd(System.Diagnostics.Activity data) -> void
override OpenTelemetry.SimpleExportProcessor<T>.OnExport(T data) -> void
override OpenTelemetry.Trace.AlwaysOffSampler.ShouldSample(in OpenTelemetry.Trace.SamplingParameters samplingParameters) -> OpenTelemetry.Trace.SamplingResult
@ -263,7 +151,6 @@ static OpenTelemetry.Resources.ResourceBuilderExtensions.AddService(this OpenTel
static OpenTelemetry.Resources.ResourceBuilderExtensions.AddTelemetrySdk(this OpenTelemetry.Resources.ResourceBuilder resourceBuilder) -> OpenTelemetry.Resources.ResourceBuilder
static OpenTelemetry.Resources.ResourceBuilder.CreateDefault() -> OpenTelemetry.Resources.ResourceBuilder
static OpenTelemetry.Resources.ResourceBuilder.CreateEmpty() -> OpenTelemetry.Resources.ResourceBuilder
static OpenTelemetry.Sdk.CreateMeterProviderBuilder() -> OpenTelemetry.Metrics.MeterProviderBuilder
static OpenTelemetry.Sdk.CreateTracerProviderBuilder() -> OpenTelemetry.Trace.TracerProviderBuilder
static OpenTelemetry.Sdk.SetDefaultTextMapPropagator(OpenTelemetry.Context.Propagation.TextMapPropagator textMapPropagator) -> void
static OpenTelemetry.Sdk.SuppressInstrumentation.get -> bool
@ -285,6 +172,3 @@ virtual OpenTelemetry.BaseProcessor<T>.OnForceFlush(int timeoutMilliseconds) ->
virtual OpenTelemetry.BaseProcessor<T>.OnShutdown(int timeoutMilliseconds) -> bool
virtual OpenTelemetry.BaseProcessor<T>.OnStart(T data) -> void
virtual OpenTelemetry.Logs.OpenTelemetryLoggerProvider.Dispose(bool disposing) -> void
virtual OpenTelemetry.Metrics.Aggregators.Aggregator<T>.Checkpoint() -> void
virtual OpenTelemetry.Metrics.Aggregators.Aggregator<T>.HasCheckpointData() -> bool
virtual OpenTelemetry.Metrics.Aggregators.Aggregator<T>.Update(T value) -> void

View File

@ -36,6 +36,9 @@
* Fixed a bug to allow the Self Diagnostics log file to be opened simutaneously
by another process in read-only mode for .NET Framework.
([#1693](https://github.com/open-telemetry/opentelemetry-dotnet/pull/1693))
* Metrics removed as it is not part 1.0.0 release. See issue
[#1501](https://github.com/open-telemetry/opentelemetry-dotnet/pull/1655)
for details on Metric release plans.
## 1.0.0-rc1.1

View File

@ -1,116 +0,0 @@
// <copyright file="Aggregator.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Threading;
using OpenTelemetry.Metrics.Export;
namespace OpenTelemetry.Metrics.Aggregators
{
/// <summary>
/// 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
{
private AggState active;
private AggState checkpoint;
protected Aggregator()
{
this.checkpoint = new AggState();
this.active = new AggState();
}
/// <summary>
/// Adds value to the running total in a thread safe manner.
/// </summary>
/// <param name="value">Value to be aggregated.</param>
public virtual void Update(T value)
{
this.active.Increment();
}
/// <summary>
/// Checkpoints the current aggregate data, and resets the state.
/// </summary>
public virtual void Checkpoint()
{
// checkpoints the start time for the current aggregation, and sets the new start time.
this.checkpoint = Interlocked.Exchange(ref this.active, new AggState());
}
/// <summary>
/// Check if checkpoint has any aggregated data.
/// </summary>
/// <returns>true if data was presented to aggregator.</returns>
public virtual bool HasCheckpointData()
{
return this.checkpoint.Count > 0;
}
/// <summary>
/// Convert checkpoint aggregator data to MetricData.
/// </summary>
/// <returns>An instance of <see cref="MetricData"/> representing the currently aggregated value.</returns>
public abstract MetricData ToMetricData();
/// <summary>
/// Get Aggregation Type.
/// </summary>
/// <returns><see cref="AggregationType"/>.</returns>
public abstract AggregationType GetAggregationType();
/// <summary>
/// Get the last interval end time before <see cref="Checkpoint"/> was called.
/// </summary>
/// <returns>The end timestamp of the last aggregated checkpoint.</returns>
protected DateTimeOffset GetLastEndTimestamp()
{
return new DateTimeOffset(this.active.StartTimeTicks, TimeSpan.Zero).Subtract(TimeSpan.FromTicks(1));
}
/// <summary>
/// Get the last interval start time before <see cref="Checkpoint"/> was called.
/// </summary>
/// <returns>The start timestamp of the last aggregated checkpoint.</returns>
protected DateTimeOffset GetLastStartTimestamp()
{
return new DateTimeOffset(this.checkpoint.StartTimeTicks, TimeSpan.Zero);
}
private class AggState
{
private long count = 0;
public AggState()
{
this.StartTimeTicks = DateTimeOffset.UtcNow.Ticks;
}
public long Count { get => this.count; }
public long StartTimeTicks { get; }
public void Increment()
{
Interlocked.Increment(ref this.count);
}
}
}
}

View File

@ -1,72 +0,0 @@
// <copyright file="DoubleCounterSumAggregator.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Threading;
using OpenTelemetry.Metrics.Export;
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;
private double checkPoint;
/// <inheritdoc/>
public override void Checkpoint()
{
// checkpoints the current running sum into checkpoint, and starts counting again.
base.Checkpoint();
this.checkPoint = Interlocked.Exchange(ref this.sum, 0.0);
}
/// <inheritdoc/>
public override MetricData ToMetricData()
{
return new DoubleSumData
{
StartTimestamp = new DateTime(this.GetLastStartTimestamp().Ticks),
Sum = this.checkPoint,
Timestamp = new DateTime(this.GetLastEndTimestamp().Ticks),
};
}
/// <inheritdoc/>
public override AggregationType GetAggregationType()
{
return AggregationType.DoubleSum;
}
/// <inheritdoc/>
public override void Update(double value)
{
base.Update(value);
// Adds value to the running total in a thread safe manner.
double initialTotal, computedTotal;
do
{
initialTotal = this.sum;
computedTotal = initialTotal + value;
}
while (initialTotal != Interlocked.CompareExchange(ref this.sum, computedTotal, initialTotal));
}
}
}

View File

@ -1,63 +0,0 @@
// <copyright file="DoubleLastValueAggregator.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Threading;
using OpenTelemetry.Metrics.Export;
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;
private double checkpoint;
/// <inheritdoc/>
public override void Checkpoint()
{
base.Checkpoint();
Interlocked.Exchange(ref this.checkpoint, this.value);
}
/// <inheritdoc/>
public override MetricData ToMetricData()
{
return new DoubleSumData
{
StartTimestamp = new DateTime(this.GetLastStartTimestamp().Ticks),
Sum = this.checkpoint,
Timestamp = new DateTime(this.GetLastEndTimestamp().Ticks),
};
}
/// <inheritdoc/>
public override AggregationType GetAggregationType()
{
return AggregationType.DoubleSum;
}
/// <inheritdoc/>
public override void Update(double newValue)
{
base.Update(newValue);
Interlocked.Exchange(ref this.value, newValue);
}
}
}

View File

@ -1,87 +0,0 @@
// <copyright file="DoubleMeasureMinMaxSumCountAggregator.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Threading;
using OpenTelemetry.Metrics.Export;
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();
private DoubleSummary checkPoint = new DoubleSummary();
private object updateLock = new object();
/// <inheritdoc/>
public override void Checkpoint()
{
base.Checkpoint();
this.checkPoint = Interlocked.Exchange(ref this.summary, new DoubleSummary());
}
/// <inheritdoc/>
public override AggregationType GetAggregationType()
{
return AggregationType.DoubleSummary;
}
/// <inheritdoc/>
public override MetricData ToMetricData()
{
return new DoubleSummaryData
{
Count = this.checkPoint.Count,
StartTimestamp = new DateTime(this.GetLastStartTimestamp().Ticks),
Sum = this.checkPoint.Sum,
Min = this.checkPoint.Min,
Max = this.checkPoint.Max,
Timestamp = new DateTime(this.GetLastEndTimestamp().Ticks),
};
}
/// <inheritdoc/>
public override void Update(double value)
{
lock (this.updateLock)
{
base.Update(value);
this.summary.Count++;
this.summary.Sum += value;
this.summary.Max = Math.Max(this.summary.Max, value);
this.summary.Min = Math.Min(this.summary.Min, value);
}
}
private class DoubleSummary
{
public long Count;
public double Min;
public double Max;
public double Sum;
public DoubleSummary()
{
this.Min = double.MaxValue;
this.Max = double.MinValue;
}
}
}
}

View File

@ -1,66 +0,0 @@
// <copyright file="Int64CounterSumAggregator.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Threading;
using OpenTelemetry.Metrics.Export;
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;
private long checkPoint;
/// <inheritdoc/>
public override void Checkpoint()
{
// checkpoints the current running sum into checkpoint, and starts counting again.
base.Checkpoint();
this.checkPoint = Interlocked.Exchange(ref this.sum, 0);
}
/// <inheritdoc/>
public override MetricData ToMetricData()
{
return new Int64SumData
{
StartTimestamp = new DateTime(this.GetLastStartTimestamp().Ticks),
Sum = this.checkPoint,
Timestamp = new DateTime(this.GetLastEndTimestamp().Ticks),
};
}
/// <inheritdoc/>
public override AggregationType GetAggregationType()
{
return AggregationType.LongSum;
}
/// <inheritdoc/>
public override void Update(long value)
{
base.Update(value);
// Adds value to the running total in a thread safe manner.
Interlocked.Add(ref this.sum, value);
}
}
}

View File

@ -1,63 +0,0 @@
// <copyright file="Int64LastValueAggregator.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Threading;
using OpenTelemetry.Metrics.Export;
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 Int64LastValueAggregator : Aggregator<long>
{
private long value;
private long checkpoint;
/// <inheritdoc/>
public override void Checkpoint()
{
base.Checkpoint();
Interlocked.Exchange(ref this.checkpoint, this.value);
}
/// <inheritdoc/>
public override MetricData ToMetricData()
{
return new Int64SumData
{
StartTimestamp = new DateTime(this.GetLastStartTimestamp().Ticks),
Sum = this.checkpoint,
Timestamp = new DateTime(this.GetLastEndTimestamp().Ticks),
};
}
/// <inheritdoc/>
public override AggregationType GetAggregationType()
{
return AggregationType.LongSum;
}
/// <inheritdoc/>
public override void Update(long newValue)
{
base.Update(newValue);
Interlocked.Exchange(ref this.value, newValue);
}
}
}

View File

@ -1,87 +0,0 @@
// <copyright file="Int64MeasureMinMaxSumCountAggregator.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Threading;
using OpenTelemetry.Metrics.Export;
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 Int64MeasureMinMaxSumCountAggregator : Aggregator<long>
{
private LongSummary summary = new LongSummary();
private LongSummary checkPoint = new LongSummary();
private object updateLock = new object();
/// <inheritdoc/>
public override void Checkpoint()
{
base.Checkpoint();
this.checkPoint = Interlocked.Exchange(ref this.summary, new LongSummary());
}
/// <inheritdoc/>
public override AggregationType GetAggregationType()
{
return AggregationType.Int64Summary;
}
/// <inheritdoc/>
public override MetricData ToMetricData()
{
return new Int64SummaryData
{
Count = this.checkPoint.Count,
StartTimestamp = new DateTime(this.GetLastStartTimestamp().Ticks),
Sum = this.checkPoint.Sum,
Min = this.checkPoint.Min,
Max = this.checkPoint.Max,
Timestamp = new DateTime(this.GetLastEndTimestamp().Ticks),
};
}
/// <inheritdoc/>
public override void Update(long value)
{
lock (this.updateLock)
{
base.Update(value);
this.summary.Count++;
this.summary.Sum += value;
this.summary.Max = Math.Max(this.summary.Max, value);
this.summary.Min = Math.Min(this.summary.Min, value);
}
}
private class LongSummary
{
public long Count;
public long Min;
public long Max;
public long Sum;
public LongSummary()
{
this.Min = long.MaxValue;
this.Max = long.MinValue;
}
}
}
}

View File

@ -1,35 +0,0 @@
// <copyright file="BoundCounterMetricSdkBase.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using OpenTelemetry.Metrics.Aggregators;
namespace OpenTelemetry.Metrics
{
[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 BoundCounterMetricSdkBase<T> : BoundCounterMetric<T>
where T : struct
{
internal RecordStatus Status;
internal BoundCounterMetricSdkBase(RecordStatus recordStatus)
{
this.Status = recordStatus;
}
public abstract Aggregator<T> GetAggregator();
}
}

View File

@ -1,26 +0,0 @@
// <copyright file="BoundMeasureMetricSdkBase.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using OpenTelemetry.Metrics.Aggregators;
namespace OpenTelemetry.Metrics
{
internal abstract class BoundMeasureMetricSdkBase<T> : BoundMeasureMetric<T>
where T : struct
{
public abstract Aggregator<T> GetAggregator();
}
}

View File

@ -1,135 +0,0 @@
// <copyright file="CounterMetricSdkBase.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
namespace OpenTelemetry.Metrics
{
internal abstract class CounterMetricSdkBase<T> : CounterMetric<T>
where T : struct
{
// Lock used to sync with Bind/UnBind.
private readonly object bindUnbindLock = new object();
private readonly ConcurrentDictionary<LabelSet, BoundCounterMetricSdkBase<T>> counterBoundInstruments =
new ConcurrentDictionary<LabelSet, BoundCounterMetricSdkBase<T>>();
private readonly Func<LabelSet, BoundCounterMetricSdkBase<T>> createBoundMetricFunc;
private readonly Func<LabelSet, BoundCounterMetricSdkBase<T>> createShortLivedMetricFunc;
private string metricName;
protected CounterMetricSdkBase(string name)
{
this.metricName = name;
this.createBoundMetricFunc = (_) => this.CreateMetric(RecordStatus.Bound);
this.createShortLivedMetricFunc = (_) => this.CreateMetric(RecordStatus.UpdatePending);
}
public ConcurrentDictionary<LabelSet, BoundCounterMetricSdkBase<T>> GetAllBoundInstruments()
{
return this.counterBoundInstruments;
}
public override BoundCounterMetric<T> Bind(LabelSet labelset)
{
// user making Bind call means record is not shortlived.
return this.Bind(labelset, isShortLived: false);
}
public override BoundCounterMetric<T> Bind(IEnumerable<KeyValuePair<string, string>> labels)
{
// user making Bind call means record is not shortlived.
return this.Bind(new LabelSetSdk(labels), isShortLived: false);
}
internal BoundCounterMetric<T> Bind(LabelSet labelset, bool isShortLived)
{
BoundCounterMetricSdkBase<T> boundInstrument;
lock (this.bindUnbindLock)
{
boundInstrument = this.counterBoundInstruments.GetOrAdd(
labelset,
isShortLived ? this.createShortLivedMetricFunc : this.createBoundMetricFunc);
}
switch (boundInstrument.Status)
{
case RecordStatus.NoPendingUpdate:
boundInstrument.Status = RecordStatus.UpdatePending;
break;
case RecordStatus.CandidateForRemoval:
{
// if boundInstrument is marked for removal, then take the
// lock to sync with Unbind() and re-add. As Collect() might have called Unbind().
/*
* If Unbind gets the lock first, then it'd have removed the record.
* But it gets added again by Bind() so no record is lost.
* If Bind method gets this lock first, it'd promote record to UpdatePending, so that
* Unbind will leave this record untouched.
* Additional notes:
* This lock is never taken for bound instruments, and they offer the fastest performance.
* This lock is only taken for those labelsets which are marked CandidateForRemoval.
* It means the the 1st time a labelset is re-encountered after two Collect() has occurred,
* this lock must be taken. Subsequent usage of this labelset before the next two Collect()
* will already have status promoted, and no lock is taken.
* In effect, the lock is only taken for those labelsets
* which was used once, then not used for two collect(), and then used within the subsequent
* Collect().
*
* Its important to note that, for a brand new LabelSet being encountered for the 1st time, lock is not
* taken. Lock is taken only during the 1st re-appearance of a LabelSet after a Collect period.
*
*/
lock (this.bindUnbindLock)
{
boundInstrument.Status = RecordStatus.UpdatePending;
boundInstrument = this.counterBoundInstruments.GetOrAdd(labelset, boundInstrument);
}
break;
}
}
return boundInstrument;
}
internal void UnBind(LabelSet labelSet)
{
lock (this.bindUnbindLock)
{
if (this.counterBoundInstruments.TryGetValue(labelSet, out var boundInstrument))
{
// Check status again, inside lock as an instrument update
// might have occurred which promoted this record.
if (boundInstrument.Status == RecordStatus.CandidateForRemoval)
{
this.counterBoundInstruments.TryRemove(labelSet, out boundInstrument);
}
}
}
}
protected abstract BoundCounterMetricSdkBase<T> CreateMetric(RecordStatus recordStatus);
}
}

View File

@ -1,46 +0,0 @@
// <copyright file="DoubleBoundCounterMetricSdk.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using OpenTelemetry.Metrics.Aggregators;
using OpenTelemetry.Trace;
namespace OpenTelemetry.Metrics
{
internal class DoubleBoundCounterMetricSdk : BoundCounterMetricSdkBase<double>
{
private readonly DoubleCounterSumAggregator sumAggregator = new DoubleCounterSumAggregator();
public DoubleBoundCounterMetricSdk(RecordStatus recordStatus)
: base(recordStatus)
{
}
public override void Add(in SpanContext context, double value)
{
this.sumAggregator.Update(value);
}
public override void Add(in Baggage context, double value)
{
this.sumAggregator.Update(value);
}
public override Aggregator<double> GetAggregator()
{
return this.sumAggregator;
}
}
}

View File

@ -1,41 +0,0 @@
// <copyright file="DoubleBoundMeasureMetricSdk.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using OpenTelemetry.Metrics.Aggregators;
using OpenTelemetry.Trace;
namespace OpenTelemetry.Metrics
{
internal class DoubleBoundMeasureMetricSdk : BoundMeasureMetricSdkBase<double>
{
private readonly DoubleMeasureMinMaxSumCountAggregator measureAggregator = new DoubleMeasureMinMaxSumCountAggregator();
public override void Record(in SpanContext context, double value)
{
this.measureAggregator.Update(value);
}
public override void Record(in Baggage context, double value)
{
this.measureAggregator.Update(value);
}
public override Aggregator<double> GetAggregator()
{
return this.measureAggregator;
}
}
}

View File

@ -1,58 +0,0 @@
// <copyright file="DoubleCounterMetricSdk.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System.Collections.Generic;
using OpenTelemetry.Trace;
namespace OpenTelemetry.Metrics
{
internal class DoubleCounterMetricSdk : CounterMetricSdkBase<double>
{
public DoubleCounterMetricSdk(string name)
: base(name)
{
}
public override void Add(in SpanContext context, double value, LabelSet labelset)
{
// user not using bound instrument. Hence create a short-lived bound instrument.
this.Bind(labelset, isShortLived: true).Add(context, value);
}
public override void Add(in SpanContext context, double value, IEnumerable<KeyValuePair<string, string>> labels)
{
// user not using bound instrument. Hence create a short-lived bound instrument.
this.Bind(new LabelSetSdk(labels), isShortLived: true).Add(context, value);
}
public override void Add(in Baggage context, double value, LabelSet labelset)
{
// user not using bound instrument. Hence create a short-lived bound instrument.
this.Bind(labelset, isShortLived: true).Add(context, value);
}
public override void Add(in Baggage context, double value, IEnumerable<KeyValuePair<string, string>> labels)
{
// user not using bound instrument. Hence create a short-lived bound instrument.
this.Bind(new LabelSetSdk(labels), isShortLived: true).Add(context, value);
}
protected override BoundCounterMetricSdkBase<double> CreateMetric(RecordStatus recordStatus)
{
return new DoubleBoundCounterMetricSdk(recordStatus);
}
}
}

View File

@ -1,31 +0,0 @@
// <copyright file="DoubleMeasureMetricSdk.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
namespace OpenTelemetry.Metrics
{
internal class DoubleMeasureMetricSdk : MeasureMetricSdk<double>
{
public DoubleMeasureMetricSdk(string name)
: base(name)
{
}
protected override BoundMeasureMetricSdkBase<double> CreateMetric()
{
return new DoubleBoundMeasureMetricSdk();
}
}
}

View File

@ -1,35 +0,0 @@
// <copyright file="DoubleObserverMetricHandleSdk.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using OpenTelemetry.Metrics.Aggregators;
namespace OpenTelemetry.Metrics
{
internal class DoubleObserverMetricHandleSdk : DoubleObserverMetricHandle
{
private readonly DoubleLastValueAggregator aggregator = new DoubleLastValueAggregator();
public override void Observe(double value)
{
this.aggregator.Update(value);
}
internal DoubleLastValueAggregator GetAggregator()
{
return this.aggregator;
}
}
}

View File

@ -1,59 +0,0 @@
// <copyright file="DoubleObserverMetricSdk.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
namespace OpenTelemetry.Metrics
{
internal class DoubleObserverMetricSdk : DoubleObserverMetric
{
private static readonly Func<LabelSet, DoubleObserverMetricHandleSdk> NewDoubleObserverMetricHandleSdkFunc = (_) => new DoubleObserverMetricHandleSdk();
private readonly ConcurrentDictionary<LabelSet, DoubleObserverMetricHandleSdk> observerHandles = new ConcurrentDictionary<LabelSet, DoubleObserverMetricHandleSdk>();
private readonly string metricName;
private readonly Action<DoubleObserverMetric> callback;
public DoubleObserverMetricSdk(string name, Action<DoubleObserverMetric> callback)
{
this.metricName = name;
this.callback = callback;
}
public override void Observe(double value, LabelSet labelset)
{
// TODO cleanup of handle/aggregator. Issue #530
var boundInstrument = this.observerHandles.GetOrAdd(labelset, NewDoubleObserverMetricHandleSdkFunc);
boundInstrument.Observe(value);
}
public override void Observe(double value, IEnumerable<KeyValuePair<string, string>> labels)
{
this.Observe(value, new LabelSetSdk(labels));
}
public void InvokeCallback()
{
this.callback(this);
}
internal ConcurrentDictionary<LabelSet, DoubleObserverMetricHandleSdk> GetAllHandles()
{
return this.observerHandles;
}
}
}

View File

@ -1,44 +0,0 @@
// <copyright file="AggregationType.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
namespace OpenTelemetry.Metrics.Export
{
[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 enum AggregationType
{
/// <summary>
/// Sum of type Double which is reported with <see cref="DoubleSumData"/>
/// </summary>
DoubleSum,
/// <summary>
/// Sum of type Long which is reported with <see cref="Int64SumData"/>
/// </summary>
LongSum,
/// <summary>
/// Summary of measurements (Min, Max, Sum, Count), which is reported with <see cref="DoubleSummaryData"/>
/// </summary>
DoubleSummary,
/// <summary>
/// Summary of measurements (Min, Max, Sum, Count), which is reported with <see cref="Int64SummaryData"/>
/// </summary>
Int64Summary,
}
}

View File

@ -1,26 +0,0 @@
// <copyright file="DoubleSumData.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
namespace OpenTelemetry.Metrics.Export
{
[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 DoubleSumData : MetricData
{
public double Sum { get; set; }
}
}

View File

@ -1,32 +0,0 @@
// <copyright file="DoubleSummaryData.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
namespace OpenTelemetry.Metrics.Export
{
[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 DoubleSummaryData : MetricData
{
public long Count { get; set; }
public double Sum { get; set; }
public double Min { get; set; }
public double Max { get; set; }
}
}

View File

@ -1,26 +0,0 @@
// <copyright file="Int64SumData.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
namespace OpenTelemetry.Metrics.Export
{
[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 Int64SumData : MetricData
{
public long Sum { get; set; }
}
}

View File

@ -1,32 +0,0 @@
// <copyright file="Int64SummaryData.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
namespace OpenTelemetry.Metrics.Export
{
[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 Int64SummaryData : MetricData
{
public long Count { get; set; }
public long Sum { get; set; }
public long Min { get; set; }
public long Max { get; set; }
}
}

View File

@ -1,51 +0,0 @@
// <copyright file="Metric.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Collections.Generic;
namespace OpenTelemetry.Metrics.Export
{
/// <summary>
/// This class would evolve to become the export record.
/// </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 Metric
{
public Metric(
string metricNamespace,
string metricName,
string desc,
AggregationType type)
{
this.MetricNamespace = metricNamespace;
this.MetricName = metricName;
this.MetricDescription = desc;
this.AggregationType = type;
this.Data = new List<MetricData>();
}
public string MetricNamespace { get; private set; }
public string MetricName { get; private set; }
public string MetricDescription { get; private set; }
public AggregationType AggregationType { get; private set; }
public List<MetricData> Data { get; internal set; }
}
}

View File

@ -1,34 +0,0 @@
// <copyright file="MetricData.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Collections.Generic;
namespace OpenTelemetry.Metrics.Export
{
/// <summary>
/// MetricData base class.
/// </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 MetricData
{
public DateTime StartTimestamp { get; set; }
public DateTime Timestamp { get; set; }
public IEnumerable<KeyValuePair<string, string>> Labels { get; set; }
}
}

View File

@ -1,59 +0,0 @@
// <copyright file="MetricExporter.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace OpenTelemetry.Metrics.Export
{
/// <summary>
/// MetricExporter base class.
/// </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 MetricExporter
{
/// <summary>
/// Enumeration used to define the result of an export operation.
/// </summary>
public enum ExportResult
{
/// <summary>
/// Batch is successfully exported.
/// </summary>
Success = 0,
/// <summary>
/// Batch export failed. Caller must not retry.
/// </summary>
FailedNotRetryable = 1,
/// <summary>
/// Batch export failed transiently. Caller should record error and may retry.
/// </summary>
FailedRetryable = 2,
}
/// <summary>
/// Exports batch of metrics asynchronously.
/// </summary>
/// <param name="metrics">Batch of metrics to export.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>Result of export.</returns>
public abstract Task<ExportResult> ExportAsync(IEnumerable<Metric> metrics, CancellationToken cancellationToken);
}
}

View File

@ -1,42 +0,0 @@
// <copyright file="MetricProcessor.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Collections.Generic;
namespace OpenTelemetry.Metrics.Export
{
/// <summary>
/// MetricProcessor base class.
/// </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 MetricProcessor
{
/// <summary>
/// Finish the current collection cycle and return the metrics it holds.
/// This is called at the end of one collection cycle by the Controller.
/// MetricProcessor can use this to clear its Metrics (in case of stateless).
/// </summary>
/// <param name="metrics">The list of metrics from this cycle, which are to be exported.</param>
public abstract void FinishCollectionCycle(out IEnumerable<Metric> metrics);
/// <summary>
/// Process the metric. This method is called once every collection interval.
/// </summary>
/// <param name="metric">the metric record.</param>
public abstract void Process(Metric metric);
}
}

View File

@ -1,30 +0,0 @@
// <copyright file="NoopMetricExporter.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace OpenTelemetry.Metrics.Export
{
internal class NoopMetricExporter : MetricExporter
{
public override Task<ExportResult> ExportAsync(IEnumerable<Metric> metrics, CancellationToken cancellationToken)
{
return Task.FromResult(ExportResult.Success);
}
}
}

View File

@ -1,33 +0,0 @@
// <copyright file="NoopMetricProcessor.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System.Collections.Generic;
using System.Linq;
namespace OpenTelemetry.Metrics.Export
{
internal class NoopMetricProcessor : MetricProcessor
{
public override void FinishCollectionCycle(out IEnumerable<Metric> metric)
{
metric = Enumerable.Empty<Metric>();
}
public override void Process(Metric metric)
{
}
}
}

View File

@ -1,109 +0,0 @@
// <copyright file="PushMetricController.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using OpenTelemetry.Internal;
using static OpenTelemetry.Metrics.MeterProviderSdk;
namespace OpenTelemetry.Metrics.Export
{
internal class PushMetricController
{
private readonly TimeSpan pushInterval;
private readonly Task worker;
private readonly MetricExporter metricExporter;
private readonly MetricProcessor metricProcessor;
private readonly Dictionary<MeterRegistryKey, MeterSdk> meters;
public PushMetricController(
Dictionary<MeterRegistryKey, MeterSdk> meters,
MetricProcessor metricProcessor,
MetricExporter metricExporter,
TimeSpan pushInterval,
CancellationTokenSource cts)
{
this.meters = meters;
this.metricProcessor = metricProcessor;
this.metricExporter = metricExporter;
this.pushInterval = pushInterval;
this.worker = Task.Factory.StartNew(
s => this.Worker((CancellationToken)s),
cts.Token,
default,
TaskCreationOptions.None,
TaskScheduler.Default);
}
internal IEnumerable<Metric> Collect(Stopwatch sw)
{
foreach (var meter in this.meters.Values)
{
meter.Collect();
}
OpenTelemetrySdkEventSource.Log.CollectionCompleted(sw.ElapsedMilliseconds);
// Collection is over at this point. All metrics are given
// to the MetricProcesor(Batcher).
// Let MetricProcessor know that this cycle is ending,
// and send the metrics from MetricProcessor
// to the MetricExporter.
this.metricProcessor.FinishCollectionCycle(out var metricToExport);
return metricToExport;
}
internal async Task ExportAsync(IEnumerable<Metric> metricToExport, CancellationToken cancellationToken)
{
var exportResult = await this.metricExporter.ExportAsync(metricToExport, cancellationToken).ConfigureAwait(false);
if (exportResult != MetricExporter.ExportResult.Success)
{
OpenTelemetrySdkEventSource.Log.MetricExporterErrorResult((int)exportResult);
// we do not support retries for now and leave it up to exporter
// as only exporter implementation knows how to retry: which items failed
// and what is the reasonable policy for that exporter.
}
}
private async Task Worker(CancellationToken cancellationToken)
{
await Task.Delay(this.pushInterval, cancellationToken).ConfigureAwait(false);
while (!cancellationToken.IsCancellationRequested)
{
var sw = Stopwatch.StartNew();
try
{
var metricToExport = this.Collect(sw);
await this.ExportAsync(metricToExport, cancellationToken).ConfigureAwait(false);
}
catch (Exception ex)
{
OpenTelemetrySdkEventSource.Log.MetricControllerException(ex);
}
var remainingWait = this.pushInterval - sw.Elapsed;
if (remainingWait > TimeSpan.Zero)
{
await Task.Delay(remainingWait, cancellationToken).ConfigureAwait(false);
}
}
}
}
}

View File

@ -1,56 +0,0 @@
// <copyright file="UngroupedBatcher.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Collections.Generic;
using OpenTelemetry.Internal;
namespace OpenTelemetry.Metrics.Export
{
/// <summary>
/// Batcher which retains all dimensions/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 class UngroupedBatcher : MetricProcessor
{
private List<Metric> metrics;
/// <summary>
/// Initializes a new instance of the <see cref="UngroupedBatcher"/> class.
/// </summary>
public UngroupedBatcher()
{
this.metrics = new List<Metric>();
}
/// <inheritdoc/>
public override void FinishCollectionCycle(out IEnumerable<Metric> metrics)
{
// The batcher is currently stateless. i.e it forgets state after collection is done.
// Once the spec is ready for stateless vs stateful, we need to modify batcher
// to remember or clear state after each cycle.
metrics = this.metrics;
this.metrics = new List<Metric>();
OpenTelemetrySdkEventSource.Log.BatcherCollectionCompleted(this.metrics.Count);
}
/// <inheritdoc/>
public override void Process(Metric metric)
{
this.metrics.Add(metric);
}
}
}

View File

@ -1,46 +0,0 @@
// <copyright file="Int64BoundCounterMetricSdk.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using OpenTelemetry.Metrics.Aggregators;
using OpenTelemetry.Trace;
namespace OpenTelemetry.Metrics
{
internal class Int64BoundCounterMetricSdk : BoundCounterMetricSdkBase<long>
{
private readonly Int64CounterSumAggregator sumAggregator = new Int64CounterSumAggregator();
public Int64BoundCounterMetricSdk(RecordStatus recordStatus)
: base(recordStatus)
{
}
public override void Add(in SpanContext context, long value)
{
this.sumAggregator.Update(value);
}
public override void Add(in Baggage context, long value)
{
this.sumAggregator.Update(value);
}
public override Aggregator<long> GetAggregator()
{
return this.sumAggregator;
}
}
}

View File

@ -1,41 +0,0 @@
// <copyright file="Int64BoundMeasureMetricSdk.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using OpenTelemetry.Metrics.Aggregators;
using OpenTelemetry.Trace;
namespace OpenTelemetry.Metrics
{
internal class Int64BoundMeasureMetricSdk : BoundMeasureMetricSdkBase<long>
{
private readonly Int64MeasureMinMaxSumCountAggregator measureAggregator = new Int64MeasureMinMaxSumCountAggregator();
public override void Record(in SpanContext context, long value)
{
this.measureAggregator.Update(value);
}
public override void Record(in Baggage context, long value)
{
this.measureAggregator.Update(value);
}
public override Aggregator<long> GetAggregator()
{
return this.measureAggregator;
}
}
}

View File

@ -1,58 +0,0 @@
// <copyright file="Int64CounterMetricSdk.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System.Collections.Generic;
using OpenTelemetry.Trace;
namespace OpenTelemetry.Metrics
{
internal class Int64CounterMetricSdk : CounterMetricSdkBase<long>
{
public Int64CounterMetricSdk(string name)
: base(name)
{
}
public override void Add(in SpanContext context, long value, LabelSet labelset)
{
// user not using bound instrument. Hence create a short-lived bound instrument.
this.Bind(labelset, isShortLived: true).Add(context, value);
}
public override void Add(in SpanContext context, long value, IEnumerable<KeyValuePair<string, string>> labels)
{
// user not using bound instrument. Hence create a short-lived bound instrument.
this.Bind(new LabelSetSdk(labels), isShortLived: true).Add(context, value);
}
public override void Add(in Baggage context, long value, LabelSet labelset)
{
// user not using bound instrument. Hence create a short-lived bound instrument.
this.Bind(labelset, isShortLived: true).Add(context, value);
}
public override void Add(in Baggage context, long value, IEnumerable<KeyValuePair<string, string>> labels)
{
// user not using bound instrument. Hence create a short-lived bound instrument.
this.Bind(new LabelSetSdk(labels), isShortLived: true).Add(context, value);
}
protected override BoundCounterMetricSdkBase<long> CreateMetric(RecordStatus recordStatus)
{
return new Int64BoundCounterMetricSdk(recordStatus);
}
}
}

View File

@ -1,31 +0,0 @@
// <copyright file="Int64MeasureMetricSdk.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
namespace OpenTelemetry.Metrics
{
internal class Int64MeasureMetricSdk : MeasureMetricSdk<long>
{
public Int64MeasureMetricSdk(string name)
: base(name)
{
}
protected override BoundMeasureMetricSdkBase<long> CreateMetric()
{
return new Int64BoundMeasureMetricSdk();
}
}
}

View File

@ -1,35 +0,0 @@
// <copyright file="Int64ObserverMetricHandleSdk.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using OpenTelemetry.Metrics.Aggregators;
namespace OpenTelemetry.Metrics
{
internal class Int64ObserverMetricHandleSdk : Int64ObserverMetricHandle
{
private readonly Int64LastValueAggregator aggregator = new Int64LastValueAggregator();
public override void Observe(long value)
{
this.aggregator.Update(value);
}
internal Int64LastValueAggregator GetAggregator()
{
return this.aggregator;
}
}
}

View File

@ -1,59 +0,0 @@
// <copyright file="Int64ObserverMetricSdk.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
namespace OpenTelemetry.Metrics
{
internal class Int64ObserverMetricSdk : Int64ObserverMetric
{
private static readonly Func<LabelSet, Int64ObserverMetricHandleSdk> NewInt64ObserverMetricHandleSdkFunc = (_) => new Int64ObserverMetricHandleSdk();
private readonly ConcurrentDictionary<LabelSet, Int64ObserverMetricHandleSdk> observerHandles = new ConcurrentDictionary<LabelSet, Int64ObserverMetricHandleSdk>();
private readonly string metricName;
private readonly Action<Int64ObserverMetric> callback;
public Int64ObserverMetricSdk(string name, Action<Int64ObserverMetric> callback)
{
this.metricName = name;
this.callback = callback;
}
public override void Observe(long value, LabelSet labelset)
{
// TODO cleanup of handle/aggregator. Issue #530
var boundInstrument = this.observerHandles.GetOrAdd(labelset, NewInt64ObserverMetricHandleSdkFunc);
boundInstrument.Observe(value);
}
public override void Observe(long value, IEnumerable<KeyValuePair<string, string>> labels)
{
this.Observe(value, new LabelSetSdk(labels));
}
public void InvokeCallback()
{
this.callback(this);
}
internal ConcurrentDictionary<LabelSet, Int64ObserverMetricHandleSdk> GetAllHandles()
{
return this.observerHandles;
}
}
}

View File

@ -1,96 +0,0 @@
// <copyright file="LabelSetSdk.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OpenTelemetry.Metrics
{
/// <summary>
/// LabelSet implementation.
/// </summary>
internal class LabelSetSdk : LabelSet
{
// encoded value is used internally by the SDK as a key in Dictionary.
// This could potentially be made public, and combined with an
// option to override Encoder, can avoid reencoding of labels
// at Exporter level.
private readonly string labelSetEncoded;
/// <summary>
/// Initializes a new instance of the <see cref="LabelSetSdk"/> class.
/// </summary>
/// <param name="labels">labels from which labelset should be constructed.</param>
internal LabelSetSdk(IEnumerable<KeyValuePair<string, string>> labels)
{
this.Labels = SortAndDedup(labels);
this.labelSetEncoded = GetLabelSetEncoded(this.Labels);
}
/// <summary>
/// Gets or sets the sorted and de-duped labels for this LabelSet.
/// For duplicated keys, the last value wins.
/// </summary>
public override IEnumerable<KeyValuePair<string, string>> Labels { get; set; }
/// <inheritdoc/>
public override int GetHashCode()
{
return this.labelSetEncoded.GetHashCode();
}
/// <inheritdoc/>
public override bool Equals(object obj)
{
return this.labelSetEncoded.Equals(((LabelSetSdk)obj).labelSetEncoded, StringComparison.Ordinal);
}
private static IEnumerable<KeyValuePair<string, string>> SortAndDedup(IEnumerable<KeyValuePair<string, string>> labels)
{
var dedupedList = new SortedDictionary<string, KeyValuePair<string, string>>(StringComparer.Ordinal);
foreach (var label in labels)
{
dedupedList[label.Key] = label;
}
return dedupedList.Values;
}
private static string GetLabelSetEncoded(IEnumerable<KeyValuePair<string, string>> labels)
{
StringBuilder encoder = new StringBuilder();
bool isFirstLabel = true;
// simple encoding.
foreach (var label in labels)
{
if (!isFirstLabel)
{
encoder.Append(',');
}
encoder.Append(label.Key);
encoder.Append('=');
encoder.Append(label.Value);
isFirstLabel = false;
}
return encoder.ToString();
}
}
}

View File

@ -1,53 +0,0 @@
// <copyright file="MeasureMetricSdk.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
namespace OpenTelemetry.Metrics
{
internal abstract class MeasureMetricSdk<T> : MeasureMetric<T>
where T : struct
{
private readonly ConcurrentDictionary<LabelSet, BoundMeasureMetricSdkBase<T>> measureBoundInstruments = new ConcurrentDictionary<LabelSet, BoundMeasureMetricSdkBase<T>>();
private readonly Func<LabelSet, BoundMeasureMetricSdkBase<T>> createMetricFunc;
private string metricName;
public MeasureMetricSdk(string name)
{
this.metricName = name;
this.createMetricFunc = (_) => this.CreateMetric();
}
public override BoundMeasureMetric<T> Bind(LabelSet labelset)
{
return this.measureBoundInstruments.GetOrAdd(labelset, this.createMetricFunc);
}
public override BoundMeasureMetric<T> Bind(IEnumerable<KeyValuePair<string, string>> labels)
{
return this.Bind(new LabelSetSdk(labels));
}
internal ConcurrentDictionary<LabelSet, BoundMeasureMetricSdkBase<T>> GetAllBoundInstruments()
{
return this.measureBoundInstruments;
}
protected abstract BoundMeasureMetricSdkBase<T> CreateMetric();
}
}

View File

@ -1,91 +0,0 @@
// <copyright file="MeterProviderBuilder.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Collections.Generic;
using System.Threading;
using OpenTelemetry.Metrics.Export;
using static OpenTelemetry.Metrics.MeterProviderSdk;
namespace OpenTelemetry.Metrics
{
/// <summary>
/// Build MeterProvider with Exporter, Processor and PushInterval.
/// </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 MeterProviderBuilder
{
private static readonly TimeSpan DefaultPushInterval = TimeSpan.FromSeconds(60);
private MetricProcessor metricProcessor;
private MetricExporter metricExporter;
private TimeSpan metricPushInterval;
internal MeterProviderBuilder()
{
this.metricExporter = new NoopMetricExporter();
this.metricProcessor = new NoopMetricProcessor();
this.metricPushInterval = DefaultPushInterval;
}
/// <summary>
/// Sets processor.
/// </summary>
/// <param name="processor">Processor instance.</param>
/// <returns>Returns <see cref="MeterProviderBuilder"/> for chaining.</returns>
public MeterProviderBuilder SetProcessor(MetricProcessor processor)
{
this.metricProcessor = processor ?? new NoopMetricProcessor();
return this;
}
/// <summary>
/// Sets exporter.
/// </summary>
/// <param name="exporter">Exporter instance.</param>
/// <returns>Returns <see cref="MeterProviderBuilder"/> for chaining.</returns>
public MeterProviderBuilder SetExporter(MetricExporter exporter)
{
this.metricExporter = exporter ?? new NoopMetricExporter();
return this;
}
/// <summary>
/// Sets push interval.
/// </summary>
/// <param name="pushInterval">Push interval.</param>
/// <returns>Returns <see cref="MeterProviderBuilder"/> for chaining.</returns>
public MeterProviderBuilder SetPushInterval(TimeSpan pushInterval)
{
this.metricPushInterval = pushInterval == default ? DefaultPushInterval : pushInterval;
return this;
}
public MeterProvider Build()
{
var cancellationTokenSource = new CancellationTokenSource();
var meterRegistry = new Dictionary<MeterRegistryKey, MeterSdk>();
var controller = new PushMetricController(
meterRegistry,
this.metricProcessor,
this.metricExporter,
this.metricPushInterval,
cancellationTokenSource);
return new MeterProviderSdk(this.metricProcessor, meterRegistry, controller, cancellationTokenSource);
}
}
}

View File

@ -1,104 +0,0 @@
// <copyright file="MeterProviderSdk.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Collections.Generic;
using System.Threading;
using OpenTelemetry.Metrics.Export;
namespace OpenTelemetry.Metrics
{
internal class MeterProviderSdk : MeterProvider
{
public MetricProcessor MetricProcessor;
public PushMetricController PushMetricController;
public CancellationTokenSource CancellationTokenSource;
public Dictionary<MeterRegistryKey, MeterSdk> MeterRegistry;
private readonly object syncObject = new object();
private MeterSdk defaultMeter;
internal MeterProviderSdk(MetricProcessor metricProcessor, Dictionary<MeterRegistryKey, MeterSdk> registry, PushMetricController controller, CancellationTokenSource cts)
{
this.MetricProcessor = metricProcessor;
this.PushMetricController = controller;
this.CancellationTokenSource = cts;
this.defaultMeter = new MeterSdk(string.Empty, this.MetricProcessor);
this.MeterRegistry = registry;
this.MeterRegistry.Add(new MeterRegistryKey(string.Empty, null), this.defaultMeter);
}
public override Meter GetMeter(string name, string version = null)
{
if (string.IsNullOrEmpty(name))
{
return this.defaultMeter;
}
lock (this.syncObject)
{
var key = new MeterRegistryKey(name, version);
if (!this.MeterRegistry.TryGetValue(key, out var meter))
{
meter = this.defaultMeter = new MeterSdk(name, this.MetricProcessor);
this.MeterRegistry.Add(key, meter);
}
return meter;
}
}
protected override void Dispose(bool disposing)
{
this.CancellationTokenSource.Dispose();
// TODO: Actually flush the metric processor/exporer/controllers.
base.Dispose(disposing);
}
internal readonly struct MeterRegistryKey : IEquatable<MeterRegistryKey>
{
private readonly string name;
private readonly string version;
internal MeterRegistryKey(string name, string version)
{
this.name = name;
this.version = version;
}
public override bool Equals(object obj)
{
return obj is MeterRegistryKey meterRegistryKey && this.Equals(meterRegistryKey);
}
public bool Equals(MeterRegistryKey other)
{
return this.name == other.name && this.version == other.version;
}
public override int GetHashCode()
{
var result = 1;
result = (31 * result) + (this.name?.GetHashCode() ?? 0);
result = (31 * result) + (this.version?.GetHashCode() ?? 0);
return result;
}
}
}
}

View File

@ -1,312 +0,0 @@
// <copyright file="MeterSdk.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using OpenTelemetry.Internal;
using OpenTelemetry.Metrics.Export;
namespace OpenTelemetry.Metrics
{
internal class MeterSdk : Meter
{
private static readonly Func<string, Int64CounterMetricSdk> NewInt64CounterMetricSdkFunc = (name) => new Int64CounterMetricSdk(name);
private static readonly Func<string, DoubleCounterMetricSdk> NewDoubleCounterMetricSdkFunc = (name) => new DoubleCounterMetricSdk(name);
private static readonly Func<string, Int64MeasureMetricSdk> NewInt64MeasureMetricSdkFunc = (name) => new Int64MeasureMetricSdk(name);
private static readonly Func<string, DoubleMeasureMetricSdk> NewDoubleMeasureMetricSdkFunc = (name) => new DoubleMeasureMetricSdk(name);
private readonly string meterName;
private readonly MetricProcessor metricProcessor;
private readonly ConcurrentDictionary<string, Int64CounterMetricSdk> longCounters = new ConcurrentDictionary<string, Int64CounterMetricSdk>();
private readonly ConcurrentDictionary<string, DoubleCounterMetricSdk> doubleCounters = new ConcurrentDictionary<string, DoubleCounterMetricSdk>();
private readonly ConcurrentDictionary<string, Int64MeasureMetricSdk> longMeasures = new ConcurrentDictionary<string, Int64MeasureMetricSdk>();
private readonly ConcurrentDictionary<string, DoubleMeasureMetricSdk> doubleMeasures = new ConcurrentDictionary<string, DoubleMeasureMetricSdk>();
private readonly ConcurrentDictionary<string, Int64ObserverMetricSdk> longObservers = new ConcurrentDictionary<string, Int64ObserverMetricSdk>();
private readonly ConcurrentDictionary<string, DoubleObserverMetricSdk> doubleObservers = new ConcurrentDictionary<string, DoubleObserverMetricSdk>();
private readonly object collectLock = new object();
internal MeterSdk(string meterName, MetricProcessor metricProcessor)
{
this.meterName = meterName;
this.metricProcessor = metricProcessor;
}
public override LabelSet GetLabelSet(IEnumerable<KeyValuePair<string, string>> labels)
{
return new LabelSetSdk(labels);
}
public virtual void Collect()
{
lock (this.collectLock)
{
OpenTelemetrySdkEventSource.Log.MeterCollectInvoked(this.meterName);
// collect all pending metric updates and send to batcher.
// must sync to prevent multiple Collect occurring at same time.
var boundInstrumentsToRemove = new List<LabelSet>();
foreach (var longCounter in this.longCounters)
{
var metricName = longCounter.Key;
var counterInstrument = longCounter.Value;
var metric = new Metric(this.meterName, metricName, this.meterName + metricName, AggregationType.LongSum);
foreach (var handle in counterInstrument.GetAllBoundInstruments())
{
var labelSet = handle.Key;
var aggregator = handle.Value.GetAggregator();
aggregator.Checkpoint();
if (aggregator.HasCheckpointData())
{
var metricData = aggregator.ToMetricData();
metricData.Labels = labelSet.Labels;
metric.Data.Add(metricData);
}
// Updates so far are pushed to Processor/Exporter.
// Adjust status accordinly.
// The status flows from initial UpdatePending, to
// NoPendingUpdate, to CandidateForRemoval, to physical removal.
// i.e UpdatePending->NoPendingUpdate->CandidateForRemoval->removal
if (handle.Value.Status == RecordStatus.CandidateForRemoval)
{
// The actual removal doesn't occur here as we are still
// iterating the dictionary.
boundInstrumentsToRemove.Add(labelSet);
}
else if (handle.Value.Status == RecordStatus.UpdatePending)
{
handle.Value.Status = RecordStatus.NoPendingUpdate;
}
else if (handle.Value.Status == RecordStatus.NoPendingUpdate)
{
handle.Value.Status = RecordStatus.CandidateForRemoval;
}
}
this.metricProcessor.Process(metric);
foreach (var boundInstrumentToRemove in boundInstrumentsToRemove)
{
// This actual unbinding or removal of the record occurs inside UnBind
// which synchronizes with Bind to ensure no record with pending update
// is lost.
counterInstrument.UnBind(boundInstrumentToRemove);
}
boundInstrumentsToRemove.Clear();
}
foreach (var doubleCounter in this.doubleCounters)
{
var metricName = doubleCounter.Key;
var counterInstrument = doubleCounter.Value;
var metric = new Metric(this.meterName, metricName, this.meterName + metricName, AggregationType.DoubleSum);
foreach (var handle in counterInstrument.GetAllBoundInstruments())
{
var labelSet = handle.Key;
var aggregator = handle.Value.GetAggregator();
aggregator.Checkpoint();
if (aggregator.HasCheckpointData())
{
var metricData = aggregator.ToMetricData();
metricData.Labels = labelSet.Labels;
metric.Data.Add(metricData);
}
// Updates so far are pushed to Processor/Exporter.
// Adjust status accordinly.
// The status flows from initial UpdatePending, to
// NoPendingUpdate, to CandidateForRemoval, to physical removal.
// i.e UpdatePending->NoPendingUpdate->CandidateForRemoval->removal
if (handle.Value.Status == RecordStatus.CandidateForRemoval)
{
// The actual removal doesn't occur here as we are still
// iterating the dictionary.
boundInstrumentsToRemove.Add(labelSet);
}
else if (handle.Value.Status == RecordStatus.UpdatePending)
{
handle.Value.Status = RecordStatus.NoPendingUpdate;
}
else if (handle.Value.Status == RecordStatus.NoPendingUpdate)
{
handle.Value.Status = RecordStatus.CandidateForRemoval;
}
}
this.metricProcessor.Process(metric);
foreach (var boundInstrumentToRemove in boundInstrumentsToRemove)
{
// This actual unbinding or removal of the record occurs inside UnBind
// which synchronizes with Bind to ensure no record with pending update
// is lost.
counterInstrument.UnBind(boundInstrumentToRemove);
}
boundInstrumentsToRemove.Clear();
}
foreach (var longMeasure in this.longMeasures)
{
var metricName = longMeasure.Key;
var measureInstrument = longMeasure.Value;
var metric = new Metric(this.meterName, metricName, this.meterName + metricName, AggregationType.Int64Summary);
foreach (var handle in measureInstrument.GetAllBoundInstruments())
{
var labelSet = handle.Key;
var aggregator = handle.Value.GetAggregator();
aggregator.Checkpoint();
if (aggregator.HasCheckpointData())
{
var metricData = aggregator.ToMetricData();
metricData.Labels = labelSet.Labels;
metric.Data.Add(metricData);
}
}
this.metricProcessor.Process(metric);
}
foreach (var doubleMeasure in this.doubleMeasures)
{
var metricName = doubleMeasure.Key;
var measureInstrument = doubleMeasure.Value;
var metric = new Metric(this.meterName, metricName, this.meterName + metricName, AggregationType.DoubleSummary);
foreach (var handle in measureInstrument.GetAllBoundInstruments())
{
var labelSet = handle.Key;
var aggregator = handle.Value.GetAggregator();
aggregator.Checkpoint();
if (aggregator.HasCheckpointData())
{
var metricData = aggregator.ToMetricData();
metricData.Labels = labelSet.Labels;
metric.Data.Add(metricData);
}
}
this.metricProcessor.Process(metric);
}
foreach (var longObserver in this.longObservers)
{
var metricName = longObserver.Key;
var observerInstrument = longObserver.Value;
var metric = new Metric(this.meterName, metricName, this.meterName + metricName, AggregationType.LongSum);
try
{
// TODO: Decide if we want to enforce a timeout. Issue # 542
observerInstrument.InvokeCallback();
}
catch (Exception ex)
{
OpenTelemetrySdkEventSource.Log.MetricObserverCallbackException(metricName, ex);
}
foreach (var handle in observerInstrument.GetAllHandles())
{
var labelSet = handle.Key;
var aggregator = handle.Value.GetAggregator();
aggregator.Checkpoint();
if (aggregator.HasCheckpointData())
{
var metricData = aggregator.ToMetricData();
metricData.Labels = labelSet.Labels;
metric.Data.Add(metricData);
}
}
this.metricProcessor.Process(metric);
}
foreach (var doubleObserver in this.doubleObservers)
{
var metricName = doubleObserver.Key;
var observerInstrument = doubleObserver.Value;
var metric = new Metric(this.meterName, metricName, this.meterName + metricName, AggregationType.DoubleSum);
try
{
// TODO: Decide if we want to enforce a timeout. Issue # 542
observerInstrument.InvokeCallback();
}
catch (Exception ex)
{
OpenTelemetrySdkEventSource.Log.MetricObserverCallbackException(metricName, ex);
}
foreach (var handle in observerInstrument.GetAllHandles())
{
var labelSet = handle.Key;
var aggregator = handle.Value.GetAggregator();
aggregator.Checkpoint();
if (aggregator.HasCheckpointData())
{
var metricData = aggregator.ToMetricData();
metricData.Labels = labelSet.Labels;
metric.Data.Add(metricData);
}
}
this.metricProcessor.Process(metric);
}
}
}
public override CounterMetric<long> CreateInt64Counter(string name, bool monotonic = true)
{
return this.longCounters.GetOrAdd(name, NewInt64CounterMetricSdkFunc);
}
public override CounterMetric<double> CreateDoubleCounter(string name, bool monotonic = true)
{
return this.doubleCounters.GetOrAdd(name, NewDoubleCounterMetricSdkFunc);
}
public override MeasureMetric<double> CreateDoubleMeasure(string name, bool absolute = true)
{
return this.doubleMeasures.GetOrAdd(name, NewDoubleMeasureMetricSdkFunc);
}
public override MeasureMetric<long> CreateInt64Measure(string name, bool absolute = true)
{
return this.longMeasures.GetOrAdd(name, NewInt64MeasureMetricSdkFunc);
}
/// <inheritdoc/>
public override Int64ObserverMetric CreateInt64Observer(string name, Action<Int64ObserverMetric> callback, bool absolute = true)
{
Int64ObserverMetricSdk metric;
if (!this.longObservers.TryGetValue(name, out metric))
{
metric = this.longObservers.GetOrAdd(name, new Int64ObserverMetricSdk(name, callback));
}
return metric;
}
/// <inheritdoc/>
public override DoubleObserverMetric CreateDoubleObserver(string name, Action<DoubleObserverMetric> callback, bool absolute = true)
{
DoubleObserverMetricSdk metric;
if (!this.doubleObservers.TryGetValue(name, out metric))
{
metric = this.doubleObservers.GetOrAdd(name, new DoubleObserverMetricSdk(name, callback));
}
return metric;
}
}
}

View File

@ -1,49 +0,0 @@
// <copyright file="RecordStatus.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
namespace OpenTelemetry.Metrics
{
internal enum RecordStatus
{
/// <summary>
/// This applies to bound instruments that was created in response to user explicitly calling Bind.
/// They must never be removed.
/// </summary>
Bound,
/// <summary>
/// This applies to bound instruments that was created by MeterSDK intended to be short lived one.
/// They currently have pending updates to be sent to MetricProcessor/Batcher/Exporter.
/// Collect will move them to NoPendingUpdate after exporting updates.
/// </summary>
UpdatePending,
/// <summary>
/// This status is applied to UpdatePending instruments after Collect() is done.
/// This will be moved to CandidateForRemoval during the next Collect() cycle.
/// If an update occurs, the instrument promotes them to UpdatePending.
/// </summary>
NoPendingUpdate,
/// <summary>
/// This also applies to bound instruments that was created by MeterSDK intended to be short lived one.
/// They have no pending update and has not been used since atleast one Collect() cycle.
/// Collect will set this status to all NoPendingUpdate bound instruments after finishing a Collect pass.
/// Instrument records with this status are removed after Collect().
/// </summary>
CandidateForRemoval,
}
}

View File

@ -17,7 +17,6 @@
using System.Diagnostics;
using OpenTelemetry.Context.Propagation;
using OpenTelemetry.Internal;
using OpenTelemetry.Metrics;
using OpenTelemetry.Trace;
namespace OpenTelemetry
@ -54,15 +53,6 @@ namespace OpenTelemetry
Propagators.DefaultTextMapPropagator = textMapPropagator;
}
/// <summary>
/// Creates MeterProviderBuilder which should be used to build MeterProvider.
/// </summary>
/// <returns>MeterProviderBuilder instance, which should be used to build MeterProvider.</returns>
public static MeterProviderBuilder CreateMeterProviderBuilder()
{
return new MeterProviderBuilder();
}
/// <summary>
/// Creates TracerProviderBuilder which should be used to build
/// TracerProvider.

View File

@ -1,31 +0,0 @@
// <copyright file="EventSourceTest.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using OpenTelemetry.Exporter.Prometheus.Implementation;
using OpenTelemetry.Tests;
using Xunit;
namespace OpenTelemetry.Exporter.Prometheus.Tests
{
public class EventSourceTest
{
[Fact]
public void EventSourceTest_PrometheusExporterEventSource()
{
EventSourceTestHelper.MethodsAreImplementedConsistentlyWithTheirAttributes(PrometheusExporterEventSource.Log);
}
}
}

View File

@ -1,62 +0,0 @@
// <copyright file="PrometheusMetricBuilderTests.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
using System.Globalization;
using System.IO;
using System.Text;
using System.Threading;
using OpenTelemetry.Exporter.Prometheus.Implementation;
using Xunit;
namespace OpenTelemetry.Exporter.Prometheus.Tests.Implementation
{
public class PrometheusMetricBuilderTests
{
[Theory]
[InlineData(null)]
[InlineData("pt-BR")]
public void Test(string cultureInfo)
{
if (!string.IsNullOrEmpty(cultureInfo))
{
Thread.CurrentThread.CurrentCulture = new CultureInfo(cultureInfo);
}
using var stream = new MemoryStream();
using var writer = new StreamWriter(stream);
var builder = new PrometheusMetricBuilder();
builder.WithName("test-builder");
builder.WithDescription("test-description");
builder.WithType("test-type");
var metricValueBuilder = builder.AddValue();
metricValueBuilder = metricValueBuilder.WithName("test-builder-value").WithValue(10.0123);
metricValueBuilder.WithLabel("test-double", "double");
builder.Write(writer);
writer.Flush();
// assert
string actual = Encoding.UTF8.GetString(stream.ToArray());
string[] lines = actual.Split('\n');
Assert.Equal("# HELP test_buildertest-description", lines[0]);
Assert.Equal("# TYPE test_builder test-type", lines[1]);
Assert.StartsWith("test_builder_value{test_double=\"double\"} 10.01", lines[2]);
}
}
}

View File

@ -1,42 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>Unit test project for Prometheus Exporter for OpenTelemetry</Description>
<TargetFrameworks>netcoreapp2.1;netcoreapp3.1;net5.0</TargetFrameworks>
<TargetFrameworks Condition="$(OS) == 'Windows_NT'">$(TargetFrameworks);net452;net46</TargetFrameworks>
<IsPackable>false</IsPackable>
<NoWarn>$(NoWarn),CS0618</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPkgVer)" />
<PackageReference Include="xunit" Version="$(XUnitPkgVer)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(XUnitRunnerVisualStudioPkgVer)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="5.0.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="3.1.2" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.2.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net452' OR '$(TargetFramework)' == 'net46' ">
<Reference Include="System.Net.Http" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.Prometheus\OpenTelemetry.Exporter.Prometheus.csproj" />
<Compile Include="$(RepoRoot)\test\OpenTelemetry.Tests\Shared\EventSourceTestHelper.cs" Link="EventSourceTestHelper.cs" />
<Compile Include="$(RepoRoot)\test\OpenTelemetry.Tests\Shared\TestEventListener.cs" Link="TestEventListener.cs" />
</ItemGroup>
</Project>

Some files were not shown because too many files have changed in this diff Show More