-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support the addTelemetryInitializer
boolean delegate
#297
Comments
I attempted to solve this a few times, the main issue is the call is synchronous and JSInterop must be async. I was not able to get this to work :( |
I don't understand how sync/async issues could be blocking this; would you mind giving some more detail? |
App Insights calls the telemetryInitializer synchronously, in that method, we need to call JSInterop into Blazor, this call has to be done async. I had it implemented in my v3 pr, but it didn't work.
BlazorApplicationInsights/src/BlazorApplicationInsights/Models/TelemetryInitializer.cs Line 6 in bb2d22b
The issue is here, where we inject the initializer, it has to be async but it doesn't work.
|
I see. From the documentation, .NET provides a synchronous version of the invocation method: |
I haven't as it only works on WASM, but that would likely work. If the WASM limitation is fine, I'd happily take a PR. We should add a new method "AddWASMTelemetryInitializer" or something so its clear it only works on WASM. |
The addTelemetryInitializer function defines the following signature:
I don't believe there currently exists a way to utilise this
boolean
delegate such that telemetry items can be conditionally excluded or otherwise handled. This would be extremely useful.I realise there may be JS interop limitations which immediately prevent this capability (serialization of a
Func<>
argument), but raising this issue in the hopes that some level of equivalence could be achieved.The text was updated successfully, but these errors were encountered: