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
Prometheus client metrics support #711
base: main
Are you sure you want to change the base?
Conversation
@jjaakola-aiven @aiven-anton could You review this PR too? |
Hello @libretto, Sorry for the long wait for a response here. We've convened internally about how to move forward with your contribution, and I'll summarize it here. There are three issues we that must be addressed for this to be mergable:
Since the branches have diverged, let's also close the original PR now, and make any future changes to this branch only. |
Hello @aiven-anton, I just try answer Your comments:
The metric semantics applied in this context are determined by the SchemaRegistry product, as detailed in their documentation. To achieve exact compatibility with SchemaRegistry, adherence to their specified metric names is necessary.
Is there a method to determine the number of connections in the Karapace application? I haven't been able to find a way to access the list of connections within our app. Is it possible I overlooked something?
Ok
Ok |
Metrics is not an area where we'll aim for 1-1 compatibility with Confluent Schema Registry.
It's possible that this would have to be developed. For now, I would I just skip this and address it later. Do note that we have a long-term plan to switch from the homegrown web framework to FastAPI, so any such work might become moot. |
@aiven-anton Do You mean it must be coded in the following way?
|
@libretto Yes, with the exception that these should be counters, and not gauges. So I'd expect to see calls to |
@aiven-anton done. Review please. |
BTW. Is the usage of .gauge() and .timing() in the following functions acceptable?
|
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.
Can we have some tests?
We can certainly add some tests. However, the current version of Karapace Stats lacks test coverage, so we have no existing framework to guide us. At this point, it seems that only unit tests are feasible. I'm unsure how to implement integration tests for this part task. |
Let's kick off with the unit tests. I'll provide an example soon on how to execute an integration test. It's crucial to have a tangible test that ensures our output its compliant to the standard format. Without integration tests, even if the feature is technically sound, we lack a mechanism preventing us from the introduction of code that might break the consumers |
This code provides the option to use Prometheus for collecting statistics in Karapace. The branch is based on karapace-metrics branch.