Class TracingHook
TracingHook is a Hook that adds tracing capabilities to the LaunchDarkly SDK for feature flag evaluations.
To create a TracingHook, see TracingHookBuilder.
Implements
Inherited Members
Namespace: LaunchDarkly.Sdk.Server.Telemetry
Assembly: LaunchDarkly.ServerSdk.Telemetry.dll
Syntax
public class TracingHook : Hook, IDisposable
Properties
| Edit this page View SourceActivitySourceName
Returns the name of the ActivitySource that the TracingHook uses to generate Activities.
Declaration
public static string ActivitySourceName { get; }
Property Value
Type | Description |
---|---|
string |
Methods
| Edit this page View SourceAfterEvaluation(EvaluationSeriesContext, ImmutableDictionary<string, object>, EvaluationDetail<LdValue>)
Ends the activity created in BeforeEvaluation, if it exists. Adds the feature flag key, provider name, and context key to the existing activity. If IncludeVariant is enabled, also adds the variant.
Declaration
public override ImmutableDictionary<string, object> AfterEvaluation(EvaluationSeriesContext context, ImmutableDictionary<string, object> data, EvaluationDetail<LdValue> detail)
Parameters
Type | Name | Description |
---|---|---|
EvaluationSeriesContext | context | the evaluation parameters |
ImmutableDictionary<string, object> | data | the series data |
EvaluationDetail<LdValue> | detail | the evaluation details |
Returns
Type | Description |
---|---|
ImmutableDictionary<string, object> |
Overrides
| Edit this page View SourceBeforeEvaluation(EvaluationSeriesContext, ImmutableDictionary<string, object>)
Optionally creates a new Activity for the evaluation of a feature flag.
Declaration
public override ImmutableDictionary<string, object> BeforeEvaluation(EvaluationSeriesContext context, ImmutableDictionary<string, object> data)
Parameters
Type | Name | Description |
---|---|---|
EvaluationSeriesContext | context | the evaluation parameters |
ImmutableDictionary<string, object> | data | the series data |
Returns
Type | Description |
---|---|
ImmutableDictionary<string, object> | unchanged data if CreateActivities is disabled, or data containing a reference to the created activity |
Overrides
| Edit this page View SourceBuilder()
Returns a TracingHookBuilder which can be used to create a TracingHook.
Declaration
public static TracingHookBuilder Builder()
Returns
Type | Description |
---|---|
TracingHookBuilder | the builder |
Default()
Returns the default TracingHook. By default, the hook will attach an event to the current activity.
To change the configuration, see Builder().
Declaration
public static TracingHook Default()
Returns
Type | Description |
---|---|
TracingHook |