Skip to content

Commit

Permalink
Additional logging and updated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
marcschier committed Apr 15, 2024
1 parent 20ccd91 commit 92b6b7c
Show file tree
Hide file tree
Showing 24 changed files with 182 additions and 60 deletions.
4 changes: 2 additions & 2 deletions common.props
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
<!--<TreatWarningsAsErrors>true</TreatWarningsAsErrors>-->
</PropertyGroup>
<ItemGroup Condition="$(NO_RCS) == ''">
<PackageReference Include="Roslynator.Analyzers" Version="4.11.0" PrivateAssets="All"/>
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.11.0" PrivateAssets="All"/>
<PackageReference Include="Roslynator.Analyzers" Version="4.12.0" PrivateAssets="All"/>
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.12.0" PrivateAssets="All"/>
</ItemGroup>
<!-- only create the SARIF files for the SDL build step in cloud builds -->
<PropertyGroup Condition="'$(NBGV_NugetPackageVersion)' != ''">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
<PackageReference Include="xunit" Version="2.7.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@
<PackageReference Include="Furly.Extensions.MessagePack" Version="1.0.37" />
<PackageReference Include="Furly.Tunnel" Version="1.0.37" />
<PackageReference Include="Mono.Options" Version="6.12.0.148" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.8.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.8.0" />
<PackageReference Include="OpenTelemetry.Exporter.Prometheus.AspNetCore" Version="1.7.0-rc.1" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.7.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.7.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.8.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.8.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.8.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.8.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Azure.IIoT.OpcUa.Publisher\src\Azure.IIoT.OpcUa.Publisher.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,15 @@ public CommandLine(string[] args, CommandLineLogger? logger = null)
{ "ln|lognotifications:",
"Log ingress subscription notifications at Informational level to aid debugging.\nDefault: `disabled`.\n",
(bool? b) => this[PublisherConfig.DebugLogNotificationsKey] = b?.ToString() ?? "True" },
{ "lnh|lognotificationsandheartbeats:",
"Include heartbeats in notifications log.\nIf set also implicitly enables debug logging via `--ln`.\nDefault: `disabled`.\n",
(bool? b) => this[PublisherConfig.DebugLogNotificationsWithHeartbeatKey] = b?.ToString() ?? "True" },
{ "lnf|lognotificationfilter:",
"Only log notifications where the data set field name, subscription name, or data set name match the provided regular expression pattern.\nIf set implicitly enables debug logging via `--ln`.\nDefault: `null` (matches all).\n",
(string? r) => this[PublisherConfig.DebugLogNotificationsFilterKey] = r },
{ "len|logencodednotifications:",
"Log encoded subscription and monitored item notifications at Informational level to aid debugging.\nDefault: `disabled`.\n",
(bool? b) => this[PublisherConfig.DebugLogEncodedNotificationsKey] = b?.ToString() ?? "True" },
{ $"oc|otlpcollector=|{Configuration.Otlp.OtlpCollectorEndpointKey}=",
"Specifiy the OpenTelemetry collector grpc endpoint url to export diagnostics to.\nDefault: `disabled`.\n",
s => this[Configuration.Otlp.OtlpCollectorEndpointKey] = s },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<ItemGroup>
<PackageReference Include="Json.More.Net" Version="2.0.1" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Moq" Version="[4.20.2]" />
<PackageReference Include="Divergic.Logging.Xunit" Version="4.3.0" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
<PackageReference Include="xunit" Version="2.7.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
<PackageReference Include="Furly.Azure.KeyVault" Version="1.0.37" />
<PackageReference Include="Microsoft.NET.Build.Containers" Version="8.0.202" />
<PackageReference Include="Microsoft.NET.Build.Containers" Version="8.0.204" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\src\Azure.IIoT.OpcUa.Publisher.Service.Sdk.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="8.0.3" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="8.0.3" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="8.0.3" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="8.0.4" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="8.0.4" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="8.0.4" />
<PackageReference Include="Furly.Extensions.MessagePack" Version="1.0.37" />
<PackageReference Include="Furly.Extensions.Newtonsoft" Version="1.0.37" />
<PackageReference Include="Furly.Extensions.Autofac" Version="1.0.37" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@
<ContainerPort Include="9080" Type="tcp" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.3" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="8.0.3" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="8.0.3" />
<PackageReference Include="Microsoft.Identity.Web" Version="2.17.2" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.4" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="8.0.4" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="8.0.4" />
<PackageReference Include="Microsoft.Identity.Web" Version="2.17.4" />
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="8.0.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.7.1" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.8.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.8.1" />
<PackageReference Include="OpenTelemetry.Exporter.Prometheus.AspNetCore" Version="1.7.0-rc.1" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.7.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.8.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.8.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.8.0" />
<PackageReference Include="Furly.Extensions.AspNetCore" Version="1.0.37" />
<PackageReference Include="Furly.Extensions.MessagePack" Version="1.0.37" />
<PackageReference Include="Furly.Azure.KeyVault" Version="1.0.37" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.4" />
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Divergic.Logging.Xunit" Version="4.3.0" />
<PackageReference Include="xRetry" Version="1.9.0" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
<PackageReference Include="xunit" Version="2.7.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Divergic.Logging.Xunit" Version="4.3.0" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
<PackageReference Include="xunit" Version="2.7.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@
<ItemGroup>
<PackageReference Include="Furly.Extensions" Version="1.0.37" />
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Server" Version="1.5.374.27" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Server" Version="1.5.374.36" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Moq" Version="[4.20.2]" />
<PackageReference Include="xunit.assert" Version="2.7.0" />
<PackageReference Include="xunit.assert" Version="2.7.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Azure.IIoT.OpcUa.Publisher\src\Azure.IIoT.OpcUa.Publisher.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<PackageReference Include="Nito.AsyncEx" Version="5.1.2" />
<PackageReference Include="Furly.Azure.IoT.Edge" Version="1.0.37" />
<PackageReference Include="Irony" Version="1.5.1" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client.ComplexTypes" Version="1.5.374.27" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client" Version="1.5.374.27" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client.ComplexTypes" Version="1.5.374.36" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client" Version="1.5.374.36" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Azure.IIoT.OpcUa\src\Azure.IIoT.OpcUa.csproj" />
Expand Down
15 changes: 15 additions & 0 deletions src/Azure.IIoT.OpcUa.Publisher/src/Runtime/PublisherConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ public sealed class PublisherConfig : PostConfigureOptionBase<PublisherOptions>
public const string RemoveDuplicatesFromBatchKey = "RemoveDuplicatesFromBatch";
public const string IoTHubMaxMessageSizeKey = "IoTHubMaxMessageSize";
public const string DebugLogNotificationsKey = "DebugLogNotifications";
public const string DebugLogEncodedNotificationsKey = "DebugLogEncodedNotifications";
public const string DebugLogNotificationsFilterKey = "DebugLogNotificationsFilter";
public const string DebugLogNotificationsWithHeartbeatKey = "DebugLogNotificationsWithHeartbeat";
public const string MaxNodesPerDataSetKey = "MaxNodesPerDataSet";
public const string ScaleTestCountKey = "ScaleTestCount";
public const string DisableOpenApiEndpointKey = "DisableOpenApiEndpoint";
Expand Down Expand Up @@ -291,13 +293,26 @@ public override void PostConfigure(string? name, PublisherOptions options)
{
options.DebugLogNotificationsFilter =
GetStringOrDefault(DebugLogNotificationsFilterKey);
options.DebugLogNotifications ??= (options.DebugLogNotificationsFilter != null);
}

