Commit ff0af33
feat(ourlogs): Adjust 'log' protocol per sdk feedback (#4592)
### Summary
Now that we've mostly finalized the logs protocol with sdks (see
[develop doc for more
info](getsentry/sentry-docs#12920)), we want to
update Relay to allow the 'log' item type to be sent in this format.
SDK's will likely primarily use the `log` ItemType instead of `otel_log`
since we don't need to change timestamp conventions, can send a
simplified `level` (see `OurLogLevel` added in this PR).
#### Schema changes
We've deprecated some fields in the protocol that only exist for OTEL:
- `severity_number` and `severity_text`, we're coercing these to
`level`, but we're keeping the original severity text and number as
attributes as OTel allows custom severity text.
- `observed_timestamp_nanos` is always set by relay regardless of what
is sent because Relay is the 'collector'. We have to leave this as an
attribute as well since it's being used by the existing consumer for
origin timestamp.
- `timestamp_nanos` becomes `timestamp: Timestamp`
- `trace_flags`, this is unused, and the consumer doesn't even store it
in the table. Will decide what to do with this later.
#### Future work
- The `ourlog_merge_otel` function can be trimmed down since we won't
need to fill in deprecated fields to send the same data to the kafka
consumer.
- We may need to transform the `OurLog` protocol from json received from
sdks to a generic EAP "trace items" kafka message that is essentially a
couple fields (eg. traceid) + a KVMap for `attributes`.
---------
Co-authored-by: Michi Hoffmann <[email protected]>
Co-authored-by: David Herberth <[email protected]>1 parent 69977e1 commit ff0af33
File tree
8 files changed
+1426
-254
lines changed- relay-event-schema/src
- processor
- protocol
- relay-ourlogs/src
- relay-server/src/services
- processor
- tests/integration
8 files changed
+1426
-254
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | 116 | | |
118 | 117 | | |
119 | 118 | | |
| |||
0 commit comments