-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
enhancement: user agent 2.1 #3001
base: master
Are you sure you want to change the base?
enhancement: user agent 2.1 #3001
Conversation
c1ae03a
to
8d081b1
Compare
3cd174e
to
4905534
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.
Just an initial pass- had a few comments
src/AwsClient.php
Outdated
@@ -280,6 +280,11 @@ public function __construct(array $args) | |||
if (isset($args['with_resolved'])) { | |||
$args['with_resolved']($config); | |||
} | |||
MetricsBuilder::appendMetricsCaptureMiddleware( |
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.
question: do we need to add this (or other static/guaranteed metrics) to our middleware stack?
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.
Not sure if I understand your question. Can you please explain?
2ee9c21
to
e4cd325
Compare
This change provides: - A builder class for appending metrics - Default initialization of a metrics builder within command instantiation - Wraps user agent logic into a single middleware class - Adds middlewares into the different features from where metrics can be gather, to acomplish this purpose.
e4cd325
to
6b4b870
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.
Looking good, just had a few more comments
cfd5b3f
to
1160889
Compare
7f4bb57
to
c8c6ef9
Compare
- Move the user agent middleware after the signing step in order to gather signature metrics. - Add request compression metric gathering. - Add specific testing for signatures. - Add specific testing for request compression. - Add specific testing for s3 encryption clients. - Add credentials metric gathering logic. - Add tests for credentials metrics. - Make existent credentials tests to work with the new field `source`. For example, for tests around profile credentials the source property for credentials MUST be `profile`. The default value for this field is `static`.
c8c6ef9
to
64854e1
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.
We should probably have some tests/assertions on credential resolution -> source
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.
We might want to move this into a utils
subdirectory
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.
and make it final
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.
I agree with making it final. Not sure about moving it into a sub-directory. I think the level it is is fine, because this is intended to be like a enum with the different credential sources.
tests/MetricsBuilderTest.php
Outdated
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.
we should have some sort of end-to-end test with a client and set of features and make assertions against the output string
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.
I think that that already exists in the UserAgentMiddlewareTest
implementation. Please let me know if the tests there is not what you refer.
- Use static mapping instead of multiple if/else-ifs. - Remove the endpoint_id metric tracking since it was removed from the spec. - Make method's name to be verb based. - Remove the getMetricsBuilder from the CommandInterface.
- Add tests cases to cover credentials sets the correct source when resolved. - Fix the sso, sso_legacy, and process metrics. They should be all a profile based metric.
This change provides:
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.