Skip to content
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

Do no use x-opaque-id for deduplicating Elastic originating requests #82855

Merged

Conversation

pgomulka
Copy link
Contributor

@pgomulka pgomulka commented Jan 20, 2022

deprecated log messages originating from any elastic product requests should not be
deduplicated with the use of x-opaque-id.
If present, the value of X-elastic-product-origin will be used as part of the throttling key.

relates #82810

  • Have you signed the contributor license agreement?
  • Have you followed the contributor guidelines?
  • If submitting code, have you built your formula locally prior to submission with gradle check?
  • If submitting code, is your pull request against master? Unless there is a good reason otherwise, we prefer pull requests against master and will backport as needed.
  • If submitting code, have you checked that your submission is for an OS and architecture that we support?
  • If you are submitting this code for a class then read our policy for that.

deprecated log messages originating from kibana's requests should not be
deduplicated with the use of x-opaque-id because kibana populates it
with UUID.

closes elastic#82810
* @see <a href="https://logging.apache.org/log4j/2.x/manual/filters.htmlf">Log4j2 Filters</a>
*/
@Plugin(name = "RateLimitingFilter", category = Node.CATEGORY, elementType = Filter.ELEMENT_TYPE)
public class RateLimitingFilter extends AbstractFilter {

private volatile boolean useXOpaqueId = true;
private static final String KIBANA_OPRDUCT_ORIGIN = "kibana";

Choose a reason for hiding this comment

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

is this a typo or intentional?

Suggested change
private static final String KIBANA_OPRDUCT_ORIGIN = "kibana";
private static final String KIBANA_PRODUCT_ORIGIN = "kibana";

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that was a typo. The constant is not needed as this change will apply to all elastic originating requests

@pgomulka pgomulka changed the title Do no use x-opaque-id for deduplicating kibana requests Do no use x-opaque-id for deduplicating elastic originating requests Jan 24, 2022
@pgomulka pgomulka marked this pull request as ready for review January 24, 2022 15:17
@pgomulka pgomulka added :Core/Infra/Core Core issues without another label :Core/Infra/Logging Log management and logging utilities v7.17.0 v8.0.0 labels Jan 24, 2022
@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Jan 24, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@pgomulka pgomulka added >enhancement and removed :Core/Infra/Core Core issues without another label Team:Core/Infra Meta label for core/infra team labels Jan 24, 2022
@elasticsearchmachine
Copy link
Collaborator

Hi @pgomulka, I've created a changelog YAML for you.

@pgomulka pgomulka requested a review from rjernst January 24, 2022 15:47
Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

LGTM, but I would not change the naming of the member or setter.


private volatile boolean useXOpaqueId = true;
// a flag to disable/enable use of xOpaqueId controlled by changing cluster setting
private volatile boolean useXOpaqueIdEnabled = true;
Copy link
Member

Choose a reason for hiding this comment

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

Why the addition of "enabled"? The "use" prefix already denotes a boolean.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

true - it does not make sens to me now either. I can't remember what I was thinking when renaming..

@pgomulka pgomulka added the auto-backport Automatically create backport pull requests when merged label Jan 25, 2022
@pgomulka pgomulka merged commit f416b67 into elastic:master Jan 25, 2022
pgomulka added a commit to pgomulka/elasticsearch that referenced this pull request Jan 25, 2022
…lastic#82855)

deprecated log messages originating from any elastic product requests should not be
deduplicated with the use of x-opaque-id.
If present, the value of X-elastic-product-origin will be used as part of the throttling key.

relates elastic#82810
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.0
7.17 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 82855

pgomulka added a commit to pgomulka/elasticsearch that referenced this pull request Jan 25, 2022
…backport (elastic#82855)

deprecated log messages originating from any elastic product requests should not be
deduplicated with the use of x-opaque-id.
If present, the value of X-elastic-product-origin will be used as part of the throttling key.

relates elastic#82810
pgomulka added a commit that referenced this pull request Jan 25, 2022
…backport (#82855) (#83023)

deprecated log messages originating from any elastic product requests should not be
deduplicated with the use of x-opaque-id.
If present, the value of X-elastic-product-origin will be used as part of the throttling key.

relates #82810
backport #82855
pgomulka added a commit that referenced this pull request Jan 25, 2022
…82855) (#83020)

Backports the following commits to 8.0:

Do no use x-opaque-id for deduplicating elastic originating requests (Do no use x-opaque-id for deduplicating elastic originating requests #82855)
@albertzaharovits albertzaharovits changed the title Do no use x-opaque-id for deduplicating elastic originating requests Do no use x-opaque-id for deduplicating Elastic originating requests Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged :Core/Infra/Logging Log management and logging utilities >enhancement v7.17.0 v8.0.0-rc2 v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants