Skip to content

Tracing: populate tags based on the custom headers#690

Merged
mattklein123 merged 7 commits intomasterfrom
config_headers
Apr 5, 2017
Merged

Tracing: populate tags based on the custom headers#690
mattklein123 merged 7 commits intomasterfrom
config_headers

Conversation

@RomanDzhabarov
Copy link
Copy Markdown
Member

No description provided.

are the only supported values.

request_headers_for_tags
*(optional, array)* An optional list of header names which is used for populating tags the an active span.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last part of the sentence doesn't make sense.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, 'on' is missing

are the only supported values.

request_headers_for_tags
*(optional, array)* An optional list of header names which is used for populating tags on the an active span.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

request_headers_for_tags
*(optional, array)* An optional list of header names which is used for populating tags on the an active span.
Each tag name is the header name and tag value is the header value from the request headers.
If specified header is not present in the request headers no tag is created.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grammar


const std::string& get() const { return string_; }
bool operator==(const LowerCaseString& rhs) const { return string_ == rhs.string_; }
LowerCaseString& operator=(const LowerCaseString& rhs) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not be needed and is probably indicative of doing something wrong.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's because Optional does not have a support for moveable types. Would you suggest to add it there?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what the actual problem you are trying to solve is, but I think you shouldn't need any of it, so unclear on the actual problem.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as far as i can tell the following happens:
Optional.value(arg) method does copy assignment for the argument passed in, what ends up happening vector is copy assigned and consequently LowerCaseString is copy assigned which is not permitted as we have move ctor for the LowerCaseString and compiler removes implicit operator=(const LowerCaseString&).

That's why one solution is to explicitly define copy assignment.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

per offline convo make config a pointer to a struct and remove operator= from here (so we don't introduce accidental copies).

virtual ~Config() {}

/**
* Operation name for tracing, e.g., ingress.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

virtual OperationName operationName() const PURE;

/**
* List of headers to populate tags on the active span.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (request_info_.healthCheck()) {
connection_manager_.config_.tracingStats().health_check_.inc();
} else {
Tracing::HttpTracerUtility::populateTagsBasedOnHeaders(*active_span_, *request_headers_,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just move this logic into finalizeSpan

*/
struct TracingConnectionManagerConfig {
Tracing::OperationName operation_name_;
std::list<Http::LowerCaseString> request_headers_for_tags_;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::vector

are the only supported values.

request_headers_for_tags
*(optional, array)* An optional list of header names which is used for populating tags on the active span.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still multiple grammar issues. Please pair write with someone.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do tomorrow morning

@mattklein123 mattklein123 merged commit 0fd1d85 into master Apr 5, 2017
@mattklein123 mattklein123 deleted the config_headers branch April 5, 2017 18:57
rshriram pushed a commit to rshriram/envoy that referenced this pull request Oct 30, 2018
jpsim pushed a commit that referenced this pull request Nov 28, 2022
Description: Bump the Envoy ref. This PR brings in the relevant updates to Envoy Mobile:

    #10060 which Fixes #687

Risk Level: low
Testing: unit test in Envoy, Envoy Mobile local build and CI

Fixes #687

Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit that referenced this pull request Nov 29, 2022
Description: Bump the Envoy ref. This PR brings in the relevant updates to Envoy Mobile:

    #10060 which Fixes #687

Risk Level: low
Testing: unit test in Envoy, Envoy Mobile local build and CI

Fixes #687

Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: JP Simard <jp@jpsim.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants