Applies to:
- Plan -
- Deployment -
Summary
Issue: Usingfacets.* fields (for example, facets.Sentiment) in an online scoring automation SQL filter returns Error: Unknown field: facets, or the filter never matches traces.
Cause: Online scoring automation SQL filters run when spans complete, but Topics writes facets later on a separate span. Online scoring does not re-run when facets are populated.
Resolution: Use programmatic batch scoring with SQL and log_feedback() after Topics has populated facets.
Resolution steps
Real-time chaining (Topics automation to scoring automation) is not currently supported. Use the batch scoring approach below instead. Topics writesfacets on the Topics automation span, not the root span. Use ANY_SPAN() to find matching traces and FILTER_SPANS(is_root) to return the root span id for log_feedback(). Adjust FILTER_SPANS() to return the span that has the fields your scorer needs.
Step 1: Query traces by facet value
Step 2: Score and attach results
id from the query for log_feedback() rather than the root_span_id or span_id.