1 write to Tags
Microsoft.Extensions.Diagnostics.Testing (1)
Metrics\CollectedMeasurement.cs (1)
34
Tags
= d;
341 references to Tags
Aspire.Confluent.Kafka.Tests (60)
Aspire8MetricsTests.cs (60)
79
Assert.Contains(collectorProducerQueueMessageCount.LastMeasurement!.
Tags
, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
80
Assert.Contains(collectorProducerQueueMessageCount.LastMeasurement!.
Tags
, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
83
Assert.Contains(collectorConsumerQueueMessageCount.LastMeasurement!.
Tags
, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
84
Assert.Contains(collectorConsumerQueueMessageCount.LastMeasurement!.
Tags
, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
87
Assert.Contains(collectorProducerQueueSize.LastMeasurement!.
Tags
, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
88
Assert.Contains(collectorProducerQueueSize.LastMeasurement!.
Tags
, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
91
Assert.Contains(collectorNetworkTx.LastMeasurement!.
Tags
, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
92
Assert.Contains(collectorNetworkTx.LastMeasurement!.
Tags
, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
93
Assert.Contains(collectorNetworkTx.LastMeasurement!.
Tags
, t => t.Key == "type" && t.Value!.ToString() == "producer");
96
Assert.Contains(collectorNetworkTransmitted.LastMeasurement!.
Tags
, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
97
Assert.Contains(collectorNetworkTransmitted.LastMeasurement!.
Tags
, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
98
Assert.Contains(collectorNetworkTransmitted.LastMeasurement!.
Tags
, t => t.Key == "type" && t.Value!.ToString() == "producer");
101
Assert.Contains(collectorNetworkRx.LastMeasurement!.
Tags
, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
102
Assert.Contains(collectorNetworkRx.LastMeasurement!.
Tags
, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
103
Assert.Contains(collectorNetworkRx.LastMeasurement!.
Tags
, t => t.Key == "type" && t.Value!.ToString() == "producer");
106
Assert.Contains(collectorNetworkReceived.LastMeasurement!.
Tags
, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
107
Assert.Contains(collectorNetworkReceived.LastMeasurement!.
Tags
, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
108
Assert.Contains(collectorNetworkReceived.LastMeasurement!.
Tags
, t => t.Key == "type" && t.Value!.ToString() == "producer");
111
Assert.Contains(collectorMessageTx.LastMeasurement!.
Tags
, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
112
Assert.Contains(collectorMessageTx.LastMeasurement!.
Tags
, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
113
Assert.Contains(collectorMessageTx.LastMeasurement!.
Tags
, t => t.Key == "type" && t.Value!.ToString() == "producer");
116
Assert.Contains(collectorMessageTransmitted.LastMeasurement!.
Tags
, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
117
Assert.Contains(collectorMessageTransmitted.LastMeasurement!.
Tags
, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
118
Assert.Contains(collectorMessageTransmitted.LastMeasurement!.
Tags
, t => t.Key == "type" && t.Value!.ToString() == "producer");
121
Assert.Contains(collectorMessageRx.LastMeasurement!.
Tags
, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
122
Assert.Contains(collectorMessageRx.LastMeasurement!.
Tags
, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
123
Assert.Contains(collectorMessageRx.LastMeasurement!.
Tags
, t => t.Key == "type" && t.Value!.ToString() == "producer");
126
Assert.Contains(collectorMessageReceived.LastMeasurement!.
Tags
, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
127
Assert.Contains(collectorMessageReceived.LastMeasurement!.
Tags
, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
128
Assert.Contains(collectorMessageReceived.LastMeasurement!.
Tags
, t => t.Key == "type" && t.Value!.ToString() == "producer");
194
Assert.Contains(collectorProducerQueueMessageCount.LastMeasurement!.
Tags
, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
195
Assert.Contains(collectorProducerQueueMessageCount.LastMeasurement!.
Tags
, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
198
Assert.Contains(collectorConsumerQueueMessageCount.LastMeasurement!.
Tags
, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
199
Assert.Contains(collectorConsumerQueueMessageCount.LastMeasurement!.
Tags
, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
202
Assert.Contains(collectorProducerQueueSize.LastMeasurement!.
Tags
, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
203
Assert.Contains(collectorProducerQueueSize.LastMeasurement!.
Tags
, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
206
Assert.Contains(collectorNetworkTx.LastMeasurement!.
Tags
, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
207
Assert.Contains(collectorNetworkTx.LastMeasurement!.
Tags
, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
208
Assert.Contains(collectorNetworkTx.LastMeasurement!.
Tags
, t => t.Key == "type" && t.Value!.ToString() == "producer");
211
Assert.Contains(collectorNetworkTransmitted.LastMeasurement!.
Tags
, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
212
Assert.Contains(collectorNetworkTransmitted.LastMeasurement!.
Tags
, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
213
Assert.Contains(collectorNetworkTransmitted.LastMeasurement!.
Tags
, t => t.Key == "type" && t.Value!.ToString() == "producer");
216
Assert.Contains(collectorNetworkRx.LastMeasurement!.
Tags
, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
217
Assert.Contains(collectorNetworkRx.LastMeasurement!.
Tags
, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
218
Assert.Contains(collectorNetworkRx.LastMeasurement!.
Tags
, t => t.Key == "type" && t.Value!.ToString() == "producer");
221
Assert.Contains(collectorNetworkReceived.LastMeasurement!.
Tags
, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
222
Assert.Contains(collectorNetworkReceived.LastMeasurement!.
Tags
, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
223
Assert.Contains(collectorNetworkReceived.LastMeasurement!.
Tags
, t => t.Key == "type" && t.Value!.ToString() == "producer");
226
Assert.Contains(collectorMessageTx.LastMeasurement!.
Tags
, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
227
Assert.Contains(collectorMessageTx.LastMeasurement!.
Tags
, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
228
Assert.Contains(collectorMessageTx.LastMeasurement!.
Tags
, t => t.Key == "type" && t.Value!.ToString() == "producer");
231
Assert.Contains(collectorMessageTransmitted.LastMeasurement!.
Tags
, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
232
Assert.Contains(collectorMessageTransmitted.LastMeasurement!.
Tags
, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
233
Assert.Contains(collectorMessageTransmitted.LastMeasurement!.
Tags
, t => t.Key == "type" && t.Value!.ToString() == "producer");
236
Assert.Contains(collectorMessageRx.LastMeasurement!.
Tags
, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
237
Assert.Contains(collectorMessageRx.LastMeasurement!.
Tags
, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
238
Assert.Contains(collectorMessageRx.LastMeasurement!.
Tags
, t => t.Key == "type" && t.Value!.ToString() == "producer");
241
Assert.Contains(collectorMessageReceived.LastMeasurement!.
Tags
, t => t.Key == "messaging.client_id" && t.Value!.ToString() == "rdkafka");
242
Assert.Contains(collectorMessageReceived.LastMeasurement!.
Tags
, t => t.Key == "name" && t.Value!.ToString() == "rdkafka#producer-1");
243
Assert.Contains(collectorMessageReceived.LastMeasurement!.
Tags
, t => t.Key == "type" && t.Value!.ToString() == "producer");
InMemory.FunctionalTests (73)
BadHttpRequestTests.cs (7)
189
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.NoError(m.
Tags
));
253
m => MetricsAssert.Equal(ConnectionEndReason.InvalidRequestLine, m.
Tags
));
276
m => MetricsAssert.Equal(ConnectionEndReason.InvalidHttpVersion, m.
Tags
));
363
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(reason, m.
Tags
));
436
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.NoError(m.
Tags
));
505
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.NoError(m.
Tags
));
563
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.NoError(m.
Tags
));
ChunkedRequestTests.cs (1)
902
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.UnexpectedEndOfRequestContent, m.
Tags
));
ConnectionLimitTests.cs (1)
158
m.
Tags
.TryGetValue(KestrelMetrics.ErrorTypeAttributeName, out var value);
ConnectionMiddlewareTests.cs (1)
175
Assert.Equal(typeof(InvalidOperationException).FullName, m.
Tags
[KestrelMetrics.ErrorTypeAttributeName]);
Http2\TlsTests.cs (1)
80
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.InsufficientTlsVersion, m.
Tags
));
KeepAliveTimeoutTests.cs (6)
53
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.KeepAliveTimeout, m.
Tags
));
86
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.NoError(m.
Tags
));
131
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.NoError(m.
Tags
));
176
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.NoError(m.
Tags
));
201
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.KeepAliveTimeout, m.
Tags
));
244
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.NoError(m.
Tags
));
KestrelMetricsTests.cs (30)
97
Assert.Equal("value!", (string)m.
Tags
["custom"]);
385
Assert.Equal("value!", (string)m.
Tags
["custom"]);
386
Assert.False(m.
Tags
.ContainsKey("test"));
752
Assert.Equal("1.2", (string)m.
Tags
["tls.protocol.version"]);
753
Assert.DoesNotContain("error.type", m.
Tags
.Keys);
760
Assert.Equal("http", (string)measurement.
Tags
["network.protocol.name"]);
761
Assert.Equal(httpVersion, (string)measurement.
Tags
["network.protocol.version"]);
912
Assert.Equal(typeof(AuthenticationException).FullName, (string)m.
Tags
["error.type"]);
913
Assert.DoesNotContain("tls.protocol.version", m.
Tags
.Keys);
933
Assert.Equal(networkTransport, (string)measurement.
Tags
["network.transport"]);
934
Assert.Equal(localAddress, (string)measurement.
Tags
["server.address"]);
937
Assert.Equal(localPort, (int)measurement.
Tags
["server.port"]);
941
Assert.DoesNotContain("server.port", measurement.
Tags
.Keys);
945
Assert.Equal(networkType, (string)measurement.
Tags
["network.type"]);
949
Assert.DoesNotContain("network.type", measurement.
Tags
.Keys);
953
Assert.Equal("http", (string)measurement.
Tags
["network.protocol.name"]);
954
Assert.Equal(httpVersion, (string)measurement.
Tags
["network.protocol.version"]);
958
Assert.DoesNotContain("network.protocol.name", measurement.
Tags
.Keys);
959
Assert.DoesNotContain("network.protocol.version", measurement.
Tags
.Keys);
963
Assert.Equal(tlsProtocolVersion, (string)measurement.
Tags
["tls.protocol.version"]);
967
Assert.DoesNotContain("tls.protocol.version", measurement.
Tags
.Keys);
971
Assert.Equal(error, (string)measurement.
Tags
["error.type"]);
977
Assert.DoesNotContain("error.type", measurement.
Tags
.Keys);
981
throw new Exception($"Connection has unexpected error.type value: {measurement.
Tags
["error.type"]}", ex);
989
Assert.Equal(networkTransport, (string)measurement.
Tags
["network.transport"]);
990
Assert.Equal(localAddress, (string)measurement.
Tags
["server.address"]);
993
Assert.Equal(localPort, (int)measurement.
Tags
["server.port"]);
997
Assert.DoesNotContain("server.port", measurement.
Tags
.Keys);
1001
Assert.Equal(networkType, (string)measurement.
Tags
["network.type"]);
1005
Assert.DoesNotContain("network.type", measurement.
Tags
.Keys);
MaxRequestBodySizeTests.cs (2)
155
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.MaxRequestBodySizeExceeded, m.
Tags
));
409
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.MaxRequestBodySizeExceeded, m.
Tags
));
MaxRequestLineSizeTests.cs (2)
52
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.NoError(m.
Tags
));
80
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.InvalidRequestLine, m.
Tags
));
RequestBodyTimeoutTests.cs (3)
93
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.MinRequestBodyDataRate, m.
Tags
));
146
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.ServerTimeout, m.
Tags
));
220
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.MinRequestBodyDataRate, m.
Tags
));
RequestHeaderLimitsTests.cs (4)
50
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.NoError(m.
Tags
));
87
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.NoError(m.
Tags
));
115
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.MaxRequestHeadersTotalSizeExceeded, m.
Tags
));
144
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.MaxRequestHeaderCountExceeded, m.
Tags
));
RequestHeadersTimeoutTests.cs (4)
49
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.RequestHeadersTimeout, m.
Tags
));
85
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.NoError(m.
Tags
));
114
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.RequestHeadersTimeout, m.
Tags
));
148
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.RequestHeadersTimeout, m.
Tags
));
RequestTests.cs (2)
1229
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.UnexpectedEndOfRequestContent, m.
Tags
));
2282
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.TlsNotSupported, m.
Tags
));
ResponseTests.cs (9)
210
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.WriteCanceled, m.
Tags
));
708
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.NoError(m.
Tags
));
988
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.ResponseContentLengthMismatch, m.
Tags
));
1026
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.ResponseContentLengthMismatch, m.
Tags
));
2466
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.NoError(m.
Tags
));
2668
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.NoError(m.
Tags
));
2713
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.ErrorAfterStartingResponse, m.
Tags
));
2758
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.ErrorAfterStartingResponse, m.
Tags
));
2841
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.AbortedByApp, m.
Tags
));
Interop.FunctionalTests (14)
Http2\Http2RequestTests.cs (7)
145
Assert.Equal("http", (string)m.
Tags
["network.protocol.name"]);
146
Assert.Equal("2", (string)m.
Tags
["network.protocol.version"]);
147
Assert.Equal("tcp", (string)m.
Tags
["network.transport"]);
148
Assert.Equal("ipv6", (string)m.
Tags
["network.type"]);
149
Assert.Equal("::1", (string)m.
Tags
["server.address"]);
150
Assert.Equal(host.GetPort(), (int)m.
Tags
["server.port"]);
151
Assert.Equal("1.2", (string)m.
Tags
["tls.protocol.version"]);
Http3\Http3RequestTests.cs (7)
106
Assert.Equal("ipv4", (string)m.
Tags
["network.type"]);
107
Assert.Equal("http", (string)m.
Tags
["network.protocol.name"]);
108
Assert.Equal("3", (string)m.
Tags
["network.protocol.version"]);
109
Assert.Equal("udp", (string)m.
Tags
["network.transport"]);
110
Assert.Equal("127.0.0.1", (string)m.
Tags
["server.address"]);
111
Assert.Equal(host.GetPort(), (int)m.
Tags
["server.port"]);
112
Assert.Equal("1.3", (string)m.
Tags
["tls.protocol.version"]);
Microsoft.AspNetCore.Authentication.Test (24)
AuthenticationMetricsTest.cs (24)
38
Assert.Equal("custom", (string)measurement.
Tags
["aspnetcore.authentication.scheme"]);
39
Assert.Equal("success", (string)measurement.
Tags
["aspnetcore.authentication.result"]);
40
Assert.False(measurement.
Tags
.ContainsKey("error.type"));
66
Assert.Equal("custom", (string)measurement.
Tags
["aspnetcore.authentication.scheme"]);
67
Assert.Equal("failure", (string)measurement.
Tags
["aspnetcore.authentication.result"]);
68
Assert.Equal("Microsoft.AspNetCore.Authentication.AuthenticationFailureException", (string)measurement.
Tags
["error.type"]);
94
Assert.Equal("custom", (string)measurement.
Tags
["aspnetcore.authentication.scheme"]);
95
Assert.Equal("none", (string)measurement.
Tags
["aspnetcore.authentication.result"]);
96
Assert.False(measurement.
Tags
.ContainsKey("error.type"));
123
Assert.Equal("custom", (string)measurement.
Tags
["aspnetcore.authentication.scheme"]);
124
Assert.Equal("System.InvalidOperationException", (string)measurement.
Tags
["error.type"]);
125
Assert.False(measurement.
Tags
.ContainsKey("aspnetcore.authentication.result"));
148
Assert.Equal("custom", (string)measurement.
Tags
["aspnetcore.authentication.scheme"]);
175
Assert.Equal("custom", (string)measurement.
Tags
["aspnetcore.authentication.scheme"]);
176
Assert.Equal("System.InvalidOperationException", (string)measurement.
Tags
["error.type"]);
199
Assert.Equal("custom", (string)measurement.
Tags
["aspnetcore.authentication.scheme"]);
226
Assert.Equal("custom", (string)measurement.
Tags
["aspnetcore.authentication.scheme"]);
227
Assert.Equal("System.InvalidOperationException", (string)measurement.
Tags
["error.type"]);
250
Assert.Equal("custom", (string)measurement.
Tags
["aspnetcore.authentication.scheme"]);
277
Assert.Equal("custom", (string)measurement.
Tags
["aspnetcore.authentication.scheme"]);
278
Assert.Equal("System.InvalidOperationException", (string)measurement.
Tags
["error.type"]);
301
Assert.Equal("custom", (string)measurement.
Tags
["aspnetcore.authentication.scheme"]);
328
Assert.Equal("custom", (string)measurement.
Tags
["aspnetcore.authentication.scheme"]);
329
Assert.Equal("System.InvalidOperationException", (string)measurement.
Tags
["error.type"]);
Microsoft.AspNetCore.Authorization.Test (20)
AuthorizationMetricsTest.cs (20)
33
Assert.Equal("Basic", (string)measurement.
Tags
["aspnetcore.authorization.policy"]);
34
Assert.Equal("success", (string)measurement.
Tags
["aspnetcore.authorization.result"]);
35
Assert.True((bool)measurement.
Tags
["user.is_authenticated"]);
58
Assert.Equal("Basic", (string)measurement.
Tags
["aspnetcore.authorization.policy"]);
59
Assert.Equal("failure", (string)measurement.
Tags
["aspnetcore.authorization.result"]);
60
Assert.False((bool)measurement.
Tags
["user.is_authenticated"]);
83
Assert.Equal("UnknownPolicy", (string)measurement.
Tags
["aspnetcore.authorization.policy"]);
84
Assert.Equal("System.InvalidOperationException", (string)measurement.
Tags
["error.type"]);
85
Assert.False((bool)measurement.
Tags
["user.is_authenticated"]);
86
Assert.False(measurement.
Tags
.ContainsKey("aspnetcore.authorization.result"));
112
Assert.Equal("success", (string)measurement.
Tags
["aspnetcore.authorization.result"]);
113
Assert.False((bool)measurement.
Tags
["user.is_authenticated"]);
114
Assert.False(measurement.
Tags
.ContainsKey("aspnetcore.authorization.policy"));
137
Assert.Equal("failure", (string)measurement.
Tags
["aspnetcore.authorization.result"]);
138
Assert.False((bool)measurement.
Tags
["user.is_authenticated"]);
139
Assert.False(measurement.
Tags
.ContainsKey("aspnetcore.authorization.policy"));
166
Assert.Equal("System.InvalidOperationException", (string)measurement.
Tags
["error.type"]);
167
Assert.False((bool)measurement.
Tags
["user.is_authenticated"]);
168
Assert.False(measurement.
Tags
.ContainsKey("aspnetcore.authorization.policy"));
169
Assert.False(measurement.
Tags
.ContainsKey("aspnetcore.authorization.result"));
Microsoft.AspNetCore.Diagnostics.Tests (22)
DeveloperExceptionPageMiddlewareTest.cs (6)
617
Assert.Equal(500, (int)m.
Tags
["http.response.status_code"]);
618
Assert.Equal("System.Exception", (string)m.
Tags
["error.type"]);
627
Assert.Equal(exceptionName, (string)measurement.
Tags
["error.type"]);
628
Assert.Equal(result, measurement.
Tags
["aspnetcore.diagnostics.exception.result"].ToString());
631
Assert.False(measurement.
Tags
.ContainsKey("aspnetcore.diagnostics.handler.type"));
635
Assert.Equal(handler, (string)measurement.
Tags
["aspnetcore.diagnostics.handler.type"]);
ExceptionHandlerMiddlewareTest.cs (10)
349
Assert.Equal(500, (int)m.
Tags
["http.response.status_code"]);
350
Assert.Equal("System.Exception", (string)m.
Tags
["error.type"]);
351
Assert.Equal("/path", (string)m.
Tags
["http.route"]);
416
Assert.Equal(500, (int)m.
Tags
["http.response.status_code"]);
417
Assert.Equal("System.Exception", (string)m.
Tags
["error.type"]);
418
Assert.Equal("/new", (string)m.
Tags
["http.route"]);
451
Assert.Equal(exceptionName, (string)measurement.
Tags
["error.type"]);
452
Assert.Equal(result, measurement.
Tags
["aspnetcore.diagnostics.exception.result"].ToString());
455
Assert.False(measurement.
Tags
.ContainsKey("aspnetcore.diagnostics.handler.type"));
459
Assert.Equal(handler, (string)measurement.
Tags
["aspnetcore.diagnostics.handler.type"]);
ExceptionHandlerTest.cs (6)
1039
Assert.Equal(404, (int)m.
Tags
["http.response.status_code"]);
1040
Assert.Equal("System.Exception", (string)m.
Tags
["error.type"]);
1109
Assert.Equal(500, (int)m.
Tags
["http.response.status_code"]);
1110
Assert.Equal("System.Exception", (string)m.
Tags
["error.type"]);
1171
Assert.Equal(404, (int)m.
Tags
["http.response.status_code"]);
1172
Assert.Equal("System.Exception", (string)m.
Tags
["error.type"]);
Microsoft.AspNetCore.HeaderParsing.Tests (4)
HeaderParsingFeatureTests.cs (4)
153
latest.
Tags
["aspnetcore.header_parsing.header.name"].Should().Be("Date");
154
latest.
Tags
["error.type"].Should().Be("Unable to parse date time offset value.");
211
latest.
Tags
["aspnetcore.header_parsing.header.name"].Should().Be(HeaderNames.CacheControl);
212
latest.
Tags
["aspnetcore.header_parsing.cache_access.type"].Should().Be("Hit");
Microsoft.AspNetCore.Hosting.Tests (31)
HostingApplicationDiagnosticsTests.cs (25)
264
Assert.Equal("http", m.
Tags
["url.scheme"]);
265
Assert.Equal("POST", m.
Tags
["http.request.method"]);
280
Assert.Equal("http", m.
Tags
["url.scheme"]);
281
Assert.Equal("POST", m.
Tags
["http.request.method"]);
286
Assert.Equal("http", m.
Tags
["url.scheme"]);
287
Assert.Equal("POST", m.
Tags
["http.request.method"]);
323
Assert.Equal("http", m.
Tags
["url.scheme"]);
324
Assert.Equal("POST", m.
Tags
["http.request.method"]);
339
Assert.Equal("http", m.
Tags
["url.scheme"]);
340
Assert.Equal("POST", m.
Tags
["http.request.method"]);
345
Assert.Equal("http", m.
Tags
["url.scheme"]);
346
Assert.Equal("POST", m.
Tags
["http.request.method"]);
352
Assert.Equal("hello/{name}", m.
Tags
["http.route"]);
383
Assert.Equal("http", m.
Tags
["url.scheme"]);
384
Assert.Equal("POST", m.
Tags
["http.request.method"]);
399
Assert.Equal("http", m.
Tags
["url.scheme"]);
400
Assert.Equal("POST", m.
Tags
["http.request.method"]);
405
Assert.Equal("http", m.
Tags
["url.scheme"]);
406
Assert.Equal("POST", m.
Tags
["http.request.method"]);
438
Assert.Equal("http", m.
Tags
["url.scheme"]);
439
Assert.Equal("POST", m.
Tags
["http.request.method"]);
454
Assert.Equal("http", m.
Tags
["url.scheme"]);
455
Assert.Equal("POST", m.
Tags
["http.request.method"]);
460
Assert.Equal("http", m.
Tags
["url.scheme"]);
461
Assert.Equal("POST", m.
Tags
["http.request.method"]);
HostingMetricsTests.cs (6)
95
Assert.Equal(httpVersion, (string)measurement.
Tags
["network.protocol.version"]);
96
Assert.Equal(statusCode, (int)measurement.
Tags
["http.response.status_code"]);
99
Assert.False(measurement.
Tags
.ContainsKey("error.type"));
103
Assert.Equal(exceptionName, (string)measurement.
Tags
["error.type"]);
107
Assert.True((bool)measurement.
Tags
["aspnetcore.request.is_unhandled"]);
111
Assert.False(measurement.
Tags
.ContainsKey("aspnetcore.request.is_unhandled"));
Microsoft.AspNetCore.Http.Connections.Tests (3)
HttpConnectionDispatcherTests.cs (3)
1169
Assert.Equal(transportType.ToString(), (string)measurement.
Tags
["signalr.transport"]);
1175
Assert.Equal(status.ToString(), (string)measurement.
Tags
["signalr.connection.status"]);
1176
Assert.Equal(transportType.ToString(), (string)measurement.
Tags
["signalr.transport"]);
Microsoft.AspNetCore.RateLimiting.Tests (5)
RateLimitingMetricsTests.cs (5)
58
Assert.Equal("global_limiter", (string)m.
Tags
["aspnetcore.rate_limiting.result"]);
117
Assert.Equal("acquired", (string)m.
Tags
["aspnetcore.rate_limiting.result"]);
238
Assert.Equal("acquired", (string)m.
Tags
["aspnetcore.rate_limiting.result"]);
314
AssertTag(measurement.
Tags
, "aspnetcore.rate_limiting.policy", policy);
320
AssertTag(measurement.
Tags
, "aspnetcore.rate_limiting.policy", policy);
Microsoft.AspNetCore.Routing.Tests (4)
RoutingMetricsTests.cs (4)
139
Assert.Equal("failure", (string)measurement.
Tags
["aspnetcore.routing.match_status"]);
145
Assert.Equal("success", (string)measurement.
Tags
["aspnetcore.routing.match_status"]);
146
Assert.Equal(route, (string)measurement.
Tags
["http.route"]);
147
Assert.Equal(fallback, (bool)measurement.
Tags
["aspnetcore.routing.is_fallback"]);
Microsoft.Extensions.Diagnostics.HealthChecks.Common.Tests (3)
TelemetryHealthChecksPublisherTests.cs (3)
114
latest.
Tags
.Should().ContainKey("dotnet.health_check.status").WhoseValue.Should().Be(expectedMetricStatus);
142
if (counter!.
Tags
["dotnet.health_check.name"]?.ToString() == healthy &&
143
counter!.
Tags
["dotnet.health_check.status"]?.ToString() == status)
Microsoft.Extensions.Diagnostics.Testing (4)
Metrics\CollectedMeasurement.cs (4)
63
if (!
Tags
.TryGetValue(kvp.Key, out var value))
86
if (!
Tags
.ContainsKey(key))
100
public bool MatchesTags(params KeyValuePair<string, object?>[] tags) => ContainsTags(tags) && (
Tags
.Count == tags.Length);
107
public bool MatchesTags(params string[] tags) => ContainsTags(Throw.IfNull(tags)) && (
Tags
.Count == tags.Length);
Microsoft.Extensions.Diagnostics.Testing.Tests (23)
Metrics\MeasurementExtensionsTests.cs (12)
31
Assert.Equal(2, filtered[1].
Tags
.Count);
32
Assert.True(filtered[1].
Tags
.ContainsKey("A"));
33
Assert.True(filtered[1].
Tags
.ContainsKey("B"));
56
Assert.Equal(2, filtered[1].
Tags
.Count);
57
Assert.True(filtered[1].
Tags
.ContainsKey("A"));
58
Assert.True(filtered[1].
Tags
.ContainsKey("B"));
81
Assert.Equal(2, filtered[1].
Tags
.Count);
82
Assert.True(filtered[1].
Tags
.ContainsKey("A"));
83
Assert.True(filtered[1].
Tags
.ContainsKey("B"));
109
Assert.Equal(2, filtered[1].
Tags
.Count);
110
Assert.True(filtered[1].
Tags
.ContainsKey("A"));
111
Assert.True(filtered[1].
Tags
.ContainsKey("B"));
Metrics\MetricCollectorTests.cs (11)
66
Assert.Empty(collector.LastMeasurement.
Tags
);
76
Assert.Empty(collector.LastMeasurement.
Tags
);
111
Assert.Empty(collector.LastMeasurement.
Tags
);
121
Assert.Empty(collector.LastMeasurement.
Tags
);
158
Assert.Empty(collector.LastMeasurement.
Tags
);
168
Assert.Empty(collector.LastMeasurement.
Tags
);
219
Assert.Empty(collector.LastMeasurement.
Tags
);
229
Assert.Empty(collector.LastMeasurement.
Tags
);
403
Assert.Empty(snap[0].
Tags
);
407
Assert.Empty(snap[1].
Tags
);
411
Assert.Empty(snap[2].
Tags
);
Microsoft.Gen.Metrics.Generated.Tests (44)
MetricTests.cs (30)
57
Assert.All(measurements, x => Assert.Empty(x.
Tags
));
71
Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val2") }, measurement.
Tags
.Select(x => (x.Key, x.Value)));
84
Assert.All(measurements, x => Assert.Empty(x.
Tags
));
98
var tag = Assert.Single(measurement.
Tags
);
112
Assert.All(measurements, x => Assert.Empty(x.
Tags
));
126
var tag = Assert.Single(measurement.
Tags
);
140
Assert.All(measurements, x => Assert.Empty(x.
Tags
));
154
Assert.Equal(new (string, object?)[] { ("s1", "val_1"), ("s2", "val_2") }, measurement.
Tags
.Select(x => (x.Key, x.Value)));
174
var tags = measurements[0].
Tags
.Select(x => (x.Key, x.Value));
177
tags = measurements[1].
Tags
.Select(x => (x.Key, x.Value));
198
var tags = measurements[0].
Tags
.Select(x => (x.Key, x.Value));
201
tags = measurements[1].
Tags
.Select(x => (x.Key, x.Value));
253
Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val2") }, measurement.
Tags
.Select(x => (x.Key, x.Value)));
259
Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val2") }, measurement.
Tags
.Select(x => (x.Key, x.Value)));
266
Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val4") }, measurement.
Tags
.Select(x => (x.Key, x.Value)));
278
Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val2") }, measurement.
Tags
.Select(x => (x.Key, x.Value)));
284
Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val2") }, measurement.
Tags
.Select(x => (x.Key, x.Value)));
291
Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val4") }, measurement.
Tags
.Select(x => (x.Key, x.Value)));
303
Assert.Empty(measurement.
Tags
);
316
Assert.Empty(measurement.
Tags
);
329
Assert.Equal(new (string, object?)[] { ("Dim1", "val1"), ("Dim_2", "val2"), ("Dim_3", "val3") }, measurement.
Tags
.Select(x => (x.Key, x.Value)));
342
Assert.Equal(new (string, object?)[] { ("Dim1", "val1"), ("Dim_2", "val2"), ("Dim_3", "val3") }, measurement.
Tags
.Select(x => (x.Key, x.Value)));
372
measurement.
Tags
.Select(x => (x.Key, x.Value)));
421
measurement.
Tags
.Select(x => (x.Key, x.Value)));
444
measurement.
Tags
.Select(x => (x.Key, x.Value)));
467
measurement.
Tags
.Select(x => (x.Key, x.Value)));
515
measurement.
Tags
.Select(x => (x.Key, x.Value)));
564
measurement.
Tags
.Select(x => (x.Key, x.Value)));
587
measurement.
Tags
.Select(x => (x.Key, x.Value)));
609
measurement.
Tags
.Select(x => (x.Key, x.Value)));
MetricTests.Ext.cs (14)
43
Assert.All(measurements, x => Assert.Empty(x.
Tags
));
55
Assert.Equal(new (string, object?)[] { ("s1", "val1"), ("s2", "val2") }, measurement.
Tags
.Select(x => (x.Key, x.Value)));
68
Assert.All(measurements, x => Assert.Empty(x.
Tags
));
81
var tag = Assert.Single(measurement.
Tags
);
95
Assert.All(measurements, x => Assert.Empty(x.
Tags
));
108
var tag = Assert.Single(measurement.
Tags
);
122
Assert.All(measurements, x => Assert.Empty(x.
Tags
));
135
Assert.Equal(new (string, object?)[] { ("s1", "val_1"), ("s2", "val_2") }, measurement.
Tags
.Select(x => (x.Key, x.Value)));
184
measurement.
Tags
.Select(x => (x.Key, x.Value)));
206
measurement.
Tags
.Select(x => (x.Key, x.Value)));
228
measurement.
Tags
.Select(x => (x.Key, x.Value)));
277
measurement.
Tags
.Select(x => (x.Key, x.Value)));
299
measurement.
Tags
.Select(x => (x.Key, x.Value)));
321
measurement.
Tags
.Select(x => (x.Key, x.Value)));
Sockets.FunctionalTests (7)
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (2)
627
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.NoError(m.
Tags
));
727
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.AbortedByApp, m.
Tags
));
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (5)
256
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.NoError(m.
Tags
));
463
MetricsAssert.NoError(measurement.
Tags
);
600
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.MinResponseDataRate, m.
Tags
));
848
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.Equal(ConnectionEndReason.MinResponseDataRate, m.
Tags
));
1089
Assert.Collection(connectionDuration.GetMeasurementSnapshot(), m => MetricsAssert.NoError(m.
Tags
));