Skip to content

Commit 2382cb2

Browse files
chore: update sdk readmes (#1248)
The PR was automatically generated via the update-sdk-docs GitHub workflow. Signed-off-by: OpenFeature Bot <[email protected]> Co-authored-by: Michael Beemer <[email protected]>
1 parent 40502f6 commit 2382cb2

File tree

14 files changed

+166
-42
lines changed

14 files changed

+166
-42
lines changed

docs/reference/technologies/client/kotlin.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This content has been automatically generated from kotlin-sdk.
1010
Edits should be made here: https://github.com/open-feature/kotlin-sdk
1111
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
1212

13-
Last updated at Wed Jun 18 2025 08:10:32 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Wed Jul 16 2025 08:11:01 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

1616
<p align="center" class="github-badges">

docs/reference/technologies/client/swift.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This content has been automatically generated from swift-sdk.
1010
Edits should be made here: https://github.com/open-feature/swift-sdk
1111
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
1212

13-
Last updated at Wed Jun 18 2025 08:10:33 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Wed Jul 16 2025 08:11:02 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

1616
<p align="center" class="github-badges">
@@ -20,8 +20,8 @@ Last updated at Wed Jun 18 2025 08:10:33 GMT+0000 (Coordinated Universal Time)
2020
</a>
2121

2222

23-
<a href="https://github.com/open-feature/swift-sdk/releases/tag/0.3.0">
24-
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v0.3.0&color=blue&style=for-the-badge" />
23+
<a href="https://github.com/open-feature/swift-sdk/releases/tag/0.3.1">
24+
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v0.3.1&color=blue&style=for-the-badge" />
2525
</a>
2626

2727

@@ -62,7 +62,7 @@ First, ensure you have your GitHub account added as an option (+ > Add Source Co
6262
If you manage dependencies through SPM, in the dependencies section of Package.swift add:
6363

6464
```swift
65-
.package(url: "[email protected]:open-feature/swift-sdk.git", from: "0.3.0")
65+
.package(url: "[email protected]:open-feature/swift-sdk.git", from: "0.3.1")
6666
```
6767

6868
and in the target dependencies section add:

docs/reference/technologies/client/web/angular.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk.
1010
Edits should be made here: https://github.com/open-feature/js-sdk
1111
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
1212

13-
Last updated at Wed Jun 18 2025 08:10:33 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Wed Jul 16 2025 08:11:02 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

1616
<p align="center" class="github-badges">

docs/reference/technologies/client/web/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk.
1010
Edits should be made here: https://github.com/open-feature/js-sdk
1111
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
1212

13-
Last updated at Wed Jun 18 2025 08:10:32 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Wed Jul 16 2025 08:11:01 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

1616
<p align="center" class="github-badges">

docs/reference/technologies/client/web/react.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk.
1010
Edits should be made here: https://github.com/open-feature/js-sdk
1111
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
1212

13-
Last updated at Wed Jun 18 2025 08:10:32 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Wed Jul 16 2025 08:11:01 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

1616
<p align="center" class="github-badges">

docs/reference/technologies/server/dotnet.mdx

Lines changed: 144 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ This content has been automatically generated from dotnet-sdk.
1010
Edits should be made here: https://github.com/open-feature/dotnet-sdk
1111
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
1212

13-
Last updated at Wed Jun 18 2025 08:10:31 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Wed Jul 16 2025 08:11:00 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

1616
[![Specification](https://img.shields.io/static/v1?label=specification&message=v0.8.0&color=yellow&style=for-the-badge)](https://github.com/open-feature/spec/releases/tag/v0.8.0)
1717
[
18-
![Release](https://img.shields.io/static/v1?label=release&message=v2.6.0&color=blue&style=for-the-badge)
19-
](https://github.com/open-feature/dotnet-sdk/releases/tag/v2.6.0)
18+
![Release](https://img.shields.io/static/v1?label=release&message=v2.7.0&color=blue&style=for-the-badge)
19+
](https://github.com/open-feature/dotnet-sdk/releases/tag/v2.7.0)
2020

2121
[![Slack](https://img.shields.io/badge/slack-%40cncf%2Fopenfeature-brightgreen?style=flat&logo=slack)](https://cloud-native.slack.com/archives/C0344AANLA1)
2222
[![Codecov](https://codecov.io/gh/open-feature/dotnet-sdk/branch/main/graph/badge.svg?token=MONAVJBXUJ)](https://codecov.io/gh/open-feature/dotnet-sdk)
@@ -78,23 +78,23 @@ public async Task Example()
7878

7979
The [`samples/`](https://github.com/open-feature/dotnet-sdk/blob/main/samples) folder contains example applications demonstrating how to use OpenFeature in different .NET scenarios.
8080

81-
| Sample Name | Description |
82-
|---------------------------------------------------|----------------------------------------------------------------|
83-
| [AspNetCore](https://github.com/open-feature/dotnet-sdk/blob/main/samples/AspNetCore/README.md) | Feature flags in an ASP.NET Core Web API. |
81+
| Sample Name | Description |
82+
| ------------------------------------------- | ----------------------------------------- |
83+
| [AspNetCore](https://github.com/open-feature/dotnet-sdk/blob/main/samples/AspNetCore/README.md) | Feature flags in an ASP.NET Core Web API. |
8484

8585
**Getting Started with a Sample:**
8686

8787
1. Navigate to the sample directory
8888

89-
```shell
90-
cd samples/AspNetCore
91-
```
89+
```shell
90+
cd samples/AspNetCore
91+
```
9292

9393
2. Restore dependencies and run
9494

95-
```shell
96-
dotnet run
97-
```
95+
```shell
96+
dotnet run
97+
```
9898

9999
Want to contribute a new sample? See our [CONTRIBUTING](https://github.com/open-feature/dotnet-sdk/blob/main/CONTRIBUTING.md) guide!
100100

@@ -112,7 +112,7 @@ Want to contribute a new sample? See our [CONTRIBUTING](https://github.com/open-
112112
| | [Shutdown](#shutdown) | Gracefully clean up a provider during application shutdown. |
113113
| | [Transaction Context Propagation](#transaction-context-propagation) | Set a specific [evaluation context](/docs/reference/concepts/evaluation-context) for a transaction (e.g. an HTTP request or a thread). |
114114
| | [Extending](#extending) | Extend OpenFeature with custom providers and hooks. |
115-
| 🔬 | [DependencyInjection](#DependencyInjection) | Integrate OpenFeature with .NET's dependency injection for streamlined provider setup. |
115+
| 🔬 | [DependencyInjection](#dependency-injection) | Integrate OpenFeature with .NET's dependency injection for streamlined provider setup. |
116116

117117
> Implemented: ✅ | In-progress: ⚠️ | Not implemented yet: ❌ | Experimental: 🔬
118118

@@ -432,7 +432,7 @@ Hooks support passing per-evaluation data between that stages using `hook data`.
432432

433433
Built a new hook? [Let us know](https://github.com/open-feature/openfeature.dev/issues/new?assignees=&labels=hook&projects=&template=document-hook.yaml&title=%5BHook%5D%3A+) so we can add it to the docs!
434434

435-
### DependencyInjection
435+
### Dependency Injection
436436

437437
> [!NOTE]
438438
> The OpenFeature.DependencyInjection and OpenFeature.Hosting packages are currently experimental. They streamline the integration of OpenFeature within .NET applications, allowing for seamless configuration and lifecycle management of feature flag providers using dependency injection and hosting services.
@@ -480,6 +480,7 @@ builder.Services.AddOpenFeature(featureBuilder => {
480480
.AddHostedFeatureLifecycle()
481481
.AddContext((contextBuilder, serviceProvider) => { /* Custom context configuration */ })
482482
.AddHook((serviceProvider) => new LoggingHook( /* Custom configuration */ ))
483+
.AddHook(new MetricsHook())
483484
.AddInMemoryProvider("name1")
484485
.AddInMemoryProvider("name2")
485486
.AddPolicyName(options => {
@@ -533,3 +534,132 @@ services.AddOpenFeature(builder =>
533534
});
534535
```
535536

537+
### Trace Enricher Hook
538+
539+
The `TraceEnricherHook` enriches telemetry traces with additional information during the feature flag evaluation lifecycle. This hook adds relevant flag evaluation details as tags and events to the current `Activity` for tracing purposes.
540+
541+
For this hook to function correctly, an active span must be set in the current `Activity`, otherwise the hook will no-op.
542+
543+
Below are the tags added to the trace event:
544+
545+
| Tag Name | Description | Source |
546+
| --------------------------- | ---------------------------------------------------------------------------- | ----------------------------- |
547+
| feature_flag.key | The lookup key of the feature flag | Hook context flag key |
548+
| feature_flag.provider.name | The name of the feature flag provider | Provider metadata |
549+
| feature_flag.result.reason | The reason code which shows how a feature flag value was determined | Evaluation details |
550+
| feature_flag.result.variant | A semantic identifier for an evaluated flag value | Evaluation details |
551+
| feature_flag.result.value | The evaluated value of the feature flag | Evaluation details |
552+
| feature_flag.context.id | The unique identifier for the flag evaluation context | Flag metadata (if available) |
553+
| feature_flag.set.id | The identifier of the flag set to which the feature flag belongs | Flag metadata (if available) |
554+
| feature_flag.version | The version of the ruleset used during the evaluation | Flag metadata (if available) |
555+
| error.type | Describes a class of error the operation ended with | Evaluation details (if error) |
556+
| error.message | A message explaining the nature of an error occurring during flag evaluation | Evaluation details (if error) |
557+
558+
#### Example
559+
560+
The following example demonstrates the use of the `TraceEnricherHook` with the `OpenFeature dotnet-sdk`. The traces are sent to a `jaeger` OTLP collector running at `localhost:4317`.
561+
562+
```csharp
563+
using OpenFeature.Contrib.Providers.Flagd;
564+
using OpenFeature.Hooks;
565+
using OpenTelemetry.Exporter;
566+
using OpenTelemetry.Resources;
567+
using OpenTelemetry;
568+
using OpenTelemetry.Trace;
569+
570+
namespace OpenFeatureTestApp
571+
{
572+
class Hello {
573+
static void Main(string[] args) {
574+
575+
// set up the OpenTelemetry OTLP exporter
576+
var tracerProvider = Sdk.CreateTracerProviderBuilder()
577+
.AddSource("my-tracer")
578+
.ConfigureResource(r => r.AddService("jaeger-test"))
579+
.AddOtlpExporter(o =>
580+
{
581+
o.ExportProcessorType = ExportProcessorType.Simple;
582+
})
583+
.Build();
584+
585+
// add the TraceEnricherHook to the OpenFeature instance
586+
OpenFeature.Api.Instance.AddHooks(new TraceEnricherHook());
587+
588+
var flagdProvider = new FlagdProvider(new Uri("http://localhost:8013"));
589+
590+
// Set the flagdProvider as the provider for the OpenFeature SDK
591+
OpenFeature.Api.Instance.SetProvider(flagdProvider);
592+
593+
var client = OpenFeature.Api.Instance.GetClient("my-app");
594+
595+
var val = client.GetBooleanValueAsync("myBoolFlag", false, null);
596+
597+
// Print the value of the 'myBoolFlag' feature flag
598+
System.Console.WriteLine(val.Result.ToString());
599+
}
600+
}
601+
}
602+
```
603+
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+
606+
### Metrics Hook
607+
608+
For this hook to function correctly a global `MeterProvider` must be set.
609+
`MetricsHook` performs metric collection by tapping into various hook stages.
610+
611+
Below are the metrics extracted by this hook and dimensions they carry:
612+
613+
| Metric key | Description | Unit | Dimensions |
614+
| -------------------------------------- | ------------------------------- | ------------ | ----------------------------- |
615+
| feature_flag.evaluation_requests_total | Number of evaluation requests | request | key, provider name |
616+
| feature_flag.evaluation_success_total | Flag evaluation successes | impression | key, provider name, reason |
617+
| feature_flag.evaluation_error_total | Flag evaluation errors | 1 | key, provider name, exception |
618+
| feature_flag.evaluation_active_count | Active flag evaluations counter | 1 | key, provider name |
619+
620+
Consider the following code example for usage.
621+
622+
#### Example
623+
624+
The following example demonstrates the use of the `MetricsHook` with the `OpenFeature dotnet-sdk`. The metrics are sent to the `console`.
625+
626+
```csharp
627+
using OpenFeature.Contrib.Providers.Flagd;
628+
using OpenFeature;
629+
using OpenFeature.Hooks;
630+
using OpenTelemetry;
631+
using OpenTelemetry.Metrics;
632+
633+
namespace OpenFeatureTestApp
634+
{
635+
class Hello {
636+
static void Main(string[] args) {
637+
638+
// set up the OpenTelemetry OTLP exporter
639+
var meterProvider = Sdk.CreateMeterProviderBuilder()
640+
.AddMeter("OpenFeature")
641+
.ConfigureResource(r => r.AddService("openfeature-test"))
642+
.AddConsoleExporter()
643+
.Build();
644+
645+
// add the MetricsHook to the OpenFeature instance
646+
OpenFeature.Api.Instance.AddHooks(new MetricsHook());
647+
648+
var flagdProvider = new FlagdProvider(new Uri("http://localhost:8013"));
649+
650+
// Set the flagdProvider as the provider for the OpenFeature SDK
651+
OpenFeature.Api.Instance.SetProvider(flagdProvider);
652+
653+
var client = OpenFeature.Api.Instance.GetClient("my-app");
654+
655+
var val = client.GetBooleanValueAsync("myBoolFlag", false, null);
656+
657+
// Print the value of the 'myBoolFlag' feature flag
658+
System.Console.WriteLine(val.Result.ToString());
659+
}
660+
}
661+
}
662+
```
663+
664+
After running this example, you should be able to see some metrics being generated into the console.
665+

docs/reference/technologies/server/go.mdx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This content has been automatically generated from go-sdk.
99
Edits should be made here: https://github.com/open-feature/go-sdk
1010
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
1111

12-
Last updated at Wed Jun 18 2025 08:10:31 GMT+0000 (Coordinated Universal Time)
12+
Last updated at Wed Jul 16 2025 08:11:01 GMT+0000 (Coordinated Universal Time)
1313
-->
1414

1515
<p align="center" class="github-badges">
@@ -392,12 +392,6 @@ func (i MyFeatureProvider) Init(evaluationContext openfeature.EvaluationContext)
392392
// code to initialize your provider
393393
}
394394

395-
// Status expose the status of the provider
396-
func (i MyFeatureProvider) Status() openfeature.State {
397-
// The state is typically set during initialization.
398-
return openfeature.ReadyState
399-
}
400-
401395
// Shutdown define the shutdown operation of the provider
402396
func (i MyFeatureProvider) Shutdown() {
403397
// code to shutdown your provider

docs/reference/technologies/server/java.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This content has been automatically generated from java-sdk.
99
Edits should be made here: https://github.com/open-feature/java-sdk
1010
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
1111

12-
Last updated at Wed Jun 18 2025 08:10:31 GMT+0000 (Coordinated Universal Time)
12+
Last updated at Wed Jul 16 2025 08:11:00 GMT+0000 (Coordinated Universal Time)
1313
-->
1414

1515
<p align="center" class="github-badges">
@@ -18,8 +18,8 @@ Last updated at Wed Jun 18 2025 08:10:31 GMT+0000 (Coordinated Universal Time)
1818
</a>
1919

2020

21-
<a href="https://github.com/open-feature/java-sdk/releases/tag/v1.15.1">
22-
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v1.15.1&color=blue&style=for-the-badge" />
21+
<a href="https://github.com/open-feature/java-sdk/releases/tag/v1.16.0">
22+
<img alt="Release" src="https://img.shields.io/static/v1?label=release&message=v1.16.0&color=blue&style=for-the-badge" />
2323
</a>
2424

2525

@@ -54,7 +54,7 @@ Note that this library is intended to be used in server-side contexts and has no
5454
<dependency>
5555
<groupId>dev.openfeature</groupId>
5656
<artifactId>sdk</artifactId>
57-
<version>1.15.1</version>
57+
<version>1.16.0</version>
5858
</dependency>
5959
```
6060

@@ -77,7 +77,7 @@ If you would like snapshot builds, this is the relevant repository information:
7777

7878
```groovy
7979
dependencies {
80-
implementation 'dev.openfeature:sdk:1.15.1'
80+
implementation 'dev.openfeature:sdk:1.16.0'
8181
}
8282
```
8383

docs/reference/technologies/server/javascript/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk.
1010
Edits should be made here: https://github.com/open-feature/js-sdk
1111
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
1212

13-
Last updated at Wed Jun 18 2025 08:10:31 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Wed Jul 16 2025 08:11:00 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

1616
<p align="center" class="github-badges">

docs/reference/technologies/server/javascript/nestjs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This content has been automatically generated from js-sdk.
1010
Edits should be made here: https://github.com/open-feature/js-sdk
1111
Once a repo has been updated, docs can be generated by running: yarn update:sdk-docs
1212

13-
Last updated at Wed Jun 18 2025 08:10:31 GMT+0000 (Coordinated Universal Time)
13+
Last updated at Wed Jul 16 2025 08:11:00 GMT+0000 (Coordinated Universal Time)
1414
-->
1515

1616
<p align="center" class="github-badges">

0 commit comments

Comments
 (0)