Skip to content

Commit dca5328

Browse files
committed
Only record metric if pg transaction are sent
1 parent 323ee96 commit dca5328

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

newrelic/api/transaction.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,6 +1145,10 @@ def _make_sampling_decision(self):
11451145
self._sampling_decision_made = True
11461146
if self._sampled:
11471147
self.partial_granularity_sampled = True
1148+
self.record_custom_metric(
1149+
f"Supportability/Python/PartialGranularity/{self._settings.distributed_tracing.sampler.partial_granularity.type}",
1150+
1,
1151+
)
11481152
return
11491153

11501154
# This is only reachable if both full and partial granularity tracing are off.

newrelic/core/application.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,12 +1368,6 @@ def harvest(self, shutdown=False, flexible=False):
13681368
spans_sampled = spans.num_samples
13691369
internal_count_metric("Supportability/SpanEvent/TotalEventsSeen", spans_seen)
13701370
internal_count_metric("Supportability/SpanEvent/TotalEventsSent", spans_sampled)
1371-
if configuration.distributed_tracing.sampler.partial_granularity.enabled:
1372-
internal_count_metric(
1373-
f"Supportability/Python/PartialGranularity/{configuration.distributed_tracing.sampler.partial_granularity.type}",
1374-
1,
1375-
)
1376-
13771371
stats.reset_span_events()
13781372

13791373
# Send error events

0 commit comments

Comments
 (0)