Skip to content
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

query/receive: Unify HTTP server instrumentation #1458

Merged
merged 5 commits into from Aug 27, 2019

Conversation

kakkoyun
Copy link
Member

@kakkoyun kakkoyun commented Aug 26, 2019

This PR attempts to unify HTTP server instrumentation behavior across components and removes unnecessary metrics. Thanos Query and Receive now use common instrumentation middleware.

PTAL #1420 for previous discussions.

Changes

  • Thanos Query no longer exposes thanos_query_api_instant_query_duration_seconds, thanos_query_api_range_query_duration_second metrics.
  • Thanos Receive no longer exposes thanos_http_request_duration_seconds, thanos_http_requests_total, thanos_http_response_size_bytes.

Verification

Local make test and run.

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
@kakkoyun
Copy link
Member Author

cc @brancz @bwplotka @squat

@kakkoyun kakkoyun changed the title Clean metrics query/receive: Unify HTTP server instrumentation Aug 26, 2019
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
ins := extpromhttp.NewNopInstrumentationMiddleware()
if o.Registry != nil {
ins = extpromhttp.NewInstrumentationMiddleware(o.Registry)
o.Registry.MustRegister(h.forwardRequestsTotal)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we always forget to register this or am I missing why this line is here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understood you correctly, It was registered before. I just removed the ones which come from InstrumentationMiddleware.

if o.Registry != nil {
o.Registry.MustRegister(
h.requestDuration,
h.requestsTotal,
h.responseSize,
h.forwardRequestsTotal,
)
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Makes sense now.

@brancz
Copy link
Member

brancz commented Aug 26, 2019

Sorry misclicked. Didn’t mean to approve, just comment.

@brancz brancz merged commit c54c3f2 into thanos-io:master Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants