Risolvere i problemi relativi a una sottoscrizione con Single Message Transform (SMT)
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Questa pagina fornisce alcuni suggerimenti comuni per la risoluzione dei problemi relativi agli abbonamenti con gli SMT.
Monitorare gli SMT
Per comprendere il rendimento e l'impatto degli SMT su un abbonamento,
utilizza le seguenti metriche di monitoraggio:
La metrica subscription/message_transform_latencies misura il tempo necessario per applicare le SMT a un messaggio. La metrica misura solo la latenza SMT e non include altre parti del tempo di recapito del messaggio.
La metrica fornisce due etichette chiave:
status: indica se la trasformazione è riuscita o se è stato riscontrato un problema.
filtered: indica se l'MTA ha causato il filtraggio del messaggio.
Quando un SMT filtra un messaggio in una sottoscrizione, Pub/Sub lo conferma e il messaggio non viene mai inviato agli iscritti. Questa
filtered etichetta è vera solo quando un SMT esegue il filtro. I messaggi
filtrati utilizzando le funzionalità di filtro integrate di Pub/Sub
non vengono presi in considerazione in questa metrica specifica.
La metrica subscription/byte_cost viene utilizzata per identificare i messaggi filtrati dagli SMT o per i quali gli SMT non sono riusciti. Cerca questi valori specifici:
Quando un SMT filtra un messaggio, il valore operation_type è smt_subscribe_filter_drop.
Se un SMT non riesce a trasformare un messaggio, viene visualizzato un response_code che non è OK.
Si sta accumulando una serie di richieste in attesa
Per risolvere i problemi relativi agli errori INVALID_ARGUMENT, aggiungi un
argomento per la posta inutilizzata alla
sottoscrizione di tuo interesse. L'argomento messaggi non recapitabili acquisisce i messaggi che non è stato possibile consegnare ai sottoscrittori, insieme a un attributo chiamatoCloudPubSubDeadLetterSourceSMTErrorMessage che spiega il motivo dell'errore.
Passaggi successivi
Se i problemi relativi ai moduli di contatto per gli abbonamenti persistono, consulta la sezione Ricevere assistenza.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-11 UTC."],[],[],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)."]]