| | | 1 | | namespace Elsa.Diagnostics.OpenTelemetry.Models; |
| | | 2 | | |
| | | 3 | | public enum OpenTelemetrySignalType |
| | | 4 | | { |
| | | 5 | | Trace, |
| | | 6 | | Metric, |
| | | 7 | | Log |
| | | 8 | | } |
| | | 9 | | |
| | | 10 | | public enum TelemetryResourceStatus |
| | | 11 | | { |
| | | 12 | | Unknown, |
| | | 13 | | Active, |
| | | 14 | | Stale |
| | | 15 | | } |
| | | 16 | | |
| | | 17 | | public enum SpanStatus |
| | | 18 | | { |
| | | 19 | | Unset, |
| | | 20 | | Ok, |
| | | 21 | | Error |
| | | 22 | | } |
| | | 23 | | |
| | | 24 | | public enum MetricKind |
| | | 25 | | { |
| | | 26 | | Gauge, |
| | | 27 | | Sum, |
| | | 28 | | Histogram |
| | | 29 | | } |
| | | 30 | | |
| | | 31 | | public record TelemetryResource( |
| | | 32 | | string Id, |
| | | 33 | | string ServiceName, |
| | | 34 | | string? ServiceInstanceId, |
| | | 35 | | string? TelemetrySdkLanguage, |
| | | 36 | | IDictionary<string, string?> Attributes, |
| | | 37 | | DateTimeOffset LastSeen, |
| | | 38 | | TelemetryResourceStatus Status); |
| | | 39 | | |
| | 6 | 40 | | public record TelemetrySpan( |
| | 0 | 41 | | string Id, |
| | 7 | 42 | | string TraceId, |
| | 12 | 43 | | string SpanId, |
| | 3 | 44 | | string? ParentSpanId, |
| | 4 | 45 | | string ResourceId, |
| | 6 | 46 | | string Name, |
| | 0 | 47 | | string Kind, |
| | 9 | 48 | | DateTimeOffset StartTime, |
| | 3 | 49 | | DateTimeOffset EndTime, |
| | 4 | 50 | | SpanStatus Status, |
| | 4 | 51 | | string? StatusDescription, |
| | 11 | 52 | | IDictionary<string, string?> Attributes, |
| | 4 | 53 | | IReadOnlyCollection<TelemetrySpanEvent> Events, |
| | 10 | 54 | | IReadOnlyCollection<TelemetrySpanLink> Links); |
| | | 55 | | |
| | | 56 | | public record TelemetrySpanEvent( |
| | | 57 | | string Name, |
| | | 58 | | DateTimeOffset Timestamp, |
| | | 59 | | IDictionary<string, string?> Attributes); |
| | | 60 | | |
| | | 61 | | public record TelemetrySpanLink( |
| | | 62 | | string TraceId, |
| | | 63 | | string SpanId, |
| | | 64 | | IDictionary<string, string?> Attributes); |
| | | 65 | | |
| | | 66 | | public record TelemetryTrace( |
| | | 67 | | string TraceId, |
| | | 68 | | string? RootSpanId, |
| | | 69 | | string? Name, |
| | | 70 | | DateTimeOffset StartTime, |
| | | 71 | | DateTimeOffset EndTime, |
| | | 72 | | TimeSpan Duration, |
| | | 73 | | SpanStatus Status, |
| | | 74 | | IReadOnlyCollection<string> ResourceIds, |
| | | 75 | | IReadOnlyCollection<string> WorkflowInstanceIds, |
| | | 76 | | int SpanCount); |
| | | 77 | | |
| | | 78 | | public record MetricInstrument( |
| | | 79 | | string Id, |
| | | 80 | | string ResourceId, |
| | | 81 | | string Name, |
| | | 82 | | string? Unit, |
| | | 83 | | string? Description, |
| | | 84 | | MetricKind Kind, |
| | | 85 | | IDictionary<string, string?> Attributes); |
| | | 86 | | |
| | | 87 | | public record MetricPoint( |
| | | 88 | | string Id, |
| | | 89 | | string InstrumentId, |
| | | 90 | | string InstrumentName, |
| | | 91 | | string ResourceId, |
| | | 92 | | DateTimeOffset Timestamp, |
| | | 93 | | double? Value, |
| | | 94 | | double? Sum, |
| | | 95 | | long? Count, |
| | | 96 | | IDictionary<string, string?> Attributes, |
| | | 97 | | string? TraceId, |
| | | 98 | | string? SpanId); |
| | | 99 | | |
| | | 100 | | public record OtlpLogRecord( |
| | | 101 | | string Id, |
| | | 102 | | string ResourceId, |
| | | 103 | | DateTimeOffset Timestamp, |
| | | 104 | | string SeverityText, |
| | | 105 | | int? SeverityNumber, |
| | | 106 | | string Body, |
| | | 107 | | string? TraceId, |
| | | 108 | | string? SpanId, |
| | | 109 | | IDictionary<string, string?> Attributes); |
| | | 110 | | |
| | | 111 | | public record OpenTelemetryDroppedItemSummary(OpenTelemetrySignalType SignalType, long Count, string Reason); |
| | | 112 | | |
| | | 113 | | public record OpenTelemetryStorageDiagnostics( |
| | | 114 | | int TraceCapacity, |
| | | 115 | | int SpanCapacity, |
| | | 116 | | int MetricPointCapacity, |
| | | 117 | | int LogRecordCapacity, |
| | | 118 | | int ResourceCount, |
| | | 119 | | int TraceCount, |
| | | 120 | | int SpanCount, |
| | | 121 | | int MetricInstrumentCount, |
| | | 122 | | int MetricPointCount, |
| | | 123 | | int LogRecordCount, |
| | | 124 | | long DroppedTraceCount, |
| | | 125 | | long DroppedSpanCount, |
| | | 126 | | long DroppedMetricPointCount, |
| | | 127 | | long DroppedLogRecordCount); |