handleTransactionItem processes a "transaction" envelope item.
(item EnvelopeItem)
| 220 | |
| 221 | // handleTransactionItem processes a "transaction" envelope item. |
| 222 | func (h *handler) handleTransactionItem(item EnvelopeItem) (string, json.RawMessage) { |
| 223 | var txn Transaction |
| 224 | if err := json.Unmarshal(item.Payload, &txn); err != nil { |
| 225 | slog.Warn("sentry: failed to parse transaction", "err", err) |
| 226 | return "", item.Payload |
| 227 | } |
| 228 | |
| 229 | uuid := txn.EventID |
| 230 | |
| 231 | if h.db != nil { |
| 232 | if _, err := storeTransaction(h.db, &txn, item.Payload); err != nil { |
| 233 | slog.Warn("sentry: failed to store structured transaction", "err", err) |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | return uuid, item.Payload |
| 238 | } |
| 239 | |
| 240 | // handleSpansItem processes a "spans" envelope item (Span v2 format). |
| 241 | func (h *handler) handleSpansItem(item EnvelopeItem) { |
no test coverage detected