-
Notifications
You must be signed in to change notification settings - Fork 131
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
[NA] Add info logs #242
[NA] Add info logs #242
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.
Looks good. Added few points to consider
@@ -251,10 +253,12 @@ private Mono<Project> getProjectByName(String projectName) { | |||
} | |||
|
|||
private <T> Mono<T> failWithConflict(String error) { | |||
log.info(error); |
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.
To avoid pollution, it may have sense to log only once by identifier (projectName) in case these requests may be frequent. Smth like we have in EM: https://github.com/comet-ml/comet-backend/blob/f287bed3cfa92ba502fdb1a5728cd2ca1e55dd9a/comet-utils/src/main/java/com/comet/utils/monitoring/ErrorReporter.java#L57
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.
Conflicts are constraint validation. I don't expect to have them very often, but we can consider this if the number increases considerably. I would just avoid adding it now if it is not necessary yet.
return Response.ok().entity(service.findById(id)).build(); | ||
String workspaceId = requestContext.get().getWorkspaceId(); | ||
|
||
log.info("Finding dataset by id '{}' on workspaceId '{}'", id, workspaceId); |
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.
A general Q: what is the default log level of the app? If we plan to log INFO level by default, do we have aproxiamate expectation of the logs volume that may be generated. If the volume is too big, can make sense to consider log.debug instead
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.
Hi @LifeXplorer,
Yeah, the default is INFO; for now, we only add logs at the API level and for expected errors. I believe this is the minimum to allow us to troubleshoot in case of errors or unexpected behaviors. We are talking about 3 or 4 logs per request, which seems reasonable. We may add more debug-level logs soon, but for information, I believe those are relevant.
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.
These are legitimate INFO level logs in order to have insights on the normal application flow for debugging and operational purposes.
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 stylish comments, but no blockers.
return Response.ok().entity(service.findById(id)).build(); | ||
String workspaceId = requestContext.get().getWorkspaceId(); | ||
|
||
log.info("Finding dataset by id '{}' on workspaceId '{}'", id, workspaceId); |
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.
These are legitimate INFO level logs in order to have insights on the normal application flow for debugging and operational purposes.
String workspaceId = requestContext.get().getWorkspaceId(); | ||
|
||
log.info("Finding datasets by '{}' on workspaceId '{}'", criteria, workspaceId); | ||
DatasetPage datasetPage = service.find(page, size, criteria); |
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.
For future reference, just be careful about not leaking sensitive data to the logs in objects like this criteria. In this particular case, it should be fine.
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.
Agree. I thought about it, but I assumed those were not sensitive
@@ -117,13 +144,12 @@ public Response update(final @PathParam("id") UUID id, | |||
}) | |||
public Response deleteById(@PathParam("id") UUID id) { | |||
|
|||
var workspace = service.getWorkspaceId(id); | |||
|
|||
if (workspace == null) { |
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.
Functional change here, looks fine but be careful.
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.
There was a leftover from when we changed to filter instead of controller level auth.
@@ -51,6 +51,8 @@ | |||
import java.util.UUID; | |||
import java.util.stream.Collectors; | |||
|
|||
import static com.comet.opik.api.Span.SpanPage; | |||
import static com.comet.opik.api.Span.View; |
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: not a big fan of static imports in general. For this particular case, you won't know which View it is.
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.
Good point; in the case of the view, it's a bit confusing. I will remove it.
@@ -27,7 +27,7 @@ public class ExperimentItemService { | |||
private final @NonNull ExperimentService experimentService; | |||
private final @NonNull DatasetItemDAO datasetItemDAO; | |||
|
|||
public Mono<Void> create(Set<ExperimentItem> experimentItems) { | |||
public Mono<Void> create(@NonNull Set<ExperimentItem> experimentItems) { |
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 not needed, the call below already validates it.
* add docker compose and simple nginx confi for it * Updated Opik documentation with new deployment options * [NA] Add info logs (#242) * [OPIK-91] [UX improvements] Implement the Experiment configuration section in the compare page (#252) * Update docs * Removed images * Update to self-host documentation --------- Co-authored-by: liyaka <liyak@comet.com> Co-authored-by: Andres Cruz <andresc@comet.com> Co-authored-by: Thiago dos Santos Hora <thiagoh@comet.com> Co-authored-by: andrii.dudar <andriid@comet.com>
* add docker compose and simple nginx confi for it * Updated Opik documentation with new deployment options * [NA] Add info logs (#242) * [OPIK-91] [UX improvements] Implement the Experiment configuration section in the compare page (#252) * Update docs * Removed images * Update to self-host documentation --------- Co-authored-by: liyaka <liyak@comet.com> Co-authored-by: Andres Cruz <andresc@comet.com> Co-authored-by: Thiago dos Santos Hora <thiagoh@comet.com> Co-authored-by: andrii.dudar <andriid@comet.com>
Details
Many parts of the service were lacking basic info logs. This first iteration added a few basic logs; next, we may add more debug logs and any remaining relevant info logs.
Issues
Resolves #
Testing
Documentation