-
Notifications
You must be signed in to change notification settings - Fork 58
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
SNOW-1357377 Add request Id in all streaming ingest APIs #759
Conversation
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.
Thanks!
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.
lgtm! small question on if we want to log the requestid
.setHost(host) | ||
.setPort(port) | ||
.setPath(endPoint) | ||
.setParameter(REQUEST_ID, UUID.randomUUID().toString()) |
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.
should we log this requestid? might be too many logs, but it will be useful to know where/when the request was created in the ingest sdk
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.
Valid point. added requestId in above debug log! we dont need everywhere IMO. this requestId is mainly for internal debugging.
0dee895
to
d47b5c1
Compare
@@ -678,12 +678,23 @@ public HttpGet generateHistoryRangeRequest( | |||
*/ | |||
public HttpPost generateStreamingIngestPostRequest( | |||
String payload, String endPoint, String message) { | |||
LOGGER.debug("Generate Snowpipe streaming request: endpoint={}, payload={}", endPoint, payload); | |||
final String requestId = UUID.randomUUID().toString(); |
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.
My assumption is that the request id will remain the same with retry?
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.
thats true!
@@ -493,7 +493,6 @@ ChannelsStatusResponse getChannelsStatus( | |||
.collect(Collectors.toList()); | |||
request.setChannels(requestDTOs); | |||
request.setRole(this.role); | |||
request.setRequestId(this.flushService.getClientPrefix() + "_" + counter.getAndIncrement()); |
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.
We should remove request_id in the request as well
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.
you mean in the POJO?
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.
Yes, in the request class
d47b5c1
to
168f3d3
Compare
5debf91
to
ba47eb2
Compare
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.
Let's remove the request_id in the ChannelsStatusRequest class, otherwise LGTM, thanks
import static net.snowflake.ingest.utils.Constants.RESPONSE_SUCCESS; | ||
import static net.snowflake.ingest.utils.Constants.ROLE; | ||
import static net.snowflake.ingest.utils.Constants.USER; | ||
import static net.snowflake.ingest.utils.Constants.*; |
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.
no star import
…#759) * SNOW-1357377 Add request Id in all streaming ingest APIs * Fix tests and log requestId * Format * Remove request_id and no star imports
Along with this, our response should also include requestId but that can come later since they can still rely on offsetToken API. (Wont work for other APIs but there hasn't been any request)
This is for internal logging purposes.