With TinyInsights, you can track dependencies. As default, all dependencies are tracked when you have turned it on. But wiuth the new dependency filter introduced in 1.4.0 you can define what dependencies you want to track, depending on for example if it succeded or not.
You will define the filter when you set up TinyInsights in MauiProgram.cs.
Below are som example how you can use it.
Track failed dependencies:
.UseTinyInsights("{CONNECTION-STRING}", (provider) =>
{
provider.TrackDependencyFilter = (dependency) =>
{
return !dependency.Success;
};
});
Track by specific status/result code:
.UseTinyInsights("{CONNECTION-STRING}", (provider) =>
{
provider.TrackDependencyFilter = (dependency) =>
{
return dependency.ResultCode == 500;
};
}
Track all with a duration of 1000 ms or more:
.UseTinyInsights("{CONNECTION-STRING}", (provider) =>
{
provider.TrackDependencyFilter = (dependency) =>
{
return dependency.Duration.Milliseconds >= 1000;
};
}
To learn more about how to set it up and use it, check the docs on GitHub: https://github.com/dhindrik/TinyInsights.Maui