Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ourlogs): Adjust 'log' protocol per sdk feedback #4592

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

k-fish
Copy link
Member

@k-fish k-fish commented Mar 20, 2025

Summary

Now that we've mostly finalized the logs protocol with sdks (see develop doc for more info), 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.

@k-fish k-fish force-pushed the feat/ourlogs/adjust-log-item-type branch 3 times, most recently from 4dfab55 to 94acbee Compare March 20, 2025 15:55
Now that we've mostly finalized the logs protocol with sdks (see develop doc for more info), we want to update Relay to allow the 'log' item type to be sent in this format.

Also in this PR is some shimming between the updated protocol / event schema and the kafka consumers. This shimming is temporary until the generic EAP items consumers are ready, at which point we'll have to transform the event-schema Relay accepts into the generic eap item kafka.
@k-fish k-fish force-pushed the feat/ourlogs/adjust-log-item-type branch from 94acbee to e551796 Compare March 20, 2025 15:58
@k-fish k-fish marked this pull request as ready for review March 20, 2025 15:58
@k-fish k-fish requested a review from a team as a code owner March 20, 2025 15:58
Comment on lines 25 to 33
"timestamp": start.timestamp(),
"trace_id": "5b8efff798038103d269b633813fc60c",
"span_id": "eee19b7ec3c1b174",
"level": "info",
"body": "Example log record",
"attributes": {
"boolean.attribute": {"bool_value": True},
"sentry.severity_text": {"string_value": "info"},
},
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AbhiPrasad can you double check this looks right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup looks correct, I pushed up 2f8b6dd to test when we get fields missing.

@k-fish k-fish self-assigned this Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants