Skip to content

Commit 99816cf

Browse files
authored
Fix tests for OTEL 1.28.1 (#594)
1 parent 1353ed7 commit 99816cf

File tree

3 files changed

+385
-406
lines changed

3 files changed

+385
-406
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ dev = [
146146
"numpy>=2.0; python_version >= '3.9' and python_version < '3.12'",
147147
"numpy<1.24.4; python_version < '3.9'",
148148
"pytest-recording>=0.13.2",
149+
"vcrpy>=6",
149150
"uvicorn>=0.30.6",
150151
"logfire-api",
151152
"requests",

tests/test_metrics.py

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import pytest
77
import requests
8-
from dirty_equals import IsInt, IsOneOf
8+
from dirty_equals import IsInt
99
from inline_snapshot import snapshot
1010
from opentelemetry.metrics import CallbackOptions, Observation
1111
from opentelemetry.sdk.metrics._internal.export import MetricExporter, MetricExportResult
@@ -230,15 +230,7 @@ def observable_counter(options: CallbackOptions):
230230
'start_time_unix_nano': IsInt(),
231231
'time_unix_nano': IsInt(),
232232
'value': 4300,
233-
'exemplars': [
234-
{
235-
'filtered_attributes': None,
236-
'value': 4321,
237-
'time_unix_nano': IsInt(),
238-
'span_id': None,
239-
'trace_id': None,
240-
}
241-
],
233+
'exemplars': [],
242234
}
243235
],
244236
'aggregation_temporality': AggregationTemporality.DELTA,
@@ -273,15 +265,7 @@ def observable_gauge(options: CallbackOptions):
273265
'start_time_unix_nano': None,
274266
'time_unix_nano': IsInt(),
275267
'value': 4000,
276-
'exemplars': [
277-
{
278-
'filtered_attributes': None,
279-
'value': IsOneOf(300, 4000),
280-
'time_unix_nano': IsInt(),
281-
'span_id': None,
282-
'trace_id': None,
283-
}
284-
],
268+
'exemplars': [],
285269
}
286270
]
287271
},
@@ -315,15 +299,7 @@ def observable_counter(options: CallbackOptions):
315299
'start_time_unix_nano': IsInt(),
316300
'time_unix_nano': IsInt(),
317301
'value': 4321,
318-
'exemplars': [
319-
{
320-
'filtered_attributes': None,
321-
'value': 4321,
322-
'time_unix_nano': IsInt(),
323-
'span_id': None,
324-
'trace_id': None,
325-
}
326-
],
302+
'exemplars': [],
327303
}
328304
],
329305
'aggregation_temporality': AggregationTemporality.CUMULATIVE,

0 commit comments

Comments
 (0)