-
Notifications
You must be signed in to change notification settings - Fork 72
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: OTel metrics & metering #1011
base: jjaakola-aiven-fastapi
Are you sure you want to change the base?
Conversation
e06b32e
to
7c9d0c6
Compare
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
1b21afc
to
944a4f1
Compare
944a4f1
to
efe2e90
Compare
efe2e90
to
df31d0e
Compare
) -> Response: | ||
resource = request.url.path.split("/")[1] | ||
with tracer.get_tracer().start_as_current_span(name=f"{request.method}: /{resource}", kind=SpanKind.SERVER) as span: | ||
span.add_event("Creating metering resources") | ||
karapace_http_requests_in_progress: UpDownCounter = meter.get_meter().create_up_down_counter( |
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.
Is this creating the counter or reusing the existing one? Similar question for the duration histogram and requests counter.
tracer.update_span_with_request(request=request, span=span) | ||
span.add_event("Calling request handler") | ||
response: Response = await call_next(request) |
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.
If call to next fails, are the subsequent calls to tracer and meters called?
setattr(request.state, meter.START_TIME_KEY, time.monotonic()) | ||
|
||
# Extract request labels | ||
path = request.url.path |
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.
This will create quite large cardinality when Karapace handles large number of topics and versions.
About this change - What it does
prometheus
via theopentelemetry-collector
as shown belowgrafana
dashboard shows that theprometheus
source still works as expectedFollow up
schema_reader
metrics to use the OTel meterstatsd