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

Gateway HTTP Metrics inconsistently measure failed response times #8820

Closed
3 tasks done
iand opened this issue Mar 24, 2022 · 1 comment · Fixed by #8827
Closed
3 tasks done

Gateway HTTP Metrics inconsistently measure failed response times #8820

iand opened this issue Mar 24, 2022 · 1 comment · Fixed by #8827
Assignees
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization

Comments

@iand
Copy link
Contributor

iand commented Mar 24, 2022

Checklist

Installation method

built from source

Version

from inspection of master branch

Config

No response

Description

The per-format latency metrics added as part of #8441 are inconsistent as to whether they include failed responses or not.

gw_unixfs_file_get_duration_seconds, gw_raw_block_get_duration_seconds include timings for failed responses

gw_car_stream_get_duration_seconds, gw_unixfs_gen_dir_listing_get_duration_seconds do not include timings for failed responses

These should be consistent and my preference is that they should not include timings for failed responses (since errors will skew latency timings lower in general)

Tech note: the difference is caused by the use of http.ServeContent for serving files and blocks which does not return an error. We should pass a custom ResponseWriter that detects whether an error occurred during the write and then only record the metric if there is no error.

@iand iand added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Mar 24, 2022
@welcome

This comment was marked as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant