-
Notifications
You must be signed in to change notification settings - Fork 558
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
feat(clients/go): add metrics for job worker #4501
Conversation
Introduces an interface `JobWorkerMetrics` which can be registered with the `JobWorkerBuilder`: ``` builder.Metrics(metricsImpl) ```
3a8d3be
to
e7fe803
Compare
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.
Thanks a lot for this PR and your patience 🙂
LGTM, can you also add a test for the new builder method in jobWorker_builder_test.go
?
One small question, I'll admit I'm not a Go expert - as you can see most of our project is in Java. This is the first time we add metrics in the Go client; on the Java side, I'd usually recommend using something like Micrometer as a metrics facade - is there something similar in the Go ecosystem?
We usually use the Prometheus client to expose metrics, as this is the de facto standard in the cloud native environment ( But I did not want to introduce a new dependency in the zeebe go client. |
Actually I wanted to pass a metric facade to the client. However, this would have resulted in breaking changes, because the abstraction is not sufficiently separated. This would have had the advantage to capture much more metrics. Perhaps this can be addressed in the future. |
Totally agree - we made that (imo) mistake in our main project but I would love to replace that with Micrometer.
I'd be happy to discuss what you have in mind there 🙂 I think the changes you added are fairly easy to deprecate in favor of a facade in the future, so I don't see any problem there EDIT: Regarding the PR, it's basically approved but I want to try it out concretely with a Prometheus client, so give me a few minutes |
Tested it with Prometheus, looks good 👍 |
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.
One small thing, sorry I didn't flag it before; we keep track of backwards compatibility, and this breaks it (you can read more here). Now that's partially because we're Java devs and using interfaces in Go in the wrong way (for which we have an issue, see here).
In my opinion, this change is worth breaking, as the benefits outweigh the gains, and I doubt many users are implementing the job worker builder interface.
If you could then run
gocompat save ./...
And push that; you can verify it now passes the compat check by running
gocompat compare --go1compat ./...
Thanks! Sorry for the back and forth 😅
Introduces an interface `JobWorkerMetrics` which can be registered with the `JobWorkerBuilder`: ``` builder.Metrics(metricsImpl) ```
2b5bfb5
to
f5d9e78
Compare
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.
Thanks so much, and thanks for being patient with us 🙂
This will be part of the next release, 0.24, scheduled for the first week of July, though there weren't much changes since 0.23 in the Go client so you could probably use (at your own risk) the commit tag.
bors r+ |
4501: feat(clients/go): add metrics for job worker r=npepinpe a=AndreasBieber ## Description Introduces an interface `JobWorkerMetrics` which can be registered with the `JobWorkerBuilder`: ``` builder.Metrics(metricsImpl) ``` ## Related issues <!-- Which issues are closed by this PR or are related --> closes #4500 # Co-authored-by: Andreas Bieber <github@bs-soft.de>
Build failed |
bors retry |
4501: feat(clients/go): add metrics for job worker r=npepinpe a=AndreasBieber ## Description Introduces an interface `JobWorkerMetrics` which can be registered with the `JobWorkerBuilder`: ``` builder.Metrics(metricsImpl) ``` ## Related issues <!-- Which issues are closed by this PR or are related --> closes #4500 # Co-authored-by: Andreas Bieber <github@bs-soft.de>
Build failed |
bors r+ |
4501: feat(clients/go): add metrics for job worker r=npepinpe a=AndreasBieber ## Description Introduces an interface `JobWorkerMetrics` which can be registered with the `JobWorkerBuilder`: ``` builder.Metrics(metricsImpl) ``` ## Related issues <!-- Which issues are closed by this PR or are related --> closes #4500 # Co-authored-by: Andreas Bieber <github@bs-soft.de>
Build failed |
Sorry, pesky flaky tests 😅 bors retry |
Build succeeded |
Description
Introduces an interface
JobWorkerMetrics
which can be registered with theJobWorkerBuilder
:Related issues
closes #4500
Pull Request Checklist
If submitting code, please run(no java code changes)mvn clean install -DskipTests
locally before committing