def METHOD_NAME(self, env):
    if env.span is None or not (config._api_security_enabled and config._appsec_enabled):
        return
    root = env.span._local_root or env.span
    if not root or any(meta_name in root._meta for _, meta_name, _ in self.COLLECTED):
        return
    root._metrics[API_SECURITY.ENABLED] = 1.0
    try:
        if not self._should_collect_schema(env) or self._global_rate_limiter.limit() is RateLimitExceeded:
            return
    except Exception:
        self._log_limiter.limit(log.warning, "Failed to sample request for schema generation", exc_info=True)
    # we need the request content type on the span
    try:
        headers = env.waf_addresses.get(SPAN_DATA_NAMES.REQUEST_HEADERS_NO_COOKIES, _sentinel)
        if headers is not _sentinel:
            appsec_processor._set_headers(root, headers, kind="request")
    except Exception:
        self._log_limiter.limit(log.debug, "Failed to enrich request span with headers", exc_info=True)
    waf_payload = {}
    for address, _, transform in self.COLLECTED:
        value = env.waf_addresses.get(SPAN_DATA_NAMES[address], _sentinel)
        if value is _sentinel:
            log.debug("no value for %s", address)
            continue
        if transform is not None:
            value = transform(value)
        waf_payload[address] = value
    if waf_payload:
        waf_payload["SETTINGS"] = {"extract-schema": True}
        result = call_waf_callback(waf_payload)
        if result is None:
            return
        for meta, schema in result.items():
            b64_gzip_content = b""
            try:
                b64_gzip_content = base64.b64encode(
                    gzip.compress(json.dumps(schema, separators=",:").encode())
                ).decode()
                if len(b64_gzip_content) >= MAX_SPAN_META_VALUE_LEN:
                    raise TooLargeSchemaException
                root._meta[meta] = b64_gzip_content
            except Exception as e:
                self._schema_meter.increment("errors", tags={"exc": e.__class__.__name__, "address": address})
                self._log_limiter.limit(
                    log.warning,
                    "Failed to get schema from %r [schema length=%d]:\n%s",
                    address,
                    len(b64_gzip_content),
                    repr(value)[:256],
                    exc_info=True,
                )
    self._schema_meter.increment("spans")