Skip to content

Commit

Permalink
update all nuget packagest to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
philosowaffle committed Dec 30, 2024
1 parent ce26691 commit b9f54e7
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 96 deletions.
2 changes: 1 addition & 1 deletion src/Api.Contract/SettingsContracts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class SettingsGarminPostRequest
public bool TwoStepVerificationEnabled { get; set; }
public bool Upload { get; set; }
public FileFormat FormatToUpload { get; set; }
public GarminApiSettings Api { get; set; }
public GarminApiSettings Api { get; set; } = new GarminApiSettings();
}

public class SettingsPelotonGetResponse
Expand Down
4 changes: 2 additions & 2 deletions src/ClientUI/ClientUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="9.0.12" />
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.21" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="9.0.21" />
</ItemGroup>

<ItemGroup>
Expand Down
10 changes: 5 additions & 5 deletions src/Common/Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
<PackageReference Include="Flurl.Http" Version="4.0.2" />
<PackageReference Include="Handlebars.Net" Version="2.1.6" />
<PackageReference Include="JsonFlatFileDataStore" Version="2.4.2" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.6.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.0.0-rc9" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.10.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.10.1" />
<PackageReference Include="OpenTelemetry.Exporter.Jaeger" Version="1.5.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.0.0-rc9" />
<PackageReference Include="Polly" Version="8.4.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.10.0" />
<PackageReference Include="Polly" Version="8.5.0" />
<PackageReference Include="prometheus-net" Version="8.2.1" />
<PackageReference Include="prometheus-net.AspNetCore" Version="8.2.1" />
<PackageReference Include="prometheus-net.DotNetRuntime" Version="4.4.0" />
<PackageReference Include="prometheus-net.DotNetRuntime" Version="4.4.1" />
<PackageReference Include="Serilog.Sinks.File.Header" Version="1.0.2" />
<PackageReference Include="System.Text.Json" Version="9.0.0" />

Expand Down
61 changes: 22 additions & 39 deletions src/Common/Observe/Tracing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static void EnableApiTracing(IServiceCollection services, Jaeger config)
.AddAspNetCoreInstrumentation(c =>
{
c.RecordException = true;
c.Enrich = AspNetCoreEnricher;
c.EnrichWithHttpRequest = AspNetCoreEnricher;
});
});

