code: def _generate_key_name(name: str, attributes: Attributes = None):
      if attributes:
          key = name
          for item in attributes.items():
              key += f"_{item[0]}_{item[1]}"
      else:
          key = name
  
      return 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 3 for calling a global function with example usage: _generate_key_name(name, attributes) and returns: key