Skip to content

Commit

Permalink
[Trace Exporters] Remove enumeration helper and use new net7 enumerat…
Browse files Browse the repository at this point in the history
…ion APIs (#3580)

* Remove enumeration helper and use new net7 enumeration APIs.

* Bug fixes.

* Add note.

* Don't use list pools in OTLP exporter. Implement drop counts.

* Added asserts for drop counts in span limits test.

* Added issue link to skip text.

* Populate DroppedAttributesCount on links & events.

* Code review.

* Code review.

* Added CHANGELOG note about dropped counts.
  • Loading branch information
CodeBlanch committed Aug 18, 2022
1 parent 245c2b3 commit 409b61d
Show file tree
Hide file tree
Showing 18 changed files with 318 additions and 1,054 deletions.
4 changes: 1 addition & 3 deletions build/Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<SerilogPkgVer>[2.8.0,3.0)</SerilogPkgVer>
<StyleCopAnalyzersPkgVer>[1.2.0-beta.354,2.0)</StyleCopAnalyzersPkgVer>
<SystemCollectionsImmutablePkgVer>1.4.0</SystemCollectionsImmutablePkgVer>
<SystemDiagnosticSourcePkgVer>7.0.0-preview.4.22229.4</SystemDiagnosticSourcePkgVer>
<SystemDiagnosticSourcePkgVer>7.0.0-preview.7.22375.6</SystemDiagnosticSourcePkgVer>
<SystemReflectionEmitLightweightPkgVer>4.7.0</SystemReflectionEmitLightweightPkgVer>
<SystemTextJsonPkgVer>4.7.0</SystemTextJsonPkgVer>
<SystemThreadingTasksExtensionsPkgVer>4.5.3</SystemThreadingTasksExtensionsPkgVer>
Expand Down Expand Up @@ -74,9 +74,7 @@

<ItemGroup Condition="'$(IncludeInstrumentationHelpers)'=='true' Or '$(IncludeDiagnosticSourceInstrumentationHelpers)'=='true'">
<Compile Include="$(RepoRoot)\src\OpenTelemetry.Api\Internal\ActivityHelperExtensions.cs" Link="Includes\ActivityHelperExtensions.cs" />
<Compile Include="$(RepoRoot)\src\OpenTelemetry.Api\Internal\EnumerationHelper.cs" Link="Includes\EnumerationHelper.cs" />
<Compile Include="$(RepoRoot)\src\OpenTelemetry.Api\Internal\ExceptionExtensions.cs" Link="Includes\ExceptionExtensions.cs" />
<Compile Include="$(RepoRoot)\src\OpenTelemetry.Api\Internal\IActivityEnumerator.cs" Link="Includes\IActivityEnumerator.cs" />
<Compile Include="$(RepoRoot)\src\OpenTelemetry.Api\Internal\SemanticConventions.cs" Link="Includes\SemanticConventions.cs" />
<Compile Include="$(RepoRoot)\src\OpenTelemetry.Api\Internal\SpanAttributeConstants.cs" Link="Includes\SpanAttributeConstants.cs" />
<Compile Include="$(RepoRoot)\src\OpenTelemetry.Api\Internal\SpanHelper.cs" Link="Includes\SpanHelper.cs" />
Expand Down
406 changes: 44 additions & 362 deletions src/OpenTelemetry.Api/Internal/ActivityHelperExtensions.cs

Large diffs are not rendered by default.

181 changes: 0 additions & 181 deletions src/OpenTelemetry.Api/Internal/EnumerationHelper.cs

This file was deleted.

34 changes: 0 additions & 34 deletions src/OpenTelemetry.Api/Internal/IActivityEnumerator.cs

This file was deleted.

10 changes: 10 additions & 0 deletions src/OpenTelemetry.Api/Internal/StatusHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,15 @@ public static string GetTagValueForStatusCode(StatusCode statusCode)
_ => null,
};
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool TryGetStatusCodeForTagValue(string statusCodeTagValue, out StatusCode statusCode)
{
StatusCode? tempStatusCode = GetStatusCodeForTagValue(statusCodeTagValue);

statusCode = tempStatusCode ?? default;

return tempStatusCode.HasValue;
}
}
}
1 change: 0 additions & 1 deletion src/OpenTelemetry.Api/OpenTelemetry.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@

<ItemGroup>
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="$(SystemDiagnosticSourcePkgVer)" />
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="$(SystemReflectionEmitLightweightPkgVer)" />
</ItemGroup>
</Project>
Loading

0 comments on commit 409b61d

Please sign in to comment.