reformat dynamic metadata emitted by Mongo proxy#5117
reformat dynamic metadata emitted by Mongo proxy#5117mattklein123 merged 3 commits intoenvoyproxy:masterfrom
Conversation
Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com>
|
|
||
| operation, string, The operation to be executed. | ||
| resource, string, The resource name in *db.collection* format on which the operation is to be executed. | ||
| <db.collection>, string, The resource name in *db.collection* format. |
There was a problem hiding this comment.
| <db.collection>, string, The resource name in *db.collection* format. | |
| key, string, The resource name in *db.collection* format. |
| operation, string, The operation to be executed. | ||
| resource, string, The resource name in *db.collection* format on which the operation is to be executed. | ||
| <db.collection>, string, The resource name in *db.collection* format. | ||
| [], list, A list of strings, representing the operations executed on the resource. Operation is either insert,update,query,delete. |
There was a problem hiding this comment.
| [], list, A list of strings, representing the operations executed on the resource. Operation is either insert,update,query,delete. | |
| value, array, A list of strings representing the operations executed on the resource. |
The docs job doesn't like too many commas in a table. A backslash escape may work.
| EXPECT_TRUE(nullptr != metadata.fields().at("db.test1")); | ||
| EXPECT_EQ("query", metadata.fields().at("db.test1").list_value().values(0).string_value()); | ||
| EXPECT_TRUE(nullptr != metadata.fields().at("db.test2")); | ||
| EXPECT_EQ("insert", metadata.fields().at("db.test1").list_value().values(0).string_value()); |
Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com>
dio
left a comment
There was a problem hiding this comment.
Looks good. But I think adding a version history entry will be helpful.
|
|
||
| message[DynamicMetadataKeysSingleton::get().OperationField].set_string_value(operation); | ||
| message[DynamicMetadataKeysSingleton::get().ResourceField].set_string_value(resource); | ||
| // TODO(rshriram): reverse the resource string (table.db) |
There was a problem hiding this comment.
Super nit, add period at the end of the sentence (and also the other TODOs/comments).
|
@dio the PR that implemented this was merged yesterday :). So users have not seen this stuff yet. So version history doesn't exist.. |
dio
left a comment
There was a problem hiding this comment.
Sorry about that.
Thank you! LGTM!
| operation, string, The operation to be executed. | ||
| resource, string, The resource name in *db.collection* format on which the operation is to be executed. | ||
| key, string, The resource name in *db.collection* format. | ||
| value, array, A list of strings representing the operations executed on the resource (insert/update/query/delete). |
There was a problem hiding this comment.
Per our offline convo, FYI, in order for this to be actually useful you are going to have to log/store query commands.
Signed-off-by: Shriram Rajagopalan <shriramr@vmware.com> Signed-off-by: Fred Douglas <fredlas@google.com>
Description: Emit metadata as
map<resource, list(operations>so that it can be used in metadata matchers easily. The existing format (messages:list(structs)) is too hard to represent in metadata matchers.Risk Level: LOW
Testing: Unit tests
Signed-off-by: Shriram Rajagopalan shriramr@vmware.com
cc @venilnoronha