Skip to content

Commit

Permalink
Added the old class to keep functionality for updates.
Browse files Browse the repository at this point in the history
Signed-off-by: André Silva <[email protected]>
  • Loading branch information
askpt committed Dec 18, 2023
1 parent d14647d commit ef5866c
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions src/OpenFeature.Contrib.Hooks.Otel/OtelHook.cs
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;
}

}
}


0 comments on commit ef5866c

Please sign in to comment.