class_docstr: Stores Otel Instruments.
class_docstr_tok: ["Stores","Otel","Instruments","."]
docstr: Return the counter; creates a new one if it did not exist.
  
  :param name: The name of the counter to fetch or create.
  :param attributes:  Counter attributes, used to generate a unique key to store the counter.
docstr_tok: ["Return","the","counter",";","creates","a","new","one","if","it","did","not","exist",".",":","param","name",":","The","name","of","the","counter","to","fetch","or","create",".",":","param","attributes",":","Counter","attributes",",","used","to","generate","a","unique","key","to","store","the","counter","."]
code: def get_counter(self, name: str, attributes: Attributes = None):
      """
      Return the counter; creates a new one if it did not exist.
  
      :param name: The name of the counter to fetch or create.
      :param attributes:  Counter attributes, used to generate a unique key to store the counter.
      """
      key = _generate_key_name(name, attributes)
      if key not in self.map:
          self.map[key] = self._create_counter(name)
      return self.map[key]
  
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 4 for calling the MetricsMap obj's underlying member method code with example usage: obj.get_counter(name, attributes) and returns: self