metrics: measure context transfers for local source operations#2235
Merged
tonistiigi merged 1 commit intoFeb 23, 2024
Merged
Conversation
Collaborator
Author
|
The first commit has been separated into its own PR: #2234 |
jsternberg
commented
Feb 1, 2024
Comment on lines
+68
to
+75
| mr.TransferSize, _ = meter.Int64Counter("source.local.transfer.io", | ||
| metric.WithDescription("Measures the number of bytes transferred between the client and server for the context."), | ||
| metric.WithUnit("By")) | ||
|
|
||
| mr.Duration, _ = meter.Float64Counter("source.local.transfer.time", | ||
| metric.WithDescription("Measures the length of time spent transferring the context."), | ||
| metric.WithUnit("ms")) |
Collaborator
Author
There was a problem hiding this comment.
These names are based on this section of the instrument naming document for OTEL: https://opentelemetry.io/docs/specs/semconv/general/metrics/#instrument-naming
8d31c69 to
40c04a6
Compare
23e8e79 to
64a6bdc
Compare
Collaborator
Author
|
@tonistiigi @crazy-max @daghack I believe this is ready for review. I've also added a check to only enable this when |
Measure the transfer size and duration of context transfers for various categories of local source transfers from the progress stream that's returned during the build. Local source transfers are split into one of four categories: * context * dockerfile * dockerignore * namedcontext Named contexts that are different names will be categorized under the same metric. Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
64a6bdc to
97052cf
Compare
tonistiigi
approved these changes
Feb 23, 2024
|
|
||
| // getVCSPath returns the vcs:source attribute for a context path. | ||
| func getVCSPath(contextPath string) string { | ||
| var wd string |
Member
There was a problem hiding this comment.
Name should remain contextPath. Otherwise it is confusing why wd is passed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Measure the transfer size and duration of context transfers for various
categories of local source transfers from the progress stream that's
returned during the build.
Local source transfers are split into one of four categories:
Named contexts that are different names will be categorized under the same
metric.