-
Notifications
You must be signed in to change notification settings - Fork 223
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
OPIK-75 Batch traces creation endpoint #229
Conversation
…5_batch_traces_creation
…5_batch_traces_creation
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 minor stylish stuff. Thanks for putting this together!
:workspace_id, | ||
:name<item.index>, | ||
parseDateTime64BestEffort(:start_time<item.index>, 9), | ||
if(:end_time<item.index> IS NULL, NULL, parseDateTime64BestEffort(:end_time<item.index>, 9)), |
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.
Minor: parseDateTimeBestEffortUSOrNull
can be used:
public Mono<Long> batchInsert(@NonNull List<Trace> traces, @NonNull Connection connection) { | ||
|
||
Preconditions.checkArgument(!traces.isEmpty(), "traces must not be empty"); |
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.
Minor: non-null and empty can be done in one go by removing the non-null annotation and using CollectionUtils.IsNotEmpty
.
public Mono<Long> create(TraceBatch batch) { | ||
|
||
Preconditions.checkArgument(!batch.traces().isEmpty(), "Batch traces cannot be empty"); |
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.
Minor risk of NPE: better use CollectionUtils.isNotEmpty
.
private Mono<Project> resolveProject(String projectName) { | ||
return getOrCreateProject(WorkspaceUtils.getProjectName(projectName)); | ||
} |
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.
Minor: kind of pointless method, it can be removed.
import java.util.UUID; | ||
|
||
@UtilityClass | ||
public class TestUtils { |
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.
Minor: better use a more specific name for this class. Having said that, this is a nice change.
Details
Add endpoint to batch create traces.
POST /v1/private/spans/batch
Issues
Resolves #
Testing
Documentation