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

Add time to first byte metric for s3 #4768

Merged
merged 2 commits into from
Aug 21, 2023
Merged

Add time to first byte metric for s3 #4768

merged 2 commits into from
Aug 21, 2023

Conversation

SmsS4
Copy link
Contributor

@SmsS4 SmsS4 commented Aug 20, 2023

What problem are we solving?

Lack of time to first byte metric for s3

How are we solving the problem?

Add a histogram metric for s3 time to first byte and observe it when filer returns response

How is the PR tested?

Simple write and read to s3 interface and observing SeaweedFS_s3_time_to_first_byte_seconds_bucket metric

Checks

  • I have added unit tests if possible.
  • I will add related wiki document changes and link to this PR after merging.

@chrislusf
Copy link
Collaborator

Millisecond is better?

@SmsS4
Copy link
Contributor Author

SmsS4 commented Aug 21, 2023

Changed second to millisecond

stats_collect.S3TimeToFirstByteHistogram.WithLabelValues(action, bucket).Observe(float64(time.Since(start).Milliseconds()))

and used prometheus.ExponentialBuckets(0.001, 2, 27) for buckets.

SeaweedFS_s3_time_to_first_byte_millisecond_bucket{bucket="test",type="GET",le="0.001"} 0
SeaweedFS_s3_time_to_first_byte_millisecond_bucket{bucket="test",type="GET",le="0.002"} 0
SeaweedFS_s3_time_to_first_byte_millisecond_bucket{bucket="test",type="GET",le="0.004"} 0
SeaweedFS_s3_time_to_first_byte_millisecond_bucket{bucket="test",type="GET",le="0.008"} 0
SeaweedFS_s3_time_to_first_byte_millisecond_bucket{bucket="test",type="GET",le="0.016"} 0
SeaweedFS_s3_time_to_first_byte_millisecond_bucket{bucket="test",type="GET",le="0.032"} 0
SeaweedFS_s3_time_to_first_byte_millisecond_bucket{bucket="test",type="GET",le="0.064"} 0
SeaweedFS_s3_time_to_first_byte_millisecond_bucket{bucket="test",type="GET",le="0.128"} 0
SeaweedFS_s3_time_to_first_byte_millisecond_bucket{bucket="test",type="GET",le="0.256"} 0
SeaweedFS_s3_time_to_first_byte_millisecond_bucket{bucket="test",type="GET",le="0.512"} 0
SeaweedFS_s3_time_to_first_byte_millisecond_bucket{bucket="test",type="GET",le="1.024"} 0
SeaweedFS_s3_time_to_first_byte_millisecond_bucket{bucket="test",type="GET",le="2.048"} 2
SeaweedFS_s3_time_to_first_byte_millisecond_bucket{bucket="test",type="GET",le="4.096"} 6
SeaweedFS_s3_time_to_first_byte_millisecond_bucket{bucket="test",type="GET",le="8.192"} 10
SeaweedFS_s3_time_to_first_byte_millisecond_bucket{bucket="test",type="GET",le="16.384"} 12
SeaweedFS_s3_time_to_first_byte_millisecond_bucket{bucket="test",type="GET",le="32.768"} 14
SeaweedFS_s3_time_to_first_byte_millisecond_bucket{bucket="test",type="GET",le="65.536"} 14
SeaweedFS_s3_time_to_first_byte_millisecond_bucket{bucket="test",type="GET",le="131.072"} 14
SeaweedFS_s3_time_to_first_byte_millisecond_bucket{bucket="test",type="GET",le="262.144"} 14
SeaweedFS_s3_time_to_first_byte_millisecond_bucket{bucket="test",type="GET",le="524.288"} 14
SeaweedFS_s3_time_to_first_byte_millisecond_bucket{bucket="test",type="GET",le="1048.576"} 14
SeaweedFS_s3_time_to_first_byte_millisecond_bucket{bucket="test",type="GET",le="2097.152"} 14
SeaweedFS_s3_time_to_first_byte_millisecond_bucket{bucket="test",type="GET",le="4194.304"} 14
SeaweedFS_s3_time_to_first_byte_millisecond_bucket{bucket="test",type="GET",le="8388.608"} 14
SeaweedFS_s3_time_to_first_byte_millisecond_bucket{bucket="test",type="GET",le="16777.216"} 14
SeaweedFS_s3_time_to_first_byte_millisecond_bucket{bucket="test",type="GET",le="33554.432"} 14
SeaweedFS_s3_time_to_first_byte_millisecond_bucket{bucket="test",type="GET",le="67108.864"} 14
SeaweedFS_s3_time_to_first_byte_millisecond_bucket{bucket="test",type="GET",le="+Inf"} 14
SeaweedFS_s3_time_to_first_byte_millisecond_sum{bucket="test",type="GET"} 110
SeaweedFS_s3_time_to_first_byte_millisecond_count{bucket="test",type="GET"} 14

@chrislusf chrislusf merged commit f614909 into seaweedfs:master Aug 21, 2023
5 checks passed
@chrislusf
Copy link
Collaborator

please adjust the grafana dashboard also.

@Cottand Cottand mentioned this pull request Oct 31, 2023
2 tasks
kmlebedev pushed a commit to kmlebedev/seaweedfs that referenced this pull request Dec 22, 2023
* Add time to first byte metric for s3

* Change second to millisecond
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