code: def _record_gauge(self, gauge: Gauge, value: float, tags: dict):
      view_data = self.view_manager.get_view(gauge.name)
      if not view_data:
          self.view_manager.register_view(gauge.view)
          # Reobtain the view.
      view = self.view_manager.get_view(gauge.name).view
      measurement_map = self.stats_recorder.new_measurement_map()
      tag_map = tag_map_module.TagMap()
      for key, tag_val in tags.items():
          tag_key = tag_key_module.TagKey(key)
          tag_value = tag_value_module.TagValue(tag_val)
          tag_map.insert(tag_key, tag_value)
      measurement_map.measure_float_put(view.measure, value)
      # NOTE: When we record this metric, timestamp will be renewed.
      measurement_map.record(tag_map)
  
imports: import json
  import logging
  import os
  import re
  import threading
  import time
  import traceback
  from collections import namedtuple
  from typing import List, Tuple, Any, Dict
  from prometheus_client.core import CounterMetricFamily, GaugeMetricFamily, HistogramMetricFamily
  from opencensus.metrics.export.value import ValueDouble
  from opencensus.stats import aggregation
  from opencensus.stats import measure
  from opencensus.stats.view_manager import ViewManager
  from opencensus.stats.stats_recorder import StatsRecorder
  from opencensus.stats.base_exporter import StatsExporter
  from prometheus_client.core import Metric
  from opencensus.stats.aggregation_data import CountAggregationData, DistributionAggregationData, LastValueAggregationData
  from opencensus.stats.view import View
  from opencensus.tags import tag_key
  from opencensus.tags import tag_map
  from opencensus.tags import tag_value
  import ray
  from ray._raylet import GcsClient
  from ray.core.generated.metrics_pb2 import Metric
label_desc: Use image node_id 3 for calling the MetricsAgent obj's underlying member method code with example usage: obj._record_gauge(gauge, value, tags) without return types