|
@@ -110,6 +110,7 @@ def backend():
|
|
|
"delightful_metrics.enable_common_tags": True,
|
|
|
"delightful_metrics.enable_code_locations": True,
|
|
|
"delightful_metrics.enable_span_attributes": False,
|
|
|
+ "delightful_metrics.minimetrics_disable_legacy": False,
|
|
|
}
|
|
|
)
|
|
|
def test_incr_called_with_no_tags(backend, scope):
|
|
@@ -135,6 +136,7 @@ def test_incr_called_with_no_tags(backend, scope):
|
|
|
"delightful_metrics.enable_common_tags": False,
|
|
|
"delightful_metrics.enable_code_locations": True,
|
|
|
"delightful_metrics.enable_span_attributes": False,
|
|
|
+ "delightful_metrics.minimetrics_disable_legacy": False,
|
|
|
}
|
|
|
)
|
|
|
def test_incr_called_with_no_tags_and_no_common_tags(backend, scope):
|
|
@@ -160,6 +162,7 @@ def test_incr_called_with_no_tags_and_no_common_tags(backend, scope):
|
|
|
"delightful_metrics.enable_common_tags": True,
|
|
|
"delightful_metrics.enable_code_locations": True,
|
|
|
"delightful_metrics.enable_span_attributes": False,
|
|
|
+ "delightful_metrics.minimetrics_disable_legacy": False,
|
|
|
}
|
|
|
)
|
|
|
def test_incr_called_with_tag_value_as_list(backend, scope):
|
|
@@ -183,6 +186,7 @@ def test_incr_called_with_tag_value_as_list(backend, scope):
|
|
|
"delightful_metrics.emit_gauges": False,
|
|
|
"delightful_metrics.enable_code_locations": True,
|
|
|
"delightful_metrics.enable_span_attributes": False,
|
|
|
+ "delightful_metrics.minimetrics_disable_legacy": False,
|
|
|
}
|
|
|
)
|
|
|
def test_gauge_as_count(backend, scope):
|
|
@@ -207,6 +211,7 @@ def test_gauge_as_count(backend, scope):
|
|
|
"delightful_metrics.emit_gauges": True,
|
|
|
"delightful_metrics.enable_code_locations": True,
|
|
|
"delightful_metrics.enable_span_attributes": False,
|
|
|
+ "delightful_metrics.minimetrics_disable_legacy": False,
|
|
|
}
|
|
|
)
|
|
|
def test_gauge(backend, scope):
|
|
@@ -231,6 +236,7 @@ def test_gauge(backend, scope):
|
|
|
"delightful_metrics.minimetrics_sample_rate": 1.0,
|
|
|
"delightful_metrics.enable_code_locations": True,
|
|
|
"delightful_metrics.enable_span_attributes": False,
|
|
|
+ "delightful_metrics.minimetrics_disable_legacy": False,
|
|
|
}
|
|
|
)
|
|
|
def test_composite_backend_does_not_recurse(scope):
|
|
@@ -268,6 +274,7 @@ def test_composite_backend_does_not_recurse(scope):
|
|
|
{
|
|
|
"delightful_metrics.minimetrics_sample_rate": 1.0,
|
|
|
"delightful_metrics.enable_span_attributes": False,
|
|
|
+ "delightful_metrics.minimetrics_disable_legacy": False,
|
|
|
}
|
|
|
)
|
|
|
@patch("sentry.metrics.minimetrics.sentry_sdk")
|
|
@@ -293,6 +300,7 @@ def test_unit_is_correctly_propagated_for_incr(sentry_sdk, unit, expected_unit):
|
|
|
{
|
|
|
"delightful_metrics.minimetrics_sample_rate": 1.0,
|
|
|
"delightful_metrics.enable_span_attributes": False,
|
|
|
+ "delightful_metrics.minimetrics_disable_legacy": False,
|
|
|
}
|
|
|
)
|
|
|
@patch("sentry.metrics.minimetrics.sentry_sdk")
|
|
@@ -315,6 +323,7 @@ def test_unit_is_correctly_propagated_for_timing(sentry_sdk, unit, expected_unit
|
|
|
"delightful_metrics.minimetrics_sample_rate": 1.0,
|
|
|
"delightful_metrics.emit_gauges": True,
|
|
|
"delightful_metrics.enable_span_attributes": False,
|
|
|
+ "delightful_metrics.minimetrics_disable_legacy": False,
|
|
|
}
|
|
|
)
|
|
|
@patch("sentry.metrics.minimetrics.sentry_sdk")
|
|
@@ -336,6 +345,7 @@ def test_unit_is_correctly_propagated_for_gauge(sentry_sdk, unit, expected_unit)
|
|
|
{
|
|
|
"delightful_metrics.minimetrics_sample_rate": 1.0,
|
|
|
"delightful_metrics.enable_span_attributes": False,
|
|
|
+ "delightful_metrics.minimetrics_disable_legacy": False,
|
|
|
}
|
|
|
)
|
|
|
@patch("sentry.metrics.minimetrics.sentry_sdk")
|
|
@@ -373,14 +383,7 @@ def test_to_minimetrics_unit(unit, default, expected_result):
|
|
|
"delightful_metrics.enable_common_tags": True,
|
|
|
"delightful_metrics.enable_span_attributes": True,
|
|
|
"delightful_metrics.enable_code_locations": True,
|
|
|
- }
|
|
|
-)
|
|
|
-@override_options(
|
|
|
- {
|
|
|
- "delightful_metrics.enable_capture_envelope": True,
|
|
|
- "delightful_metrics.enable_common_tags": True,
|
|
|
- "delightful_metrics.enable_span_attributes": True,
|
|
|
- "delightful_metrics.enable_code_locations": True,
|
|
|
+ "delightful_metrics.minimetrics_disable_legacy": False,
|
|
|
}
|
|
|
)
|
|
|
def test_span_attributes_if_there_is_no_active_span(backend, scope):
|
|
@@ -397,6 +400,7 @@ def test_span_attributes_if_there_is_no_active_span(backend, scope):
|
|
|
"delightful_metrics.enable_common_tags": True,
|
|
|
"delightful_metrics.enable_span_attributes": True,
|
|
|
"delightful_metrics.enable_code_locations": True,
|
|
|
+ "delightful_metrics.minimetrics_disable_legacy": False,
|
|
|
}
|
|
|
)
|
|
|
def test_span_attribute_is_attached_if_span_exists(backend, scope):
|