code: def spans_with_error(spans):
      error_spans = []
      for span in spans:
          for tag in span["tags"]:
              if "otel.status_code" == tag.get(
                  "key", ""
              ) and "ERROR" == tag.get("value", ""):
                  error_spans.append(span)
      return error_spans
  
imports: from typing import Dict, Optional
  import requests
  from docarray import DocumentArray
  from opentelemetry.context.context import Context
  from prometheus_api_client import PrometheusConnect
  from jina import Executor, requests
label_desc: Use image node_id 6 for calling a global function with example usage: spans_with_error(spans) and returns: error_spans