if (options.DebugLogNotificationsWithHeartbeat == null)
{
options.DebugLogNotificationsWithHeartbeat =
GetBoolOrDefault(DebugLogNotificationsWithHeartbeatKey);
options.DebugLogNotifications ??= options.DebugLogNotifications;
}

if (options.DebugLogNotifications == null)
{
options.DebugLogNotifications = GetBoolOrDefault(DebugLogNotificationsKey);
}

if (options.DebugLogEncodedNotifications == null)
{
options.DebugLogEncodedNotifications = GetBoolOrDefault(DebugLogEncodedNotificationsKey);
}

if (options.DiagnosticsInterval == null)
{
options.DiagnosticsInterval = GetDurationOrNull(DiagnosticsIntervalKey) ??
Expand Down
10 changes: 10 additions & 0 deletions src/Azure.IIoT.OpcUa.Publisher/src/Runtime/PublisherOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,16 @@ public sealed class PublisherOptions
/// </summary>
public string? DebugLogNotificationsFilter { get; set; }

/// <summary>
/// Include heartbeats in ingess logs
/// </summary>
public bool? DebugLogNotificationsWithHeartbeat { get; set; }

/// <summary>
/// Log encoded notifications to informational log
/// </summary>
public bool? DebugLogEncodedNotifications { get; set; }

/// <summary>
/// Define the maximum number of messages in egress buffer,
/// Default: 4096 messages with 256KB ends up in 1 GB memory consumed.
Expand Down
Loading

0 comments on commit 92b6b7c

Please sign in to comment.