Expand Down Expand Up @@ -107,7 +107,9 @@ private static TracerProviderBuilder ConfigureDefaultBuilder(this TracerProvider
.AddHttpClientInstrumentation(h =>
{
h.RecordException = true;
h.Enrich = HttpEnricher;
h.EnrichWithException = (activity, exception) => activity.SetTag("stackTrace", exception.StackTrace);
h.EnrichWithHttpRequestMessage = HttpEnricher_EnrichWithHttpRequestMessage;
h.EnrichWithHttpResponseMessage = HttpEnricher_EnrichWithHttpResponseMessage;
})
.AddJaegerExporter(o =>
{
Expand Down Expand Up @@ -181,49 +183,30 @@ public static void ValidateConfig(Observability config)
}
}

public static void HttpEnricher(Activity activity, string name, object rawEventObject)
public static void HttpEnricher_EnrichWithHttpRequestMessage(Activity activity, HttpRequestMessage request)
{
if (name.Equals("OnStartActivity"))
{
if (rawEventObject is HttpRequestMessage request)
{
activity.DisplayName = $"{request.Method} {request.RequestUri.AbsolutePath}";
activity.SetTag("http.request.path", request.RequestUri.AbsolutePath);
activity.SetTag("http.request.query", request.RequestUri.Query);
activity.SetTag("http.request.body", request.Content?.ReadAsStringAsync().GetAwaiter().GetResult() ?? "no_content");
}
}
else if (name.Equals("OnStopActivity"))
{
if (rawEventObject is HttpResponseMessage response)
{
var content = response.Content?.ReadAsStringAsync().GetAwaiter().GetResult() ?? "no_content";
activity.SetTag("http.response.body", content);
}
}
else if (name.Equals("OnException"))
{
if (rawEventObject is Exception exception)
{
activity.SetTag("stackTrace", exception.StackTrace);
}
}
activity.DisplayName = $"{request.Method} {request.RequestUri.AbsolutePath}";
activity.SetTag("http.request.path", request.RequestUri.AbsolutePath);
activity.SetTag("http.request.query", request.RequestUri.Query);
activity.SetTag("http.request.body", request.Content?.ReadAsStringAsync().GetAwaiter().GetResult() ?? "no_content");
}

public static void AspNetCoreEnricher(Activity activity, string name, object rawEventObject)
public static void HttpEnricher_EnrichWithHttpResponseMessage(Activity activity, HttpResponseMessage response)
{
if (name.Equals("OnStartActivity")
&& rawEventObject is HttpRequest httpRequest)
{
if (httpRequest.Headers.TryGetValue("TraceId", out var incomingTraceParent))
activity.SetParentId(incomingTraceParent);
var content = response.Content?.ReadAsStringAsync().GetAwaiter().GetResult() ?? "no_content";
activity.SetTag("http.response.body", content);
}

if (httpRequest.Headers.TryGetValue("uber-trace-id", out incomingTraceParent))
activity.SetParentId(incomingTraceParent);
public static void AspNetCoreEnricher(Activity activity, HttpRequest request)
{
if (request.Headers.TryGetValue("TraceId", out var incomingTraceParent))
activity.SetParentId(incomingTraceParent);

activity.SetTag("http.path", httpRequest.Path);
activity.SetTag("http.query", httpRequest.QueryString);
}
if (request.Headers.TryGetValue("uber-trace-id", out incomingTraceParent))
activity.SetParentId(incomingTraceParent);

activity.SetTag("http.path", request.Path);
activity.SetTag("http.query", request.QueryString);
}
}
}
2 changes: 1 addition & 1 deletion src/ConsoleClient/ConsoleClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<PackageReference Include="Flurl.Http" Version="4.0.2" />
<PackageReference Include="JsonFlatFileDataStore" Version="2.4.2" />
<PackageReference Include="Philosowaffle.Capability.ReleaseChecks" Version="2.0.0" />
<PackageReference Include="prometheus-net.DotNetRuntime" Version="4.4.0" />
<PackageReference Include="prometheus-net.DotNetRuntime" Version="4.4.1" />
<PackageReference Include="Serilog" Version="4.2.0" />
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
<PackageReference Include="Serilog.Enrichers.Span" Version="3.1.0" />
Expand Down
8 changes: 5 additions & 3 deletions src/SharedUI/Shared/AppSettingsForm.razor
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<HeaderTemplate>
<HxSwitch Text="Automatic Syncing" @bind-Value="appSettings.EnablePolling" Inline="true" />
<HxPopover Trigger="PopoverTrigger.Hover|PopoverTrigger.Click|PopoverTrigger.Focus"
Title="<b>Automatic Syncing</b>"
Content="@AutomaticSyncingDocumentation"
Html="true">
Title="<b>Automatic Syncing</b>"
Content="@AutomaticSyncingDocumentation"
Html="true">
<HxBadge Type="BadgeType.RoundedPill" Color="ThemeColor.Info">?</HxBadge>
</HxPopover>
</HeaderTemplate>
Expand Down Expand Up @@ -43,6 +43,8 @@
var settings = new SettingsGetResponse();
appSettings = settings.App;
garminSettings = settings.Garmin;

configDocumentation = string.Empty;
}

