cozy-stack icon indicating copy to clipboard operation
cozy-stack copied to clipboard

feat: Log worker_id client

Open Crash-- opened this issue 1 year ago • 6 comments

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.

Crash-- avatar Dec 15 '23 09:12 Crash--

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?

Crash-- avatar Dec 15 '23 20:12 Crash--

Ping @Crash-- : what should we do for this PR?

nono avatar Jan 15 '24 14:01 nono

Ping @Crash--

nono avatar Feb 12 '24 17:02 nono

@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-- avatar Feb 13 '24 07:02 Crash--

@Crash-- I have added https://github.com/cozy/cozy-stack/pull/4262/commits/012811167c1642a66b820a8d3b935f35e7db0861 to the PR with the clientSide attribute

nono avatar Feb 13 '24 08:02 nono

Oh nice, thanks! I'll try to run & fix the tests.

Crash-- avatar Feb 13 '24 08:02 Crash--

@Crash-- I have fixed the code&tests. If it OK for you, I let you rebase the commits.

nono avatar Mar 05 '24 14:03 nono

Ping @Crash--

nono avatar Mar 19 '24 16:03 nono

Commits are cleaned and rebased. I let you merge :)

Crash-- avatar Mar 20 '24 08:03 Crash--