Skip to content

Commit

Permalink
Update ApplicationInsights components
Browse files Browse the repository at this point in the history
  • Loading branch information
markusrt committed Jan 20, 2024
1 parent 7d60638 commit 8939913
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 49 deletions.
2 changes: 1 addition & 1 deletion NRZMyk.Client/NRZMyk.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
<PackageReference Include="BlazorApplicationInsights" Version="1.4.0" />
<PackageReference Include="BlazorApplicationInsights" Version="3.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.3" PrivateAssets="all" />
<PackageReference Include="Microsoft.Authentication.WebAssembly.Msal" Version="6.0.3" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BlazorApplicationInsights" Version="1.4.0" />
<PackageReference Include="BlazorApplicationInsights" Version="3.0.4" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
</ItemGroup>

Expand Down
84 changes: 41 additions & 43 deletions NRZMyk.Component.Playground/NullApplicationInsights.cs
Original file line number Diff line number Diff line change
@@ -1,109 +1,107 @@
using System;
using BlazorApplicationInsights;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.JSInterop;
using BlazorApplicationInsights.Interfaces;
using BlazorApplicationInsights.Models;

namespace NRZMyk.Components.Playground
{
internal class NullApplicationInsights : IApplicationInsights
{
public Task InitBlazorApplicationInsightsAsync(IJSRuntime jSRuntime)
public CookieMgr GetCookieMgr()
{
return Task.CompletedTask;
return null;
}

public Task TrackEvent(string name, Dictionary<string, object> properties = null)
public Task TrackEvent(EventTelemetry @event)
{
return Task.CompletedTask;
return Task.CompletedTask;
}

public Task TrackTrace(string message, SeverityLevel? severityLevel = null, Dictionary<string, object> properties = null)
public Task TrackPageView(PageViewTelemetry pageView = null)
{
return Task.CompletedTask;
return Task.CompletedTask;
}

public Task TrackException(Error exception, string id = null, SeverityLevel? severityLevel = null,
Dictionary<string, object> properties = null)
public Task TrackException(ExceptionTelemetry exception)
{
return Task.CompletedTask;
return Task.CompletedTask;
}

public Task TrackPageView(string name = null, string uri = null, string refUri = null, string pageType = null,
bool? isLoggedIn = null, Dictionary<string, object> properties = null)
public Task TrackTrace(TraceTelemetry trace)
{
return Task.CompletedTask;
return Task.CompletedTask;
}

public Task TrackMetric(MetricTelemetry metric)
{
return Task.CompletedTask;
}

public Task StartTrackPage(string name = null)
{
return Task.CompletedTask;
return Task.CompletedTask;
}

public Task StopTrackPage(string name = null, string url = null, Dictionary<string, string> properties = null,
public Task StopTrackPage(string name = null, string url = null, Dictionary<string, object> customProperties = null,
Dictionary<string, decimal> measurements = null)
{
return Task.CompletedTask;
return Task.CompletedTask;
}

public Task TrackMetric(string name, double average, double? sampleCount = null, double? min = null, double? max = null,
Dictionary<string, object> properties = null)
public Task StartTrackEvent(string name)
{
return Task.CompletedTask;
return Task.CompletedTask;
}

public Task TrackDependencyData(string id, string name, decimal? duration = null, bool? success = null,
DateTime? startTime = null, int? responseCode = null, string correlationContext = null, string type = null,
string data = null, string target = null)
public Task StopTrackEvent(string name, Dictionary<string, object> properties = null, Dictionary<string, decimal> measurements = null)
{
return Task.CompletedTask;
return Task.CompletedTask;
}

public Task Flush(bool? async)
public Task AddTelemetryInitializer(TelemetryItem telemetryItem)
{
return Task.CompletedTask;
return Task.CompletedTask;
}

public Task ClearAuthenticatedUserContext()
public Task TrackPageViewPerformance(PageViewPerformanceTelemetry pageViewPerformance)
{
return Task.CompletedTask;
return Task.CompletedTask;
}

public Task SetAuthenticatedUserContext(string authenticatedUserId, string accountId = null, bool storeInCookie = false)
public Task TrackDependencyData(DependencyTelemetry dependency)
{
return Task.CompletedTask;
return Task.CompletedTask;
}

public Task AddTelemetryInitializer(TelemetryItem telemetryItem)
public Task<TelemetryContext> Context()
{
return Task.CompletedTask;
return Task.FromResult(new TelemetryContext());
}

public Task TrackPageViewPerformance(PageViewPerformanceTelemetry pageViewPerformance)
public Task Flush()
{
return Task.CompletedTask;
return Task.CompletedTask;
}

public Task StartTrackEvent(string name)
public Task ClearAuthenticatedUserContext()
{
return Task.CompletedTask;
return Task.CompletedTask;
}

public Task StopTrackEvent(string name, Dictionary<string, string> properties = null, Dictionary<string, decimal> measurements = null)
public Task SetAuthenticatedUserContext(string authenticatedUserId, string accountId = null, bool? storeInCookie = null)
{
return Task.CompletedTask;
return Task.CompletedTask;
}

public Task SetInstrumentationKey(string key)
public Task UpdateCfg(Config newConfig, bool mergeExisting = true)
{
return Task.CompletedTask;
return Task.CompletedTask;
}

public Task LoadAppInsights()
public void InitJSRuntime(IJSRuntime jSRuntime)
{
return Task.CompletedTask;
}

public bool EnableAutoRouteTracking { get; set; }
}
}
3 changes: 1 addition & 2 deletions NRZMyk.Component.Playground/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using AutoMapper;
using BlazorApplicationInsights;
using BlazorApplicationInsights.Interfaces;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.WebAssembly.Authentication;
Expand Down
2 changes: 1 addition & 1 deletion NRZMyk.Components/NRZMyk.Components.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BlazorApplicationInsights" Version="1.4.0" />
<PackageReference Include="BlazorApplicationInsights" Version="3.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.3" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="2.2.0" />
<PackageReference Include="Microsoft.Authentication.WebAssembly.Msal" Version="6.0.3" />
Expand Down
2 changes: 1 addition & 1 deletion NRZMyk.Server/NRZMyk.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageReference Include="MediatR" Version="8.1.0" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="8.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="6.0.3" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.17.0" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.22.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="6.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.3">
Expand Down

0 comments on commit 8939913

Please sign in to comment.