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

OPIK-75 Batch traces creation endpoint #229

Merged
merged 17 commits into from
Sep 13, 2024

Conversation

thiagohora
Copy link
Contributor

@thiagohora thiagohora commented Sep 12, 2024

Details

Add endpoint to batch create traces.

POST /v1/private/spans/batch

Issues

Resolves #

Testing

Documentation

@thiagohora thiagohora requested a review from a team as a code owner September 12, 2024 15:15
@thiagohora thiagohora self-assigned this Sep 12, 2024
Copy link
Collaborator

@andrescrz andrescrz left a 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)),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Comment on lines +739 to +741
public Mono<Long> batchInsert(@NonNull List<Trace> traces, @NonNull Connection connection) {

Preconditions.checkArgument(!traces.isEmpty(), "traces must not be empty");
Copy link
Collaborator

@andrescrz andrescrz Sep 13, 2024

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.

Comment on lines +89 to +91
public Mono<Long> create(TraceBatch batch) {

Preconditions.checkArgument(!batch.traces().isEmpty(), "Batch traces cannot be empty");
Copy link
Collaborator

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.

Comment on lines +127 to +129
private Mono<Project> resolveProject(String projectName) {
return getOrCreateProject(WorkspaceUtils.getProjectName(projectName));
}
Copy link
Collaborator

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 {
Copy link
Collaborator

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.

@thiagohora thiagohora merged commit 205fc9b into main Sep 13, 2024
2 checks passed
@thiagohora thiagohora deleted the thiagohora/OPIK-75_batch_traces_creation branch September 13, 2024 13:30
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.

2 participants