@@ -38,6 +38,8 @@ def test_good_route(client: Client, exporter: TestExporter, metrics_reader: InMe
3838 'http.server_name' : 'testserver' ,
3939 'http.scheme' : 'http' ,
4040 'http.flavor' : '1.1' ,
41+ 'http.request.method' : 'GET' ,
42+ 'url.scheme' : 'http' ,
4143 },
4244 'start_time_unix_nano' : IsInt (),
4345 'time_unix_nano' : IsInt (),
@@ -79,6 +81,36 @@ def test_good_route(client: Client, exporter: TestExporter, metrics_reader: InMe
7981 'aggregation_temporality' : 1 ,
8082 },
8183 },
84+ {
85+ 'name' : 'http.server.request.duration' ,
86+ 'description' : 'Duration of HTTP server requests.' ,
87+ 'unit' : 's' ,
88+ 'data' : {
89+ 'data_points' : [
90+ {
91+ 'attributes' : {
92+ 'http.request.method' : 'GET' ,
93+ 'url.scheme' : 'http' ,
94+ 'network.protocol.version' : '1.1' ,
95+ 'http.route' : 'django_test_app/<int:item_id>/' ,
96+ 'http.response.status_code' : 200 ,
97+ },
98+ 'start_time_unix_nano' : IsInt (),
99+ 'time_unix_nano' : IsInt (),
100+ 'count' : 1 ,
101+ 'sum' : IsNumeric (),
102+ 'scale' : 20 ,
103+ 'zero_count' : 0 ,
104+ 'positive' : {'offset' : IsInt (), 'bucket_counts' : [1 ]},
105+ 'negative' : {'offset' : 0 , 'bucket_counts' : [0 ]},
106+ 'flags' : 0 ,
107+ 'min' : IsNumeric (),
108+ 'max' : IsNumeric (),
109+ }
110+ ],
111+ 'aggregation_temporality' : 1 ,
112+ },
113+ },
82114 ]
83115 )
84116
@@ -95,14 +127,20 @@ def test_good_route(client: Client, exporter: TestExporter, metrics_reader: InMe
95127 'logfire.span_type' : 'span' ,
96128 'logfire.msg' : "GET /django_test_app/123/ ? foo='1' & very_long…aram_name='very long…ram value'" ,
97129 'http.method' : 'GET' ,
130+ 'http.request.method' : 'GET' ,
98131 'http.server_name' : 'testserver' ,
99132 'http.scheme' : 'http' ,
133+ 'url.scheme' : 'http' ,
100134 'net.host.port' : 80 ,
135+ 'server.port' : 80 ,
101136 'http.url' : 'http://testserver/django_test_app/123/?very_long_query_param_name=very+long+query+param+value&foo=1' ,
102137 'net.peer.ip' : '127.0.0.1' ,
138+ 'client.address' : '127.0.0.1' ,
103139 'http.flavor' : '1.1' ,
140+ 'network.protocol.version' : '1.1' ,
104141 'http.route' : 'django_test_app/<int:item_id>/' ,
105142 'http.status_code' : 200 ,
143+ 'http.response.status_code' : 200 ,
106144 'http.target' : '/django_test_app/123/' ,
107145 },
108146 }
@@ -127,14 +165,20 @@ def test_error_route(client: Client, exporter: TestExporter):
127165 'logfire.span_type' : 'span' ,
128166 'logfire.msg' : "GET /django_test_app/bad/ ? foo='1'" ,
129167 'http.method' : 'GET' ,
168+ 'http.request.method' : 'GET' ,
130169 'http.server_name' : 'testserver' ,
131170 'http.scheme' : 'http' ,
171+ 'url.scheme' : 'http' ,
132172 'net.host.port' : 80 ,
173+ 'server.port' : 80 ,
133174 'http.url' : 'http://testserver/django_test_app/bad/?foo=1' ,
134175 'net.peer.ip' : '127.0.0.1' ,
176+ 'client.address' : '127.0.0.1' ,
135177 'http.flavor' : '1.1' ,
178+ 'network.protocol.version' : '1.1' ,
136179 'http.route' : 'django_test_app/bad/' ,
137180 'http.status_code' : 400 ,
181+ 'http.response.status_code' : 400 ,
138182 'http.target' : '/django_test_app/bad/' ,
139183 'logfire.level_num' : 17 ,
140184 },
@@ -172,13 +216,19 @@ def test_no_matching_route(client: Client, exporter: TestExporter):
172216 'logfire.span_type' : 'span' ,
173217 'logfire.msg' : "GET /django_test_app/nowhere/ ? foo='1'" ,
174218 'http.method' : 'GET' ,
219+ 'http.request.method' : 'GET' ,
175220 'http.server_name' : 'testserver' ,
176221 'http.scheme' : 'http' ,
222+ 'url.scheme' : 'http' ,
177223 'net.host.port' : 80 ,
224+ 'server.port' : 80 ,
178225 'http.url' : 'http://testserver/django_test_app/nowhere/?foo=1' ,
179226 'net.peer.ip' : '127.0.0.1' ,
227+ 'client.address' : '127.0.0.1' ,
180228 'http.flavor' : '1.1' ,
229+ 'network.protocol.version' : '1.1' ,
181230 'http.status_code' : 404 ,
231+ 'http.response.status_code' : 404 ,
182232 'http.target' : '/django_test_app/nowhere/' ,
183233 },
184234 }
0 commit comments