-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the old class to keep functionality for updates.
Signed-off-by: André Silva <[email protected]>
- Loading branch information
Showing
1 changed file
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
using OpenFeature.Model; | ||
using System.Threading.Tasks; | ||
using System.Collections.Generic; | ||
using System.Diagnostics.CodeAnalysis; | ||
using System; | ||
|
||
namespace OpenFeature.Contrib.Hooks.Otel | ||
|
||
{ | ||
/// <summary> | ||
/// Stub. | ||
/// </summary> | ||
[ExcludeFromCodeCoverage] | ||
[Obsolete("This class is obsolete and will be removed in a future version. Please use TracingHook instead.")] | ||
public class OtelHook : Hook | ||
{ | ||
private readonly TracingHook _tracingHook; | ||
|
||
/// <summary> | ||
/// Stub. | ||
/// </summary> | ||
[Obsolete("This class is obsolete and will be removed in a future version. Please use TracingHook instead.")] | ||
public OtelHook() | ||
{ | ||
_tracingHook = new TracingHook(); | ||
} | ||
|
||
/// <summary> | ||
/// After is executed after a feature flag has been evaluated. | ||
/// </summary> | ||
/// <param name="context">The hook context</param> | ||
/// <param name="details">The result of the feature flag evaluation</param> | ||
/// <param name="hints">Hints for the feature flag evaluation</param> | ||
/// <returns>An awaitable Task object</returns> | ||
public override Task After<T>(HookContext<T> context, FlagEvaluationDetails<T> details, | ||
IReadOnlyDictionary<string, object> hints = null) | ||
{ | ||
_tracingHook.After(context, details, hints); | ||
|
||
return Task.CompletedTask; | ||
} | ||
|
||
/// <summary> | ||
/// Error is executed when an error during a feature flag evaluation occured. | ||
/// </summary> | ||
/// <param name="context">The hook context</param> | ||
/// <param name="error">The exception thrown by feature flag provider</param> | ||
/// <param name="hints">Hints for the feature flag evaluation</param> | ||
/// <returns>An awaitable Task object</returns> | ||
public override Task Error<T>(HookContext<T> context, System.Exception error, | ||
IReadOnlyDictionary<string, object> hints = null) | ||
{ | ||
_tracingHook.Error(context, error, hints); | ||
|
||
return Task.CompletedTask; | ||
} | ||
|
||
} | ||
} | ||
|
||
|