feat: hooking observability.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using Godot;
|
||||
using GodotHostTest.AetherBind;
|
||||
using GodotHostTest.Game.Target;
|
||||
@@ -19,8 +21,13 @@ public partial class LevelServiceSource : ServiceSource
|
||||
|
||||
[WithProvider]
|
||||
private void OnScopeCreated(IValueSetter<ITargetCollector> targetCollector,
|
||||
IValueSetter<ITargetSpawner> targetSpawner)
|
||||
IValueSetter<ITargetSpawner> targetSpawner, ActivitySource activitySource, IValueSetter<Activity> activity)
|
||||
{
|
||||
// ReSharper disable once ExplicitCallerInfoArgument - the caller name is not significant in this case
|
||||
var activityValue = activitySource.StartActivity("Level") ??
|
||||
throw new InvalidOperationException(
|
||||
"No listeners for the activity - is OpenTelemetry running?");
|
||||
activity.Set(activityValue);
|
||||
targetCollector.Set(_targetSpawner);
|
||||
targetSpawner.Set(_targetSpawner);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user