Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
e7d40c7
Added metrics hook.
askpt Dec 31, 2024
46e5711
Adding the traces hook.
askpt Dec 31, 2024
ced2d34
Adding Metrics Hook tests.
askpt Dec 31, 2024
633859c
Adding tracing hook tests.
askpt Dec 31, 2024
6d4378f
Fix typos.
askpt Dec 31, 2024
8a32ca9
Simplify code.
askpt Dec 31, 2024
629b900
Cleanup tracing hook tests.
askpt Dec 31, 2024
766caa5
More test cleanup.
askpt Dec 31, 2024
703f418
Cleanup tests.
askpt Dec 31, 2024
729bd65
Adding empty span.
askpt Dec 31, 2024
7f5af18
Adding .ConfigureAwait
askpt Dec 31, 2024
c0b6cc0
Fix dotnet format.
askpt Dec 31, 2024
d0157ae
Removed comma
askpt Dec 31, 2024
902a102
Adding README information.
askpt Dec 31, 2024
60813c5
Merge branch 'main' into askpt/175-promote-otel-hooks
askpt Dec 31, 2024
6a3d911
Using the new API.
askpt Dec 31, 2024
52b47da
Fix subscribed Meter.
askpt Dec 31, 2024
8e1e884
Merge branch 'main' into askpt/175-promote-otel-hooks
askpt Jan 6, 2025
1a0c16d
Merge branch 'main' into askpt/175-promote-otel-hooks
askpt Jan 7, 2025
41c915d
Fix breaking change.
askpt Jan 7, 2025
4bf70d2
Merge branch 'main' into askpt/175-promote-otel-hooks
askpt Feb 26, 2025
7b6ef96
Merge branch 'main' into askpt/175-promote-otel-hooks
askpt Mar 5, 2025
066706d
Merge branch 'main' into askpt/175-promote-otel-hooks
askpt Apr 8, 2025
5cfb99b
Merge branch 'main' into askpt/175-promote-otel-hooks
askpt Apr 8, 2025
a39ebbd
Merge branch 'main' into askpt/175-promote-otel-hooks
askpt Apr 28, 2025
415de4d
feat: add System.Diagnostics.DiagnosticSource package reference and u…
askpt Apr 28, 2025
4a3bacf
Merge branch 'main' into askpt/175-promote-otel-hooks
askpt May 12, 2025
dd86dd5
Merge branch 'main' into askpt/175-promote-otel-hooks
askpt May 19, 2025
94a1fcb
refactor: Replace MetricsConstants with TelemetryConstants in Metrics…
askpt May 19, 2025
a8789f4
refactor: Enhance documentation for TracingHook methods and clarify e…
askpt May 19, 2025
d34ede3
fix: Update return statements in TracingHook to call base methods for…
askpt May 19, 2025
345a164
fix: Correct documentation and update tag keys in TracingHook tests f…
askpt May 19, 2025
bc38b0c
refactor: Optimize Meter initialization in MetricsHook constructor fo…
askpt May 20, 2025
cd9811e
fix: Correct indentation in README.md for OpenTelemetry OTLP exporter…
askpt May 20, 2025
ed68e95
Merge branch 'main' into askpt/175-promote-otel-hooks
askpt May 21, 2025
fe05709
Merge branch 'main' into askpt/175-promote-otel-hooks
askpt Jun 4, 2025
3309850
chore: remove unused usings from hook files
askpt Jun 4, 2025
904fd44
chore: remove variant assignment from MetricsHook
askpt Jun 4, 2025
0200319
feat: add additional tags for flag evaluation details in TracingHook
askpt Jun 23, 2025
ed543dd
feat: add value and reason tags to telemetry in TracingHook
askpt Jun 23, 2025
5309232
fix: update remarks for MetricsHook and TracingHook to clarify experi…
askpt Jun 23, 2025
4359a37
refactor: rename AfterAsync to FinallyAsync in TracingHook and update…
askpt Jun 23, 2025
8038a69
Merge branch 'main' into askpt/175-promote-otel-hooks
askpt Jun 23, 2025
d3cf9d2
feat: add TraceEnricherHook and corresponding tests for telemetry tra…
askpt Jun 25, 2025
b8b3436
refactor: remove ErrorAsync method from TraceEnricherHook to streamli…
askpt Jun 25, 2025
46fcf38
refactor: update event name in TraceEnricherHook and remove unused Tr…
askpt Jun 25, 2025
cc5fde8
Merge branch 'main' into askpt/175-promote-otel-hooks
askpt Jun 25, 2025
4a3d3bc
refactor: streamline event tagging in TraceEnricherHook by using Eval…
askpt Jun 25, 2025
fea94e9
refactor: update event name and enhance assertions in TraceEnricherHo…
askpt Jun 25, 2025
78044d1
refactor: rename variable for clarity in TraceEnricherHookTests
askpt Jun 25, 2025
1a7f62a
docs: improve README formatting and enhance Trace Enricher Hook descr…
askpt Jun 25, 2025
a0319e4
feat: integrate OpenTelemetry for tracing and metrics in ASP.NET Core…
askpt Jun 25, 2025
2b4306a
Merge branch 'main' into askpt/175-promote-otel-hooks
askpt Jun 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Simplify code.
Signed-off-by: André Silva <[email protected]>
  • Loading branch information
askpt committed Dec 31, 2024
commit 8a32ca99205cee55dc47eb4c93dd213bc9ae6959
18 changes: 5 additions & 13 deletions test/OpenFeature.Tests/Hooks/TracingHookTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using OpenFeature.Hooks;
using OpenFeature.Model;
using OpenTelemetry;
Expand Down Expand Up @@ -48,15 +49,10 @@ public void TestAfter()
span.End();

Assert.Single(exportedItems);

var rootSpan = exportedItems[0];
var rootSpan = exportedItems.First();

Assert.Single(rootSpan.Events);

var eventsEnum = rootSpan.Events.GetEnumerator();
eventsEnum.MoveNext();

ActivityEvent ev = eventsEnum.Current;
ActivityEvent ev = rootSpan.Events.First();
Assert.Equal("feature_flag", ev.Name);

Assert.Contains(new KeyValuePair<string, object?>("feature_flag.key", "my-flag"), ev.Tags);
Expand Down Expand Up @@ -133,14 +129,10 @@ public void TestError()
span.End();

Assert.Single(exportedItems);

var rootSpan = exportedItems[0];
var rootSpan = exportedItems.First();

Assert.Single(rootSpan.Events);

var enumerator = rootSpan.Events.GetEnumerator();
enumerator.MoveNext();
var ev = enumerator.Current;
var ev = rootSpan.Events.First();

Assert.Equal("exception", ev.Name);

Expand Down