class_docstr: Stores Otel Instruments.
class_docstr_tok: ["Stores","Otel","Instruments","."]
docstr: Create a new counter or up_down_counter for the provided name.
docstr_tok: ["Create","a","new","counter","or","up_down_counter","for","the","provided","name","."]
code: def _create_counter(self, name):
      """Create a new counter or up_down_counter for the provided name."""
      otel_safe_name = _get_otel_safe_name(name)
  
      if _is_up_down_counter(name):
          counter = self.meter.create_up_down_counter(
              name=otel_safe_name
          )
      else:
          counter = self.meter.create_counter(name=otel_safe_name)
  
      logging.debug(
          "Created %s as type: %s",
          otel_safe_name,
          _type_as_str(counter),
      )
      return counter
  
imports: from __future__ import annotations
  import datetime
  import logging
  import random
  import warnings
  from functools import partial
  from typing import TYPE_CHECKING, Callable, Iterable, Union
  from opentelemetry import metrics
  from opentelemetry.exporter.otlp.proto.http.metric_exporter import OTLPMetricExporter
  from opentelemetry.metrics import Observation
  from opentelemetry.sdk.metrics import MeterProvider
  from opentelemetry.sdk.metrics._internal.export import ConsoleMetricExporter, PeriodicExportingMetricReader
  from opentelemetry.sdk.resources import SERVICE_NAME, Resource
  from airflow.configuration import conf
  from airflow.metrics.protocols import Timer
  from airflow.metrics.validators import OTEL_NAME_MAX_LENGTH, AllowListValidator, ListValidator, get_validator, stat_name_otel_handler
label_desc: Use image node_id 3 for calling the MetricsMap obj's underlying member method code with example usage: obj._create_counter(name) and returns: counter