-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat(metrics): collect the DOCKER_HOST environment variable path #8007
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
base: develop
Are you sure you want to change the base?
Conversation
Thanks for the contribution! There are a few errors on At least in
The first one is because of The other ones might be just errors on |
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.
There are some more tests failing on test_installed_metrics.py
I added another comment to confirm the logic.
You can run pytest -vv tests/integration/telemetry
to check those. They don't run with the standard make pr
because they're integration tests, but they should run quickly (as opposed to other integration tests which could take hours)
samcli/lib/telemetry/metric.py
Outdated
""" | ||
|
||
parsed = urlparse(self._gc.docker_host) | ||
if not parsed.scheme == "": |
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.
Did you mean the opposite here? I imagine that if the schema is empty, then I can check if it's a file that exists, but here you're doing that if it's not empty. If it happens that it's not empty, then we could be calling os.path.exists("unix:///var/run/docker.sock")
which returns False.
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.
You're correct, but honestly I think this logic was a little too overcomplicated anyway. I've simplified and removed the conditional in the latest revision.
The integ tests are also passing on my local machine, just waiting for GitHub CI to trigger
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
3052dc8
to
ad611c8
Compare
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
@valerena, is the failing Windows smoke test related to this change? If so, I'm not sure how and could use some guidance on how to fix it |
Which issue(s) does this change fix?
Why is this change necessary?
It allows SAM CLI to have a proxy measurement on which tools users are using as its backend. This allows the SAM CLI team to prioritize testing and features from various tools which users may be using to provide their
DOCKER_HOST
.How does it address the issue?
This change collects the last part of URIs/paths, in hope that these last parts shed light on which tool the user is using with SAM CLI. For example, if a user is using a local version of docker, this new metric would collect
docker.sock
. This is only checking the last part of paths in an effort to not needlessly collect what may be private URLs to remote docker hosts which user's might be using.What side effects does this change have?
None?
Mandatory Checklist
PRs will only be reviewed after checklist is complete
make pr
passesmake update-reproducible-reqs
if dependencies were changedBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.