Skip to content

Commit

Permalink
GenevaTraceExporter bug fix to not export activities not sampled in (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
cijothomas authored May 11, 2022
1 parent 077363a commit 3883de8
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
* Throw exception when `TableNameMappings` contains a `null` value.
[322](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/322)

* TraceExporter bug fix to not export non-recorded Activities.
[352](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/352)

## 1.2.6 [2022-Apr-21]

* Set GenevaMetricExporter temporality preference back to Delta.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
// </copyright>

using System;
using System.Diagnostics;
using OpenTelemetry.Internal;
using OpenTelemetry.Trace;

Expand Down Expand Up @@ -48,7 +47,7 @@ private static TracerProviderBuilder AddGenevaTraceExporter(this TracerProviderB
}
else
{
return builder.AddProcessor(new ReentrantExportProcessor<Activity>(exporter));
return builder.AddProcessor(new ReentrantActivityExportProcessor(exporter));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// <copyright file="ReentrantActivityExportProcessor.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.Diagnostics;

namespace OpenTelemetry.Exporter.Geneva;

// This export processor exports without synchronization.
// Once OpenTelemetry .NET officially support this,
// we can get rid of this class.
// This is currently only used in ETW export, where we know
// that the underlying system is safe under concurrent calls.
internal class ReentrantActivityExportProcessor : ReentrantExportProcessor<Activity>
{
public ReentrantActivityExportProcessor(BaseExporter<Activity> exporter)
: base(exporter)
{
}

protected override void OnExport(Activity data)
{
if (data.Recorded)
{
base.OnExport(data);
}
}
}

0 comments on commit 3883de8

Please sign in to comment.