Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clean up
  • Loading branch information
JamesNK committed Dec 17, 2025
commit 7a334b18651f6394d6824b7e693c2eafeaf0e2b1
18 changes: 0 additions & 18 deletions src/Aspire.Dashboard/Otlp/Model/Serialization/OtlpCommonJson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,50 +15,43 @@ internal sealed class OtlpAnyValueJson
/// String value.
/// </summary>
[JsonPropertyName("stringValue")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? StringValue { get; set; }

/// <summary>
/// Boolean value.
/// </summary>
[JsonPropertyName("boolValue")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? BoolValue { get; set; }

/// <summary>
/// Integer value. Serialized as string per protojson spec for int64.
/// </summary>
[JsonPropertyName("intValue")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonNumberHandling(JsonNumberHandling.WriteAsString | JsonNumberHandling.AllowReadingFromString)]
public long? IntValue { get; set; }

/// <summary>
/// Double value.
/// </summary>
[JsonPropertyName("doubleValue")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public double? DoubleValue { get; set; }

/// <summary>
/// Array value.
/// </summary>
[JsonPropertyName("arrayValue")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public OtlpArrayValueJson? ArrayValue { get; set; }

/// <summary>
/// Key-value list value.
/// </summary>
[JsonPropertyName("kvlistValue")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public OtlpKeyValueListJson? KvlistValue { get; set; }

/// <summary>
/// Bytes value. Serialized as base64 per protojson spec.
/// </summary>
[JsonPropertyName("bytesValue")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? BytesValue { get; set; }
}

Expand All @@ -71,7 +64,6 @@ internal sealed class OtlpArrayValueJson
/// Array of values.
/// </summary>
[JsonPropertyName("values")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public OtlpAnyValueJson[]? Values { get; set; }
}

Expand All @@ -84,7 +76,6 @@ internal sealed class OtlpKeyValueListJson
/// Collection of key/value pairs.
/// </summary>
[JsonPropertyName("values")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public OtlpKeyValueJson[]? Values { get; set; }
}

Expand All @@ -97,14 +88,12 @@ internal sealed class OtlpKeyValueJson
/// The key name of the pair.
/// </summary>
[JsonPropertyName("key")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Key { get; set; }

/// <summary>
/// The value of the pair.
/// </summary>
[JsonPropertyName("value")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public OtlpAnyValueJson? Value { get; set; }
}

Expand All @@ -117,21 +106,18 @@ internal sealed class OtlpInstrumentationScopeJson
/// A name denoting the instrumentation scope.
/// </summary>
[JsonPropertyName("name")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Name { get; set; }

/// <summary>
/// The version of the instrumentation scope.
/// </summary>
[JsonPropertyName("version")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Version { get; set; }

/// <summary>
/// Additional attributes that describe the scope.
/// </summary>
[JsonPropertyName("attributes")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public OtlpKeyValueJson[]? Attributes { get; set; }

/// <summary>
Expand All @@ -151,27 +137,23 @@ internal sealed class OtlpEntityRefJson
/// The Schema URL, if known.
/// </summary>
[JsonPropertyName("schemaUrl")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? SchemaUrl { get; set; }

/// <summary>
/// Defines the type of the entity.
/// </summary>
[JsonPropertyName("type")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Type { get; set; }

/// <summary>
/// Attribute keys that identify the entity.
/// </summary>
[JsonPropertyName("idKeys")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string[]? IdKeys { get; set; }

/// <summary>
/// Descriptive (non-identifying) attribute keys of the entity.
/// </summary>
[JsonPropertyName("descriptionKeys")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string[]? DescriptionKeys { get; set; }
}
20 changes: 0 additions & 20 deletions src/Aspire.Dashboard/Otlp/Model/Serialization/OtlpLogsJson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ internal sealed class OtlpLogsDataJson
/// An array of ResourceLogs.
/// </summary>
[JsonPropertyName("resourceLogs")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public OtlpResourceLogsJson[]? ResourceLogs { get; set; }
}

Expand All @@ -27,21 +26,18 @@ internal sealed class OtlpResourceLogsJson
/// The resource for the logs in this message.
/// </summary>
[JsonPropertyName("resource")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public OtlpResourceJson? Resource { get; set; }

/// <summary>
/// A list of ScopeLogs that originate from a resource.
/// </summary>
[JsonPropertyName("scopeLogs")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public OtlpScopeLogsJson[]? ScopeLogs { get; set; }

/// <summary>
/// The Schema URL, if known.
/// </summary>
[JsonPropertyName("schemaUrl")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? SchemaUrl { get; set; }
}

Expand All @@ -54,21 +50,18 @@ internal sealed class OtlpScopeLogsJson
/// The instrumentation scope information for the logs in this message.
/// </summary>
[JsonPropertyName("scope")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public OtlpInstrumentationScopeJson? Scope { get; set; }

/// <summary>
/// A list of log records.
/// </summary>
[JsonPropertyName("logRecords")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public OtlpLogRecordJson[]? LogRecords { get; set; }

/// <summary>
/// The Schema URL, if known.
/// </summary>
[JsonPropertyName("schemaUrl")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? SchemaUrl { get; set; }
}

Expand All @@ -81,44 +74,38 @@ internal sealed class OtlpLogRecordJson
/// Time when the event occurred. Serialized as string per protojson spec for fixed64.
/// </summary>
[JsonPropertyName("timeUnixNano")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonNumberHandling(JsonNumberHandling.WriteAsString | JsonNumberHandling.AllowReadingFromString)]
public ulong? TimeUnixNano { get; set; }

/// <summary>
/// Time when the event was observed. Serialized as string per protojson spec for fixed64.
/// </summary>
[JsonPropertyName("observedTimeUnixNano")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonNumberHandling(JsonNumberHandling.WriteAsString | JsonNumberHandling.AllowReadingFromString)]
public ulong? ObservedTimeUnixNano { get; set; }

/// <summary>
/// Numerical value of the severity. Serialized as integer per OTLP/JSON spec.
/// </summary>
[JsonPropertyName("severityNumber")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? SeverityNumber { get; set; }

/// <summary>
/// The severity text (also known as log level).
/// </summary>
[JsonPropertyName("severityText")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? SeverityText { get; set; }

/// <summary>
/// A value containing the body of the log record.
/// </summary>
[JsonPropertyName("body")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public OtlpAnyValueJson? Body { get; set; }

/// <summary>
/// Additional attributes that describe the specific event occurrence.
/// </summary>
[JsonPropertyName("attributes")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public OtlpKeyValueJson[]? Attributes { get; set; }

/// <summary>
Expand All @@ -132,28 +119,24 @@ internal sealed class OtlpLogRecordJson
/// Flags, a bit field (fixed32 per protobuf).
/// </summary>
[JsonPropertyName("flags")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public uint? Flags { get; set; }

/// <summary>
/// A unique identifier for a trace. Serialized as lowercase hex per OTLP/JSON spec.
/// </summary>
[JsonPropertyName("traceId")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? TraceId { get; set; }

/// <summary>
/// A unique identifier for a span within a trace. Serialized as lowercase hex per OTLP/JSON spec.
/// </summary>
[JsonPropertyName("spanId")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? SpanId { get; set; }

/// <summary>
/// A unique identifier of event category/type.
/// </summary>
[JsonPropertyName("eventName")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? EventName { get; set; }
}

Expand Down Expand Up @@ -247,7 +230,6 @@ internal sealed class OtlpExportLogsServiceRequestJson
/// An array of ResourceLogs.
/// </summary>
[JsonPropertyName("resourceLogs")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public OtlpResourceLogsJson[]? ResourceLogs { get; set; }
}

Expand All @@ -260,7 +242,6 @@ internal sealed class OtlpExportLogsServiceResponseJson
/// The details of a partially successful export request.
/// </summary>
[JsonPropertyName("partialSuccess")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public OtlpExportLogsPartialSuccessJson? PartialSuccess { get; set; }
}

Expand All @@ -281,6 +262,5 @@ internal sealed class OtlpExportLogsPartialSuccessJson
/// A developer-facing human-readable error message.
/// </summary>
[JsonPropertyName("errorMessage")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? ErrorMessage { get; set; }
}
Loading