From d21d3cada7b6fc4be03b5f44b35889c476f9a123 Mon Sep 17 00:00:00 2001
From: Vitor Pinto <104011363+vitor-pinto-maersk@users.noreply.github.com>
Date: Fri, 21 Oct 2022 18:01:59 +0100
Subject: [PATCH 1/3] [Instrumentation.Hangfire] Add option to record
exceptions (#719)
---
.../CHANGELOG.md | 3 ++
.../HangfireInstrumentationOptions.cs | 31 +++++++++++
...ngfireInstrumentationJobFilterAttribute.cs | 20 +++++++-
.../TracerProviderBuilderExtensions.cs | 11 +++-
...eInstrumentationJobFilterAttributeTests.cs | 51 ++++++++++++++++++-
5 files changed, 112 insertions(+), 4 deletions(-)
create mode 100644 src/OpenTelemetry.Instrumentation.Hangfire/HangfireInstrumentationOptions.cs
diff --git a/src/OpenTelemetry.Instrumentation.Hangfire/CHANGELOG.md b/src/OpenTelemetry.Instrumentation.Hangfire/CHANGELOG.md
index f1f0af7179..8536e0e104 100644
--- a/src/OpenTelemetry.Instrumentation.Hangfire/CHANGELOG.md
+++ b/src/OpenTelemetry.Instrumentation.Hangfire/CHANGELOG.md
@@ -2,6 +2,9 @@
## Unreleased
+* Add support to optionally record exceptions
+ ([#719](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/719))
+
* Update OTel API version to `1.3.1`.
([#631](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/631))
diff --git a/src/OpenTelemetry.Instrumentation.Hangfire/HangfireInstrumentationOptions.cs b/src/OpenTelemetry.Instrumentation.Hangfire/HangfireInstrumentationOptions.cs
new file mode 100644
index 0000000000..94d14f569d
--- /dev/null
+++ b/src/OpenTelemetry.Instrumentation.Hangfire/HangfireInstrumentationOptions.cs
@@ -0,0 +1,31 @@
+//
+// 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.
+//
+
+namespace OpenTelemetry.Trace;
+
+///
+/// Options for hangfire jobs instrumentation.
+///
+public class HangfireInstrumentationOptions
+{
+ ///
+ /// Gets or sets a value indicating whether the exception will be recorded as ActivityEvent or not.
+ ///
+ ///
+ /// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/exceptions.md.
+ ///
+ public bool RecordException { get; set; }
+}
diff --git a/src/OpenTelemetry.Instrumentation.Hangfire/Implementation/HangfireInstrumentationJobFilterAttribute.cs b/src/OpenTelemetry.Instrumentation.Hangfire/Implementation/HangfireInstrumentationJobFilterAttribute.cs
index 79cdb83fcd..97e871309b 100644
--- a/src/OpenTelemetry.Instrumentation.Hangfire/Implementation/HangfireInstrumentationJobFilterAttribute.cs
+++ b/src/OpenTelemetry.Instrumentation.Hangfire/Implementation/HangfireInstrumentationJobFilterAttribute.cs
@@ -23,9 +23,17 @@ namespace OpenTelemetry.Instrumentation.Hangfire.Implementation;
using global::Hangfire.Common;
using global::Hangfire.Server;
using OpenTelemetry.Context.Propagation;
+using OpenTelemetry.Trace;
internal class HangfireInstrumentationJobFilterAttribute : JobFilterAttribute, IServerFilter, IClientFilter
{
+ private readonly HangfireInstrumentationOptions options;
+
+ public HangfireInstrumentationJobFilterAttribute(HangfireInstrumentationOptions options)
+ {
+ this.options = options;
+ }
+
public void OnPerforming(PerformingContext performingContext)
{
// Short-circuit if nobody is listening
@@ -72,7 +80,7 @@ public void OnPerformed(PerformedContext performedContext)
{
if (performedContext.Exception != null)
{
- activity.SetStatus(ActivityStatusCode.Error, performedContext.Exception.Message);
+ this.SetStatusAndRecordException(activity, performedContext.Exception);
}
activity.Dispose();
@@ -111,4 +119,14 @@ private static IEnumerable ExtractActivityProperties(Dictionary();
}
+
+ private void SetStatusAndRecordException(Activity activity, System.Exception exception)
+ {
+ activity.SetStatus(ActivityStatusCode.Error, exception.Message);
+
+ if (this.options.RecordException)
+ {
+ activity.RecordException(exception);
+ }
+ }
}
diff --git a/src/OpenTelemetry.Instrumentation.Hangfire/TracerProviderBuilderExtensions.cs b/src/OpenTelemetry.Instrumentation.Hangfire/TracerProviderBuilderExtensions.cs
index 514ced7c46..e1d3a9d2e7 100644
--- a/src/OpenTelemetry.Instrumentation.Hangfire/TracerProviderBuilderExtensions.cs
+++ b/src/OpenTelemetry.Instrumentation.Hangfire/TracerProviderBuilderExtensions.cs
@@ -16,6 +16,7 @@
namespace OpenTelemetry.Trace;
+using System;
using OpenTelemetry.Instrumentation.Hangfire.Implementation;
using OpenTelemetry.Internal;
@@ -28,12 +29,18 @@ public static class TracerProviderBuilderExtensions
/// Adds Hangfire instrumentation to the tracer provider.
///
/// being configured.
+ /// Callback action for configuring .
/// The instance of to chain the calls.
- public static TracerProviderBuilder AddHangfireInstrumentation(this TracerProviderBuilder builder)
+ public static TracerProviderBuilder AddHangfireInstrumentation(
+ this TracerProviderBuilder builder,
+ Action configureHangfireInstrumentationOptions = null)
{
Guard.ThrowIfNull(builder);
- Hangfire.GlobalJobFilters.Filters.Add(new HangfireInstrumentationJobFilterAttribute());
+ var options = new HangfireInstrumentationOptions();
+ configureHangfireInstrumentationOptions?.Invoke(options);
+
+ Hangfire.GlobalJobFilters.Filters.Add(new HangfireInstrumentationJobFilterAttribute(options));
return builder.AddSource(HangfireInstrumentation.ActivitySourceName);
}
diff --git a/test/OpenTelemetry.Instrumentation.Hangfire.Tests/HangfireInstrumentationJobFilterAttributeTests.cs b/test/OpenTelemetry.Instrumentation.Hangfire.Tests/HangfireInstrumentationJobFilterAttributeTests.cs
index 66d67b5b48..3c8920c64c 100644
--- a/test/OpenTelemetry.Instrumentation.Hangfire.Tests/HangfireInstrumentationJobFilterAttributeTests.cs
+++ b/test/OpenTelemetry.Instrumentation.Hangfire.Tests/HangfireInstrumentationJobFilterAttributeTests.cs
@@ -76,7 +76,56 @@ public async Task Should_Create_Activity_With_Status_Error_When_Job_Failed()
Assert.Contains("JOB TestJob.ThrowException", activity.DisplayName);
Assert.Equal(ActivityKind.Internal, activity.Kind);
Assert.Equal(ActivityStatusCode.Error, activity.Status);
- Assert.NotNull(activity.StatusDescription);
+ Assert.Contains("An exception occurred during performance of the job.", activity.StatusDescription);
+ Assert.Empty(activity.Events);
+ }
+
+ [Fact]
+ public async Task Should_Create_Activity_With_Exception_Event_When_Job_Failed_And_Record_Exception_Is_True()
+ {
+ // Arrange
+ var exportedItems = new List();
+ using var tel = Sdk.CreateTracerProviderBuilder()
+ .AddHangfireInstrumentation(options => options.RecordException = true)
+ .AddInMemoryExporter(exportedItems)
+ .Build();
+
+ // Act
+ var jobId = BackgroundJob.Enqueue(x => x.ThrowException());
+ await this.WaitJobProcessedAsync(jobId, 5);
+
+ // Assert
+ Assert.Single(exportedItems, i => i.GetTagItem("job.id") as string == jobId);
+ var activity = exportedItems.Single(i => i.GetTagItem("job.id") as string == jobId);
+ Assert.Contains("JOB TestJob.ThrowException", activity.DisplayName);
+ Assert.Equal(ActivityKind.Internal, activity.Kind);
+ Assert.Equal(ActivityStatusCode.Error, activity.Status);
+ Assert.Contains("An exception occurred during performance of the job.", activity.StatusDescription);
+ Assert.Single(activity.Events, evt => evt.Name == "exception");
+ }
+
+ [Fact]
+ public async Task Should_Create_Activity_Without_Exception_Event_When_Job_Failed_And_Record_Exception_Is_False()
+ {
+ // Arrange
+ var exportedItems = new List();
+ using var tel = Sdk.CreateTracerProviderBuilder()
+ .AddHangfireInstrumentation(options => options.RecordException = false)
+ .AddInMemoryExporter(exportedItems)
+ .Build();
+
+ // Act
+ var jobId = BackgroundJob.Enqueue(x => x.ThrowException());
+ await this.WaitJobProcessedAsync(jobId, 5);
+
+ // Assert
+ Assert.Single(exportedItems, i => i.GetTagItem("job.id") as string == jobId);
+ var activity = exportedItems.Single(i => i.GetTagItem("job.id") as string == jobId);
+ Assert.Contains("JOB TestJob.ThrowException", activity.DisplayName);
+ Assert.Equal(ActivityKind.Internal, activity.Kind);
+ Assert.Equal(ActivityStatusCode.Error, activity.Status);
+ Assert.Contains("An exception occurred during performance of the job.", activity.StatusDescription);
+ Assert.Empty(activity.Events);
}
private async Task WaitJobProcessedAsync(string jobId, int timeToWaitInSeconds)
From 52585a10e5b4eb9a1f686ca447ee973dd4ab95ed Mon Sep 17 00:00:00 2001
From: Cijo Thomas
Date: Fri, 21 Oct 2022 13:22:27 -0400
Subject: [PATCH 2/3] Update workflow (#724)
---
.github/workflows/integration-md.yml | 2 +-
opentelemetry-dotnet-contrib.sln | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/integration-md.yml b/.github/workflows/integration-md.yml
index 36c72b382e..f5f31d93b0 100644
--- a/.github/workflows/integration-md.yml
+++ b/.github/workflows/integration-md.yml
@@ -7,7 +7,7 @@ on:
- '**.md'
pull_request:
branches: [ main ]
- paths-ignore:
+ paths:
- '**.md'
jobs:
diff --git a/opentelemetry-dotnet-contrib.sln b/opentelemetry-dotnet-contrib.sln
index 321f30a763..d0925d4c72 100644
--- a/opentelemetry-dotnet-contrib.sln
+++ b/opentelemetry-dotnet-contrib.sln
@@ -30,6 +30,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
.github\workflows\dotnet-core-cov.yml = .github\workflows\dotnet-core-cov.yml
.github\workflows\dotnet-format-md.yml = .github\workflows\dotnet-format-md.yml
.github\workflows\dotnet-format.yml = .github\workflows\dotnet-format.yml
+ .github\workflows\integration-md.yml = .github\workflows\integration-md.yml
.github\workflows\integration.yml = .github\workflows\integration.yml
.github\workflows\linux-ci-md.yml = .github\workflows\linux-ci-md.yml
.github\workflows\linux-ci.yml = .github\workflows\linux-ci.yml
From bb9462cafaf4a6a95ffbe1860559f96257ea97d5 Mon Sep 17 00:00:00 2001
From: xiang17
Date: Fri, 21 Oct 2022 12:18:14 -0700
Subject: [PATCH 3/3] [Instrumentation.Runtime] Update OTel API version to
`1.4.0-beta.2` and change runtime metrics type to ObservableUpDownCounter
(#675)
---
.../CHANGELOG.md | 21 ++++++-
...enTelemetry.Instrumentation.Runtime.csproj | 2 +-
.../README.md | 63 +++++++++++--------
.../RuntimeMetrics.cs | 21 +++----
...metry.Instrumentation.Runtime.Tests.csproj | 2 +-
5 files changed, 66 insertions(+), 43 deletions(-)
diff --git a/src/OpenTelemetry.Instrumentation.Runtime/CHANGELOG.md b/src/OpenTelemetry.Instrumentation.Runtime/CHANGELOG.md
index a67c0ffee6..3645874e8c 100644
--- a/src/OpenTelemetry.Instrumentation.Runtime/CHANGELOG.md
+++ b/src/OpenTelemetry.Instrumentation.Runtime/CHANGELOG.md
@@ -2,8 +2,25 @@
## Unreleased
-* Update OTel API version to `1.3.1`.
- ([#631](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/631))
+* Update OTel API version to `1.4.0-beta.2`.
+
+ OTel API updated System.Diagnostics.DiagnosticSource to version 7.0.0
+ since [1.4.0-alpha.2](https://github.com/open-telemetry/opentelemetry-dotnet/releases/tag/core-1.4.0-alpha.2).
+
+ With this update, applications targeting .NET 5 and lower will receive a
+ warning at build time as described [here](https://github.com/dotnet/runtime/pull/72518)
+ (note: building using older versions of the .NET SDK produces an error at
+ build time). This is because .NET 5 reached EOL in May 2022 and .NET
+ Core 3.1 reaches EOL in December 2022.
+
+ There is no guarantee that System.Diagnostics.DiagnosticSource will continue
+ to work on older versions of .NET. However, the build warning can be
+ suppressed by setting the SuppressTfmSupportBuildWarnings MSBuild property.
+
+ This does not affect applications targeting .NET Framework.
+
+* Change runtime metrics type to ObservableUpDownCounter from ObservableGauge
+ ([#675](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/675))
## 1.0.0
diff --git a/src/OpenTelemetry.Instrumentation.Runtime/OpenTelemetry.Instrumentation.Runtime.csproj b/src/OpenTelemetry.Instrumentation.Runtime/OpenTelemetry.Instrumentation.Runtime.csproj
index 73fb0a8ab2..a1b9a2a3f8 100644
--- a/src/OpenTelemetry.Instrumentation.Runtime/OpenTelemetry.Instrumentation.Runtime.csproj
+++ b/src/OpenTelemetry.Instrumentation.Runtime/OpenTelemetry.Instrumentation.Runtime.csproj
@@ -9,7 +9,7 @@
-
+
diff --git a/src/OpenTelemetry.Instrumentation.Runtime/README.md b/src/OpenTelemetry.Instrumentation.Runtime/README.md
index f2b465b82e..4fc929d467 100644
--- a/src/OpenTelemetry.Instrumentation.Runtime/README.md
+++ b/src/OpenTelemetry.Instrumentation.Runtime/README.md
@@ -90,15 +90,11 @@ objects (the heap size) and some extra memory that is ready to handle newly
allocated objects in the future. The value will be unavailable until at least one
garbage collection has occurred.
-Note: `ObservableGauge` should be changed to `ObservableUpDownCounter` once available,
-as `ObservableUpDownCounter` is the best fit of instrument type. The same applies
-to all the `ObservableGauge` below.
-
Note: This metric is only available when targeting .NET6 or later.
-| Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values |
-|---------|-----------------|------------|------------------|------------------|
-| `bytes` | ObservableGauge | `Int64` | No Attributes | N/A |
+| Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values |
+|---------|-------------------------|------------|------------------|------------------|
+| `bytes` | ObservableUpDownCounter | `Int64` | No Attributes | N/A |
The API used to retrieve the value is:
@@ -113,9 +109,9 @@ garbage collection has occurred.
Note: This metric is only available when targeting .NET6 or later.
-| Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values |
-|---------|-----------------|------------|------------------|----------------------------|
-| `bytes` | ObservableGauge | `Int64` | generation | gen0, gen1, gen2, loh, poh |
+| Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values |
+|---------|-------------------------|------------|------------------|----------------------------|
+| `bytes` | ObservableUpDownCounter | `Int64` | generation | gen0, gen1, gen2, loh, poh |
The API used to retrieve the value is:
@@ -134,9 +130,9 @@ The value will be unavailable until at least one garbage collection has occurred
Note: This metric is only available when targeting .NET 7 or later.
-| Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values |
-|---------|-----------------|------------|------------------|----------------------------|
-| `bytes` | ObservableGauge | `Int64` | generation | gen0, gen1, gen2, loh, poh |
+| Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values |
+|---------|-------------------------|------------|------------------|----------------------------|
+| `bytes` | ObservableUpDownCounter | `Int64` | generation | gen0, gen1, gen2, loh, poh |
The API used to retrieve the value is:
@@ -206,9 +202,9 @@ the lock keyword in C#, or by calling Monitor.Enter() and Monitor.TryEnter().
The number of thread pool threads that currently exist.
-| Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values |
-|-------------|-------------------|------------|------------------|------------------|
-| `{threads}` | ObservableGauge | `Int32` | No Attributes | N/A |
+| Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values |
+|-------------|-------------------------|------------|------------------|------------------|
+| `{threads}` | ObservableUpDownCounter | `Int32` | No Attributes | N/A |
#### process.runtime.dotnet.**thread_pool.completed_items.count**
@@ -224,9 +220,9 @@ since the process start.
The number of work items that are currently queued to be processed
by the thread pool.
-| Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values |
-|-------------|-------------------|------------|------------------|------------------|
-| `{items}` | ObservableGauge | `Int64` | No Attributes | N/A |
+| Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values |
+|-----------|-------------------------|------------|------------------|------------------|
+| `{items}` | ObservableUpDownCounter | `Int64` | No Attributes | N/A |
#### process.runtime.dotnet.**timer.count**
@@ -235,9 +231,9 @@ be created by many sources such as System.Threading.Timer, Task.Delay, or the
timeout in a CancellationSource. An active timer is registered to tick at some
point in the future and has not yet been canceled.
-| Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values |
-|-------------|-------------------|------------|------------------|------------------|
-| `{timers}` | ObservableGauge | `Int64` | No Attributes | N/A |
+| Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values |
+|------------|-------------------------|------------|------------------|------------------|
+| `{timers}` | ObservableUpDownCounter | `Int64` | No Attributes | N/A |
The APIs used to retrieve the values are:
@@ -260,9 +256,9 @@ The APIs used to retrieve the values are:
The number of .NET assemblies that are currently loaded.
-| Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values |
-|----------------|-----------------|------------|------------------|------------------|
-| `{assemblies}` | ObservableGauge | `Int64` | No Attributes | N/A |
+| Units | Instrument Type | Value Type | Attribute Key(s) | Attribute Values |
+|----------------|-------------------------|------------|------------------|------------------|
+| `{assemblies}` | ObservableUpDownCounter | `Int64` | No Attributes | N/A |
The API used to retrieve the value is:
@@ -301,6 +297,23 @@ metric is available in the .NET version you are running.
Some GC related metrics are unavailable until at least one garbage collection
has occurred.
+## Note
+
+OTel API updated System.Diagnostics.DiagnosticSource preview to version 7.0.0
+since [1.4.0-alpha.2](https://github.com/open-telemetry/opentelemetry-dotnet/releases/tag/core-1.4.0-alpha.2).
+
+With this update, applications targeting .NET 5 and lower will receive a
+warning at build time as described [here](https://github.com/dotnet/runtime/pull/72518)
+(note: building using older versions of the .NET SDK produces an error at
+build time). This is because .NET 5 reached EOL in May 2022 and .NET
+Core 3.1 reaches EOL in December 2022.
+
+There is no guarantee that System.Diagnostics.DiagnosticSource will continue
+to work on older versions of .NET. However, the build warning can be
+suppressed by setting the SuppressTfmSupportBuildWarnings MSBuild property.
+
+This does not affect applications targeting .NET Framework.
+
## References
* [OpenTelemetry Project](https://opentelemetry.io/)
diff --git a/src/OpenTelemetry.Instrumentation.Runtime/RuntimeMetrics.cs b/src/OpenTelemetry.Instrumentation.Runtime/RuntimeMetrics.cs
index ac7d89da01..f0605b0c6d 100644
--- a/src/OpenTelemetry.Instrumentation.Runtime/RuntimeMetrics.cs
+++ b/src/OpenTelemetry.Instrumentation.Runtime/RuntimeMetrics.cs
@@ -60,8 +60,7 @@ static RuntimeMetrics()
#endif
#if NET6_0_OR_GREATER
- // TODO: change to ObservableUpDownCounter
- MeterInstance.CreateObservableGauge(
+ MeterInstance.CreateObservableUpDownCounter(
"process.runtime.dotnet.gc.committed_memory.size",
() =>
{
@@ -90,8 +89,7 @@ static RuntimeMetrics()
// Either Environment.Version is not 6 or (it's 6 but internal API GC.GetGenerationSize is valid)
if (!isCodeRunningOnBuggyRuntimeVersion || getGenerationSize != null)
{
- // TODO: change to ObservableUpDownCounter
- MeterInstance.CreateObservableGauge(
+ MeterInstance.CreateObservableUpDownCounter(
"process.runtime.dotnet.gc.heap.size",
() =>
{
@@ -124,8 +122,7 @@ static RuntimeMetrics()
// Not valid until .NET 7 where the bug in the API is fixed. See context in https://github.com/open-telemetry/opentelemetry-dotnet-contrib/issues/496
if (Environment.Version.Major >= 7)
{
- // TODO: change to ObservableUpDownCounter
- MeterInstance.CreateObservableGauge(
+ MeterInstance.CreateObservableUpDownCounter(
"process.runtime.dotnet.gc.heap.fragmentation.size",
() =>
{
@@ -174,8 +171,7 @@ static RuntimeMetrics()
() => Monitor.LockContentionCount,
description: "The number of times there was contention when trying to acquire a monitor lock since the process start. Monitor locks are commonly acquired by using the lock keyword in C#, or by calling Monitor.Enter() and Monitor.TryEnter().");
- // TODO: change to ObservableUpDownCounter
- MeterInstance.CreateObservableGauge(
+ MeterInstance.CreateObservableUpDownCounter(
"process.runtime.dotnet.thread_pool.threads.count",
() => (long)ThreadPool.ThreadCount,
description: "The number of thread pool threads that currently exist.");
@@ -185,21 +181,18 @@ static RuntimeMetrics()
() => ThreadPool.CompletedWorkItemCount,
description: "The number of work items that have been processed by the thread pool since the process start.");
- // TODO: change to ObservableUpDownCounter
- MeterInstance.CreateObservableGauge(
+ MeterInstance.CreateObservableUpDownCounter(
"process.runtime.dotnet.thread_pool.queue.length",
() => ThreadPool.PendingWorkItemCount,
description: "The number of work items that are currently queued to be processed by the thread pool.");
- // TODO: change to ObservableUpDownCounter
- MeterInstance.CreateObservableGauge(
+ MeterInstance.CreateObservableUpDownCounter(
"process.runtime.dotnet.timer.count",
() => Timer.ActiveCount,
description: "The number of timer instances that are currently active. Timers can be created by many sources such as System.Threading.Timer, Task.Delay, or the timeout in a CancellationSource. An active timer is registered to tick at some point in the future and has not yet been canceled.");
#endif
- // TODO: change to ObservableUpDownCounter
- MeterInstance.CreateObservableGauge(
+ MeterInstance.CreateObservableUpDownCounter(
"process.runtime.dotnet.assemblies.count",
() => (long)AppDomain.CurrentDomain.GetAssemblies().Length,
description: "The number of .NET assemblies that are currently loaded.");
diff --git a/test/OpenTelemetry.Instrumentation.Runtime.Tests/OpenTelemetry.Instrumentation.Runtime.Tests.csproj b/test/OpenTelemetry.Instrumentation.Runtime.Tests/OpenTelemetry.Instrumentation.Runtime.Tests.csproj
index 65615a0ce0..ddc0a98c3d 100644
--- a/test/OpenTelemetry.Instrumentation.Runtime.Tests/OpenTelemetry.Instrumentation.Runtime.Tests.csproj
+++ b/test/OpenTelemetry.Instrumentation.Runtime.Tests/OpenTelemetry.Instrumentation.Runtime.Tests.csproj
@@ -8,7 +8,7 @@
-
+
all