[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-17。"],[],[],null,["# Troubleshooting a subscription with Single Message Transforms (SMTs)\n\nThis page provides some common troubleshooting tips for [subscriptions with SMTs](/pubsub/docs/smts/create-subscription-smt).\n\nMonitor SMTs\n------------\n\nTo understand the performance and impact of SMTs on a subscription,\nuse the following monitoring metrics:\n\nThe [subscription/message_transform_latencies](/monitoring/api/metrics_gcp_p_z#pubsub/subscription/message_transform_latencies)\nmetric measures how long it takes for SMTs to be applied to a message. The\nmetric measures only the SMT latency and does not include other parts of the\nmessage delivery time.\n\nThe metric provides two key labels:\n\n- `status`: reports whether the transformation is successful or encountered\n an issue.\n\n- `filtered`: indicates if the SMT caused the message to be filtered out.\n When an SMT filters a message on a subscription, Pub/Sub\n acknowledges it, and the message is never sent to subscribers. This\n `filtered` label is true only when an SMT performs the filtering. Messages\n filtered using Pub/Sub's [built-in filtering capabilities](/pubsub/docs/subscription-message-filter)\n are not reflected in this specific metric.\n\nThe [subscription/byte_cost](/monitoring/api/metrics_gcp_p_z#pubsub/subscription/byte_cost) metric\nis used to identify messages that are filtered by SMTs or where SMTs\nfailed. Look for these specific values:\n\n- When an SMT filters a message, the operation_type is `smt_subscribe_filter_drop`.\n\n- If an SMT fails to transform a message, you see a `response_code` that is not `OK`.\n\nA backlog is building up\n------------------------\n\nIf you see a backlog of messages building up in the subscription check for\n`INVALID_ARGUMENT` errors reported in\n[`subscription/message_transform_latencies`](/monitoring/api/metrics_gcp_p_z#pubsub/subscription/message_transform_latencies).\n\nTo troubleshoot `INVALID_ARGUMENT` errors, add a\n[dead-letter topic](/pubsub/docs/handling-failures#dead_letter_topic) to the\nsubscription of interest. The dead letter topic captures messages that couldn't\nbe delivered to subscribers, along with an attribute called\n`CloudPubSubDeadLetterSourceSMTErrorMessage` that explains the failure reason.\n\nWhat's next\n-----------\n\n- If you still have issues with your subscription SMTs, see [Getting support](/pubsub/docs/getting-support)."]]