finally_ method
Future<void>
finally_(
- HookContext context,
- EvaluationDetails? evaluationDetails, [
- HookHints? hints
override
Always executed at the end, now with evaluation details parameter
Implementation
@override
Future<void> finally_(
HookContext context,
EvaluationDetails? evaluationDetails, [
HookHints? hints,
]) async {
// Generate OpenTelemetry attributes
final otelAttributes =
evaluationDetails != null
? OpenTelemetryUtil.fromEvaluationDetails(
evaluationDetails,
providerName: providerName,
)
: OpenTelemetryUtil.fromHookContext(
context,
providerName: providerName,
);
// Call the telemetry callback if provided
telemetryCallback?.call(otelAttributes);
}