protected override Task OnInitializedAsync()
Expand Down
94 changes: 49 additions & 45 deletions src/SharedUI/Shared/FormatSettingsForm.razor
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
<HeaderTemplate>
Format Types
<HxPopover
Trigger="PopoverTrigger.Hover|PopoverTrigger.Click|PopoverTrigger.Focus"
Title="<b>Convert to various Format Types</b>"
Content="@FormatSettingsDocumentation"
Html="true">
Trigger="PopoverTrigger.Hover|PopoverTrigger.Click|PopoverTrigger.Focus"
Title="<b>Convert to various Format Types</b>"
Content="@FormatSettingsDocumentation"
Html="true">
<HxBadge Type="BadgeType.RoundedPill" Color="ThemeColor.Info">?</HxBadge>
</HxPopover>
</HeaderTemplate>
Expand All @@ -34,10 +34,10 @@
<HeaderTemplate>
Workout Title
<HxPopover
Trigger="PopoverTrigger.Hover|PopoverTrigger.Click|PopoverTrigger.Focus"
Title="<b>Workout Title Templating</b>"
Content="@WorkoutTitleDocumentation"
Html="true">
Trigger="PopoverTrigger.Hover|PopoverTrigger.Click|PopoverTrigger.Focus"
Title="<b>Workout Title Templating</b>"
Content="@WorkoutTitleDocumentation"
Html="true">
<HxBadge Type="BadgeType.RoundedPill" Color="ThemeColor.Info">?</HxBadge>
</HxPopover>
</HeaderTemplate>
Expand All @@ -54,35 +54,35 @@
<HeaderTemplate>
Lap Types
<HxPopover Trigger="PopoverTrigger.Hover|PopoverTrigger.Click|PopoverTrigger.Focus"
Title="<b>Customzing Lap Types</b>"
Content="@LapTypesDocumentation"
Html="true">
Title="<b>Customzing Lap Types</b>"
Content="@LapTypesDocumentation"
Html="true">
<HxBadge Type="BadgeType.RoundedPill" Color="ThemeColor.Info">?</HxBadge>
</HxPopover>
</HeaderTemplate>
<BodyTemplate>
<div class="row">
<div class="col-md-4">
<HxSelect Label="Cycling Lap Type"
Data="@lapTypes"
Nullable="false"
NullDataText="Loading info..."
@bind-Value="formatSettings.Cycling.PreferredLapType" />
</div>
<div class="col-md-4">
<HxSelect Label="Running Lap Type"
Data="@lapTypes"
Nullable="false"
NullDataText="Loading info..."
@bind-Value="formatSettings.Running.PreferredLapType" />
</div>
<div class="col-md-4">
<HxSelect Label="Rowing Lap Type"
Data="@lapTypes"
Nullable="false"
NullDataText="Loading info..."
@bind-Value="formatSettings.Rowing.PreferredLapType" />
</div>
<div class="col-md-4">
<HxSelect Label="Cycling Lap Type"
Data="@lapTypes"
Nullable="false"
NullDataText="Loading info..."
@bind-Value="formatSettings.Cycling.PreferredLapType" />
</div>
<div class="col-md-4">
<HxSelect Label="Running Lap Type"
Data="@lapTypes"
Nullable="false"
NullDataText="Loading info..."
@bind-Value="formatSettings.Running.PreferredLapType" />
</div>
<div class="col-md-4">
<HxSelect Label="Rowing Lap Type"
Data="@lapTypes"
Nullable="false"
NullDataText="Loading info..."
@bind-Value="formatSettings.Rowing.PreferredLapType" />
</div>
</div>
</BodyTemplate>
</HxCard>
Expand All @@ -95,9 +95,9 @@
<HeaderTemplate>
Strength
<HxPopover Trigger="PopoverTrigger.Hover|PopoverTrigger.Click|PopoverTrigger.Focus"
Title="<b>Strength Workouts</b>"
Content="@StrengthDocumentation"
Html="true">
Title="<b>Strength Workouts</b>"
Content="@StrengthDocumentation"
Html="true">
<HxBadge Type="BadgeType.RoundedPill" Color="ThemeColor.Info">?</HxBadge>
</HxPopover>
</HeaderTemplate>
Expand All @@ -110,7 +110,7 @@
<br />
<div class="row gy-5">
<div class="md-col-12">

<HxAccordion>
<HxAccordionItem>
<HeaderTemplate>
Expand All @@ -126,9 +126,9 @@
<HeaderTemplate>
Device Info Settings
<HxPopover Trigger="PopoverTrigger.Hover|PopoverTrigger.Click|PopoverTrigger.Focus"
Title="<b>Device Info Settings</b>"
Content="@CustomDeviceInfoDocumentation"
Html="true">
Title="<b>Device Info Settings</b>"
Content="@CustomDeviceInfoDocumentation"
Html="true">
<HxBadge Type="BadgeType.RoundedPill" Color="ThemeColor.Info">?</HxBadge>
</HxPopover>
</HeaderTemplate>
Expand All @@ -154,9 +154,9 @@
</CommandsTemplate>
<DataTemplate>
<HxGrid @ref="_gridComponent" TItem="KeyValuePair<WorkoutType, GarminDeviceInfo>"
DataProvider="DeviceInfo_GetGridData"
PageSize="100"
Responsive="true">
DataProvider="DeviceInfo_GetGridData"
PageSize="100"
Responsive="true">
<Columns>
<HxGridColumn HeaderText="Exercise Type" ItemTextSelector="d => d.Key.ToString()" />
<HxGridColumn HeaderText="Device Name" ItemTextSelector="d => d.Value.Name" />
Expand Down Expand Up @@ -185,9 +185,9 @@
<HeaderTemplate>
Custom Zone Handling
<HxPopover Trigger="PopoverTrigger.Hover|PopoverTrigger.Click|PopoverTrigger.Focus"
Title="<b>Custom Zone Handling</b>"
Content="@CustomZoneHandlingDocumentation"
Html="true">
Title="<b>Custom Zone Handling</b>"
Content="@CustomZoneHandlingDocumentation"
Html="true">
<HxBadge Type="BadgeType.RoundedPill" Color="ThemeColor.Info">?</HxBadge>
</HxPopover>
</HeaderTemplate>
Expand Down Expand Up @@ -232,7 +232,11 @@
formatSettings = settings.Format;

workoutTemplateExample = string.Empty;

configDocumentation = string.Empty;
configDocumentationBase = string.Empty;

outputDirectory = string.Empty;
}

protected override Task OnInitializedAsync()
Expand Down
2 changes: 2 additions & 0 deletions src/SharedUI/Shared/GarminSettingsForm.razor
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@
{
var settings = new SettingsGetResponse();
garminSettings = settings.Garmin;
configDocumentation = string.Empty;
configDocumentationBase = string.Empty;
}

protected override Task OnInitializedAsync()
Expand Down

0 comments on commit b9f54e7

Please sign in to comment.