Skip to content

Commit

Permalink
Update test_fastapi_instrumentation.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lzchen committed Jul 10, 2024
1 parent 8837b12 commit c015e52
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -605,30 +605,37 @@ def test_basic_metric_success_both_semconv(self):
self.assertEqual(point.count, 1)
self.assertAlmostEqual(duration, point.sum, delta=40)
if metric.name == "http.server.request.duration":
self.assertAlmostEqual(duration_s, point.sum, places=1)
self.assertDictEqual(
expected_duration_attributes_new,
dict(point.attributes),
)
elif metric.name == "http.server.response.body.size":
self.assertEqual(25, point.sum)
self.assertDictEqual(
expected_duration_attributes_new,
dict(point.attributes),
)
elif metric.name == "http.server.request.body.size":
self.assertEqual(25, point.sum)
self.assertDictEqual(
expected_duration_attributes_new,
dict(point.attributes),
)
elif metric.name == "http.server.duration":
self.assertAlmostEqual(duration, point.sum, delta=40)
self.assertDictEqual(
expected_duration_attributes_old,
dict(point.attributes),
)
elif metric.name == "http.server.response.size":
self.assertEqual(25, point.sum)
self.assertDictEqual(
expected_duration_attributes_old,
dict(point.attributes),
)
elif metric.name == "http.server.request.size":
self.assertEqual(25, point.sum)
self.assertDictEqual(
expected_duration_attributes_old,
dict(point.attributes),
Expand Down

0 comments on commit c015e52

Please sign in to comment.