-
Notifications
You must be signed in to change notification settings - Fork 5
Update data capture to match path pattern #60
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: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,9 @@ message AgentConfig { | |
|
|
||
| // resource_attributes map define the static list of resources which is configured on the tracer | ||
| map<string, string> resource_attributes = 7; | ||
|
|
||
| // custom_data_capture_endpoints list the custom endpoints with respective data capture rules | ||
| repeated CustomDataCaptureEndpoint custom_data_capture_endpoints = 8; | ||
| } | ||
|
|
||
| // Reporting covers the options related to the mechanics for sending data to the | ||
|
|
@@ -127,3 +130,17 @@ message JavaAgent { | |
| // filter_jar_paths is the list of path to filter jars, separated by `,` | ||
| repeated google.protobuf.StringValue filter_jar_paths = 1; | ||
| } | ||
|
|
||
| // CustomDataCaptureEndpoint represents a custom data capture rule for an endpoint that matches | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To be clear this overrides whatever you set in the DataCapture config? How do you resolve conflicting rules (e.g. 2 matching rules with different DataCapture)? All this must be specified here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm thinking we shouldn't introduce a new top level message here at all. Instead we should move this into the existing DataCapture message. I propose something along the lines of: and then change I know changing
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we do this then we will not have a default at all and only have rules for the matches that are given in config. What about when there is no rule given in config for a path? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The default config would be a rule which matches everything. For the case of no config, the default in the agent would be capture everything.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So what you are proposing @davexroth is that if user does not pass a value for DataCapture (meaning empty list) we match everything with certain values for {http|grpc}_{headers|body}. I am curious of what would happen (it's possible I think) if the user wants to disable data capture for all, I am inclined to say I would just not pass anything and not expect a default to override that. I don't feel like a repeated is intuitive. I would go for keeping the simple config for data capture and then a repeated message, same as DataCapture but also adding a path_regex_matcher and header_regex_matcher. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jcchavezs I think disabling all still works pretty well with repeated. If
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So to be clear, what we are saying is that if the user does not pass any data capture we apply the default (capture all on everything) and if the user wants to disable data capture for everything then they have to create a data capture rule with no regex and everything in off which in practice is a empty object (at least in go, zero values are false), I think that is more confusing. I honestly would prefer to be explicit on everything so having one DefaultDataCapture (which user can set or coming from the defaults) and then SpecificDataCapture there passing a regex for either path or header is mandatory. Can we get a simple example using this branch on how that would look like in code? I think that is the best to decide what option to take. Back to the question about what if we have many matching, we can describe that the ordering matters so when there is a match all the rest is discarded. This means we need to have a "order" concept in the UI and probably a way to reorder them. BTW ordering is respected by proto (see https://developers.google.com/protocol-buffers/docs/proto3#specifying_field_rules)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here is an example in javaagent hypertrace/javaagent#301 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm still not sure about requiring two messages, one for DefaultDataCapture and one for SpecificDataCapture - as it's the same thing. If there's a feeling that being explicit is required, we could have two fields, Even with two fields or messages, the agent still need to define what the default behavior is if the default field/message isn't defined.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| // the given url pattern and host header | ||
| message CustomDataCaptureEndpoint { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure about calling it
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about |
||
|
|
||
| // data_capture describes the data being captured by instrumentation for this endpoint | ||
| DataCapture data_capture = 1; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's nice to describe this in terms of agent's
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would avoid to mix capture and propagation here because that is overkill. Locally services know what to capture and I don't think upstream should override that. |
||
|
|
||
| // url_pattern describes the url pattern to match for this endpoint | ||
| google.protobuf.StringValue url_pattern = 2; | ||
|
shashank11p marked this conversation as resolved.
Outdated
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should move
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd rather not do that. What identify the capture is the matching criteria, so having same settings for many matching criteria sounds more like a microoptimization. I'd keep it as it is.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How will this work for RPC? |
||
|
|
||
| // host_header describes the host header to match for this endpoint | ||
| google.protobuf.StringValue host_header = 3; | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.