Skip to content

Commit 2cbdf92

Browse files
committed
More reviewer suggested edits
1 parent 9e5e8aa commit 2cbdf92

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

newrelic/api/transaction.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,8 +566,6 @@ def __exit__(self, exc, value, tb):
566566
for ml_model, version in self._ml_models:
567567
self.record_custom_metric(f"Supportability/Python/ML/{ml_model}/{version}", 1)
568568

569-
if os.environ.get("FUNCTIONS_WORKER_RUNTIME", None):
570-
self.record_custom_metric("Supportability/Python/AzureFunctionMode/Enabled", 1)
571569

572570
if self._settings.distributed_tracing.enabled:
573571
# Sampled and priority need to be computed at the end of the

newrelic/core/application.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,11 @@ def connect_to_data_collector(self, activate_agent):
597597
if self._agent_control.health_check_enabled:
598598
internal_metric("Supportability/AgentControl/Health/enabled", 1)
599599

600+
# Azure Function mode metric
601+
# Note: This environment variable will be set by the Azure Functions runtime
602+
if os.environ.get("FUNCTIONS_WORKER_RUNTIME", None):
603+
internal_metric("Supportability/Python/AzureFunctionMode/enabled", 1)
604+
600605
self._stats_engine.merge_custom_metrics(internal_metrics.metrics())
601606

602607
# Update the active session in this object. This will the

newrelic/core/config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,6 @@ def default_otlp_host(host):
904904
"NEW_RELIC_INSTRUMENTATION_KOMBU_CONSUMER_ENABLED", default=False
905905
)
906906

907-
908907
_settings.event_harvest_config.harvest_limits.analytic_event_data = _environ_as_int(
909908
"NEW_RELIC_ANALYTICS_EVENTS_MAX_SAMPLES_STORED", DEFAULT_RESERVOIR_SIZE
910909
)

tests/agent_unittests/test_agent_protocol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def clear_sent_values():
7878

7979
@pytest.fixture(autouse=True)
8080
def override_utilization(monkeypatch):
81-
global AWS, AZURE, ECS, GCP, PCF, BOOT_ID, DOCKER, KUBERNETES, AZUREFUNCTION
81+
global AWS, AZURE, ECS, GCP, PCF, DOCKER, KUBERNETES, AZUREFUNCTION
8282
AWS = {"id": "foo", "type": "bar", "zone": "baz"}
8383
AZURE = {"location": "foo", "name": "bar", "vmId": "baz", "vmSize": "boo"}
8484
ECS = {"ecsDockerId": "foobar"}

0 commit comments

Comments
 (0)