getsentry / relay

Sentry event forwarding and ingestion service.
https://docs.sentry.io/product/relay/
Other
319 stars 92 forks source link

feat(spans): Infer span.op if not defined #4056

Closed jjbayer closed 1 week ago

jjbayer commented 1 week ago

Add global option that allows inferring the span op, with rules like this:

{
    "span_op_defaults": {
       "rules": [{
            "condition": {
                "op": "not",
                "inner": {
                    "op": "eq",
                    "name": "span.data.messaging\\.system",
                    "value": null,
                },
            },
            "value": "message"
        }]
    }
}

ref: https://github.com/getsentry/relay/issues/3637

jjbayer commented 1 week ago

I'd prefer if we had a generic system instead of adding more specific stuff. Now it's the span.op in the future it might be span.foo. This is close to being a system which can write attributes based on rules.

@Dav1dde I considered it, the question is always, where do we stop? This PR is already a generalization of the initial idea of slapping some hard coded rules onto span normalization. But I agree that I could at least make the target field (span.op) part of the configuration, and make it independent of spans (the selector has $span... in it anyway).

Dav1dde commented 1 week ago

considered it, the question is always, where do we stop? This PR is already a generalization of the initial idea of slapping some hard coded rules onto span normalization.

Fair enough.

But I agree that I could at least make the target field (span.op) part of the configuration, and make it independent of spans (the selector has $span... in it anyway).

I'd like that, but that may require a Setter trait.