cozy-stack
cozy-stack copied to clipboard
feat: Log worker_id client
When sending logs from client side konnector, let's set the worker_id to client. Like that, it's easier to monitor those konnectors.
Cozy-Stack already add this information when updating the job status.
Woa, thanks to the tests I see that this route can be used by a webapp and not only for a konnector. Maybe, in that case, the apps that send the logs should also pass the worker_id ? Something like : WithField("worker_id",c.QueryParam("worker_id"))? Or maybe we should make a call to couch to fetch the job type and if it's a clientSide job, then we add the client worker_id?
Ping @Crash-- : what should we do for this PR?
Ping @Crash--
@nono can you check the latest commit. I changed my mind and I want to get the manifest from the slug if this is a konnector. And then check if the konnector has the clientSide attribute from the manifest, but I don't how to do that.
@Crash-- I have added https://github.com/cozy/cozy-stack/pull/4262/commits/012811167c1642a66b820a8d3b935f35e7db0861 to the PR with the clientSide attribute
Oh nice, thanks! I'll try to run & fix the tests.
@Crash-- I have fixed the code&tests. If it OK for you, I let you rebase the commits.
Ping @Crash--
Commits are cleaned and rebased. I let you merge :)