Skip to content

Commit 01fe6b7

Browse files
committed
added no op function for metric processor test
1 parent ef82a98 commit 01fe6b7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

aws-opentelemetry-distro/src/amazon/opentelemetry/distro/aws_span_metrics_processor.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,19 @@ class AwsSpanMetricsProcessor(SpanProcessor):
4848

4949
_force_flush_function: Callable
5050

51+
# no op function to act as a default function in case forceFlushFunction was
52+
# not supplied to the the constructor.
53+
def _no_op_function(self, timeout_millis) -> None:
54+
return
55+
5156
def __init__(
5257
self,
5358
error_histogram: Histogram,
5459
fault_histogram: Histogram,
5560
latency_histogram: Histogram,
5661
generator: MetricAttributeGenerator,
5762
resource: Resource,
58-
force_flush_function: Callable,
63+
force_flush_function: Callable = _no_op_function,
5964
):
6065
self._error_histogram = error_histogram
6166
self._fault_histogram = fault_histogram

0 commit comments

Comments
 (0)