-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
working cloud profiler export for skaffold #6066
working cloud profiler export for skaffold #6066
Conversation
7e5c35a
to
68c4138
Compare
Codecov Report
@@ Coverage Diff @@
## master #6066 +/- ##
==========================================
- Coverage 69.32% 69.30% -0.02%
==========================================
Files 481 481
Lines 18478 18490 +12
==========================================
+ Hits 12810 12815 +5
- Misses 4713 4723 +10
+ Partials 955 952 -3
Continue to review full report at Codecov.
|
68c4138
to
19bc581
Compare
|
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.
1 nit and more explanation.
cmd/skaffold/skaffold.go
Outdated
) | ||
|
||
type ExitCoder interface { | ||
ExitCode() int | ||
} | ||
|
||
func main() { | ||
if _, ok := os.LookupEnv("SKAFFOLD_PROFILE"); ok { |
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 _, ok := os.LookupEnv("SKAFFOLD_PROFILE"); ok { | |
if _, ok := os.LookupEnv("SKAFFOLD_PROFILER"); ok { |
See here https://skaffold.dev/docs/references/cli/#skaffold-apply ( search for SKAFFOLD_PROFILE
)
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.
Changed s/SKAFFOLD_PROFILE/SKAFFOLD_PROFILER
cmd/skaffold/skaffold.go
Outdated
) | ||
|
||
type ExitCoder interface { | ||
ExitCode() int | ||
} | ||
|
||
func main() { | ||
if _, ok := os.LookupEnv("SKAFFOLD_PROFILE"); ok { | ||
err := profiler.Start(profiler.Config{ | ||
Service: "skaffold_examples_microservices", |
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.
What does is service mean here? Sorry I don't have context on cloud.google.com/go/profiler
?
Shd this service be deployed in the project?
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.
Changed this to be configurable via env var - SKAFFOLD_PROFILER_SERVICE
e718646
to
f20ecaa
Compare
f20ecaa
to
ecf91f9
Compare
a2349a8
to
e8ff2f2
Compare
e8ff2f2
to
652cd70
Compare
Description
Adds
cloud profiler
code to skaffold that is able to upload profile information to GCP'sCloud Profiler
using user's own gcloud application default credentials.Alternatives
This could be done as a build tag and not compiled into skaffold binary but the upside is not worth it becuause:
master
branch @ HEADfix-5789_cloud-profiler
@ HEAD (this PR)make linters
checks would require adding tweaks/hacks as they do not support parsing two of the same function currently as build tags would requireConsiderations
Similar to
SKAFFOLD_TRACE
, theSKAFFOLD_PROFILE
functionality will be used in cron tests around skaffold's performance, do not affect skaffold's performance unless enabled (as would be expected) and add negligible size to the skaffold binary (~61M->~62M)