-
Notifications
You must be signed in to change notification settings - Fork 104
feat(eap): Produce logs to the items topic #4707
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
Conversation
Dav1dde
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll have to look more into the specifics and explore options, but for now I do not think we should make protoc a dependency of Relay's build. I can't think of a good reason why this would be necessary. Ideally the proto crate, just contains the generated code instead of relying on a build.rs. opentelemetry-proto also does not force you to have protoc.
| LogAttributeValue::Int(value) => AnyValue { | ||
| value: Some(Value::IntValue(value)), | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was already a bug before I think, this will drop logs with an int value > i64::MAX.
I'll take care of that.
k-fish
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The item_id is correctly using uuidv7 is my only real concern. We are currently using timestamp_precise is ordering, but we can switch to the item id if it's a stable replacement.
| item_id=timestamp_nanos.to_bytes( | ||
| length=16, | ||
| byteorder="little", | ||
| signed=False, | ||
| ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work? Should the uuidv7 have a random portion when NoContext is set? I think if it's set to 0 we may have collision problems
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work, I couldn't find a proper uuid7 library in Python to make the uuid based on a timestamp. That's why I replace it in the response lower.
Python 3.14 will have a function for this in the standard library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was also looking at the output (eg. 'itemId': 'quqO1GMfE61WcAAAAAAAAA=='), isn't the random portion not random here? It seems to be repeating. I am really only concerned that the uuidv7 implementation here wasn't working properly.
If the integration isn't passing maybe just confirm the timestamp portion of the actual log item_id matches the nanos in hex?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is repeated because I'm using the item_id coming from Relay. We can't properly make a uuid7 from a custom timestamp in Python just yet so I am just ignoring this value.
The way the uuid7 is generated from the timestamp in Rust is correct though, and has this random portion.
k-fish
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me if the uuidv7 is generating itemid properly. You're missing timestamp precise in the integration tests still, but that's a simple fix.
| item_id=timestamp_nanos.to_bytes( | ||
| length=16, | ||
| byteorder="little", | ||
| signed=False, | ||
| ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was also looking at the output (eg. 'itemId': 'quqO1GMfE61WcAAAAAAAAA=='), isn't the random portion not random here? It seems to be repeating. I am really only concerned that the uuidv7 implementation here wasn't working properly.
If the integration isn't passing maybe just confirm the timestamp portion of the actual log item_id matches the nanos in hex?
k-fish
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just running this on local, will post back any changes required after that
| ), | ||
| "string.attribute": AnyValue(string_value="some string"), | ||
| "valid_string_with_other": AnyValue(string_value="test"), | ||
| "sentry.timestamp_precise": AnyValue(int_value=timestamp_nanos), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this right or should this be a string_value? int_value is i64 which isn't correct for nanos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sentry.timestamp_precise is an integer in the current logs processor https://github.com/getsentry/snuba/blob/master/rust_snuba/src/processors/ourlogs.rs#L141-L144.
|
So the way we do timestamps here is now causing CI to fail: https://github.com/getsentry/relay/actions/runs/14974415036/job/42062971176?pr=4727 |
|
Looking into fixing this |
Instead of maintaining a separate schema, topic and consumer to ingest logs into the EAP, we're using the new items topic to ingest them.
To do:
Needs getsentry/pypi#1427
Plan to deploy pause the deploys for DE/US, push to S4S, look at logs ingested after the deploy, revert/move to DE.