From 55a033d9fb5538437ae47c0673a010a9e110d2c9 Mon Sep 17 00:00:00 2001 From: Liam McLennan Date: Wed, 24 Jan 2024 15:54:22 +1000 Subject: [PATCH 1/2] merge 2024.1 changes from seq --- .../Model/Diagnostics/ClusterMetricsPart.cs | 35 +++++++++++++++++++ src/Seq.Api/Model/Events/EventEntity.cs | 29 ++++++++++++++- src/Seq.Api/Model/Settings/SettingName.cs | 5 +++ .../DiagnosticsResourceGroup.cs | 20 +++++++++++ src/Seq.Api/Seq.Api.csproj | 4 +-- 5 files changed, 90 insertions(+), 3 deletions(-) create mode 100644 src/Seq.Api/Model/Diagnostics/ClusterMetricsPart.cs diff --git a/src/Seq.Api/Model/Diagnostics/ClusterMetricsPart.cs b/src/Seq.Api/Model/Diagnostics/ClusterMetricsPart.cs new file mode 100644 index 0000000..2b6c851 --- /dev/null +++ b/src/Seq.Api/Model/Diagnostics/ClusterMetricsPart.cs @@ -0,0 +1,35 @@ +namespace Seq.Api.Model.Diagnostics +{ + /// + /// Metrics related to cluster activity. + /// + public class ClusterMetricsPart + { + /// + /// Construct a . + /// + public ClusterMetricsPart() + { + } + + /// + /// A connection to the leader node was accepted. + /// + public ulong ConnectionAccepted { get; set; } + + /// + /// A connection to the leader node was rejected due to an invalid authentication key. + /// + public ulong ConnectionInvalidKey { get; set; } + + /// + /// A connection to the leader node was successfully authenticated and established. + /// + public ulong ConnectionEstablished { get; set; } + + /// + /// A connection to the leader node was could not be established. + /// + public ulong ConnectionNotEstablished { get; set; } + } +} \ No newline at end of file diff --git a/src/Seq.Api/Model/Events/EventEntity.cs b/src/Seq.Api/Model/Events/EventEntity.cs index fa58cca..a0a2235 100644 --- a/src/Seq.Api/Model/Events/EventEntity.cs +++ b/src/Seq.Api/Model/Events/EventEntity.cs @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +using System; using System.Collections.Generic; using Newtonsoft.Json; using Seq.Api.Model.Shared; @@ -30,6 +31,12 @@ public class EventEntity : Entity /// public string Timestamp { get; set; } + /// + /// If the event represents a span, the ISO-8601 timestamp at which the span started. + /// + [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] + public string Start { get; set; } + /// /// Properties associated with the event. /// @@ -75,11 +82,31 @@ public class EventEntity : Entity [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public string SpanId { get; set; } + /// + /// The id of the event's parent span, if any. + /// + [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] + public string ParentId { get; set; } + /// /// A collection of properties describing the origin of the event, if any. These correspond to resource - /// attributes in the OpenTelemetry spec. + /// attributes in the OpenTelemetry protocol. /// [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public List Resource { get; set; } + + /// + /// A collection of properties describing the instrumentation that produced an event, if any. These correspond + /// to instrumentation scope attributes in the OpenTelemetry protocol, and may include the OpenTelemetry scope name + /// in a well-known name property. + /// + [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] + public List Scope { get; set; } + + /// + /// If the event is a span, the elapsed time between the start and end of the span. + /// + [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] + public TimeSpan? Elapsed { get; set; } } } diff --git a/src/Seq.Api/Model/Settings/SettingName.cs b/src/Seq.Api/Model/Settings/SettingName.cs index 2cf48dd..3cae193 100644 --- a/src/Seq.Api/Model/Settings/SettingName.cs +++ b/src/Seq.Api/Model/Settings/SettingName.cs @@ -165,6 +165,11 @@ public enum SettingName /// list. For example, openid, profile, email. /// OpenIdConnectScopes, + + /// + /// If using OpenID Connect, overrides the URI of the provider's metadata endpoint. + /// + OpenIdConnectMetadataAddress, /// /// If true, ingestion requests incoming via HTTP must be authenticated using an API key or diff --git a/src/Seq.Api/ResourceGroups/DiagnosticsResourceGroup.cs b/src/Seq.Api/ResourceGroups/DiagnosticsResourceGroup.cs index 0566efe..d1616b9 100644 --- a/src/Seq.Api/ResourceGroups/DiagnosticsResourceGroup.cs +++ b/src/Seq.Api/ResourceGroups/DiagnosticsResourceGroup.cs @@ -101,5 +101,25 @@ public async Task GetStorageConsumptionAsync( }; return await GroupGetAsync("Storage", parameters, cancellationToken); } + + /// + /// Retrieve the cluster log. + /// + /// A allowing the operation to be canceled. + /// The cluster log. + public async Task GetClusterLogAsync(CancellationToken cancellationToken = default) + { + return await GroupGetStringAsync("ClusterLog", cancellationToken: cancellationToken); + } + + /// + /// Retrieve metrics about cluster connections. + /// + /// A allowing the operation to be canceled. + /// A set of metrics relating to cluster network activity. + public async Task GetClusterMetricsAsync(CancellationToken cancellationToken = default) + { + return await GroupGetAsync("ClusterMetrics", cancellationToken: cancellationToken); + } } } diff --git a/src/Seq.Api/Seq.Api.csproj b/src/Seq.Api/Seq.Api.csproj index 44227ef..033ae26 100644 --- a/src/Seq.Api/Seq.Api.csproj +++ b/src/Seq.Api/Seq.Api.csproj @@ -1,7 +1,7 @@ Client library for the Seq HTTP API. - 2023.4.0 + 2024.1.0 Datalust;Contributors netstandard2.0;net6.0 true @@ -24,7 +24,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive From 1e6e7b62528de8d44c1c8419565e3a4c07c4890f Mon Sep 17 00:00:00 2001 From: Liam McLennan Date: Wed, 24 Jan 2024 18:25:25 +1000 Subject: [PATCH 2/2] Fix bad merge --- src/Seq.Api/Model/Settings/SettingName.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Seq.Api/Model/Settings/SettingName.cs b/src/Seq.Api/Model/Settings/SettingName.cs index a96d53f..9947669 100644 --- a/src/Seq.Api/Model/Settings/SettingName.cs +++ b/src/Seq.Api/Model/Settings/SettingName.cs @@ -166,11 +166,6 @@ public enum SettingName /// OpenIdConnectScopes, - /// - /// If using OpenID Connect, overrides the URI of the provider's metadata endpoint. - /// - OpenIdConnectMetadataAddress, - /// /// If using OpenID Connect, overrides the URI of the provider's metadata endpoint. ///