code: def test_metrics_agent_proxy_record_and_export_basic(get_agent):
      """Test the case the metrics are exported without worker_id."""
      namespace = "test"
      agent, agent_port = get_agent
  
      # Test the basic case.
      m = generate_protobuf_metric(
          "test", "desc", "", label_keys=["a", "b"], timeseries=[]
      )
      m.timeseries.append(generate_timeseries(["a", "b"], [1, 2, 3]))
      agent.proxy_export_metrics([m])
      name, samples = get_metric(f"{namespace}_test", agent_port)
      assert name == f"{namespace}_test"
      assert len(samples) == 1
      assert samples[0].labels == {"a": "a", "b": "b"}
      assert samples[0].value == 3
  
      # Test new metric has proxyed.
      m = generate_protobuf_metric(
          "test", "desc", "", label_keys=["a", "b"], timeseries=[]
      )
      m.timeseries.append(generate_timeseries(["a", "b"], [4]))
      agent.proxy_export_metrics([m])
      name, samples = get_metric(f"{namespace}_test", agent_port)
      assert name == f"{namespace}_test"
      assert len(samples) == 1
      assert samples[0].labels == {"a": "a", "b": "b"}
      assert samples[0].value == 4
  
      # Test new metric with different tag is reported.
      m = generate_protobuf_metric(
          "test", "desc", "", label_keys=["a", "b"], timeseries=[]
      )
      m.timeseries.append(generate_timeseries(["a", "c"], [5]))
      agent.proxy_export_metrics([m])
      name, samples = get_metric(f"{namespace}_test", agent_port)
      assert name == f"{namespace}_test"
      assert len(samples) == 2
      assert samples[0].labels == {"a": "a", "b": "b"}
      assert samples[0].value == 4
      # Newly added metric has different tags and values.
      assert samples[1].labels == {"a": "a", "b": "c"}
      assert samples[1].value == 5
  
imports: import os
  import time
  import sys
  import pytest
  import ray._private.prometheus_exporter
  from typing import List
  from opencensus.stats.view_manager import ViewManager
  from opencensus.stats.stats_recorder import StatsRecorder
  from opencensus.stats import execution_context
  from prometheus_client.core import REGISTRY
  from ray._private.metrics_agent import Gauge, MetricsAgent, Record, RAY_WORKER_TIMEOUT_S
  from ray._private.services import new_port
  from ray.core.generated.metrics_pb2 import Metric, MetricDescriptor, Point, LabelKey, TimeSeries, LabelValue
  from ray._raylet import WorkerID
  from ray._private.test_utils import fetch_prometheus_metrics, fetch_raw_prometheus, wait_for_condition
label_desc: Use image node_id 8 for calling a global function with example usage: test_metrics_agent_proxy_record_and_export_basic(get_agent) without return types