@@ -10,13 +10,13 @@ This content has been automatically generated from dotnet-sdk.
10
10
Edits should be made here: https://github.com/open-feature/dotnet-sdk
11
11
Once a repo has been updated, docs can be generated by running: yarn update :sdk-docs
12
12
13
- Last updated at Wed Jul 16 2025 08:11:00 GMT+0000 (Coordinated Universal Time)
13
+ Last updated at Mon Aug 04 2025 08:12:12 GMT+0000 (Coordinated Universal Time)
14
14
-->
15
15
16
16
[](https://github.com/open-feature/spec/releases/tag/v0.8.0)
17
17
[
18
- 
19
- ](https://github.com/open-feature/dotnet-sdk/releases/tag/v2.7.0 )
18
+ 
19
+ ](https://github.com/open-feature/dotnet-sdk/releases/tag/v2.8.1 )
20
20
21
21
[](https://cloud-native.slack.com/archives/C0344AANLA1)
22
22
[](https://codecov.io/gh/open-feature/dotnet-sdk)
@@ -603,6 +603,24 @@ namespace OpenFeatureTestApp
603
603
604
604
After running this example, you will be able to see the traces, including the events sent by the hook in your Jaeger UI.
605
605
606
+ You can specify custom tags on spans created by the ` TraceEnricherHook ` by providing ` TraceEnricherHookOptions ` when adding the hook:
607
+
608
+ ``` csharp
609
+ var options = TraceEnricherHookOptions .CreateBuilder ()
610
+ .WithTag (" custom_dimension_key" , " custom_dimension_value" )
611
+ .Build ();
612
+
613
+ OpenFeature .Api .Instance .AddHooks (new TraceEnricherHook (options ));
614
+ ```
615
+
616
+ You can also write your own extraction logic against the Flag metadata by providing a callback to ` WithFlagEvaluationMetadata ` . The below example will add a tag to the span with the key ` boolean ` and a value specified by the callback.
617
+
618
+ ``` csharp
619
+ var options = TraceEnricherHookOptions .CreateBuilder ()
620
+ .WithFlagEvaluationMetadata (" boolean" , s => s .GetBool (" boolean" ))
621
+ .Build ();
622
+ ```
623
+
606
624
### Metrics Hook
607
625
608
626
For this hook to function correctly a global ` MeterProvider ` must be set.
@@ -663,3 +681,21 @@ namespace OpenFeatureTestApp
663
681
664
682
After running this example, you should be able to see some metrics being generated into the console.
665
683
684
+ You can specify custom dimensions on all instruments by the ` MetricsHook ` by providing ` MetricsHookOptions ` when adding the hook:
685
+
686
+ ``` csharp
687
+ var options = MetricsHookOptions .CreateBuilder ()
688
+ .WithCustomDimension (" custom_dimension_key" , " custom_dimension_value" )
689
+ .Build ();
690
+
691
+ OpenFeature .Api .Instance .AddHooks (new MetricsHook (options ));
692
+ ```
693
+
694
+ You can also write your own extraction logic against the Flag metadata by providing a callback to ` WithFlagEvaluationMetadata ` .
695
+
696
+ ``` csharp
697
+ var options = MetricsHookOptions .CreateBuilder ()
698
+ .WithFlagEvaluationMetadata (" boolean" , s => s .GetBool (" boolean" ))
699
+ .Build ();
700
+ ```
701
+
0 commit comments