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

Add flag to optionally disable adding Thanos params when querying metrics #6560

Merged
merged 4 commits into from Jul 27, 2023
Merged

Conversation

anas-aso
Copy link
Contributor

@anas-aso anas-aso commented Jul 26, 2023

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

Currently Thanos Ruler doesn't work with services exposing Prometheus query or query_range API that strictly validate received request parameters (e.g GCP Managed Prometheus frontend component - GMP Frontend).
Example error when pointing Thanos Ruler to a GMP Frontend setup URL

{
  "error": {
    "code": 400,
    "message": "Invalid JSON payload received. Unknown name \"dedup\": Cannot bind query parameter. Field 'dedup' could not be found in request message.
Invalid JSON payload received. Unknown name \"partial_response\": Cannot bind query parameter. Field 'partial_response' could not be found in request message.",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.BadRequest",
        "fieldViolations": [
          {
            "description": "Invalid JSON payload received. Unknown name \"dedup\": Cannot bind query parameter. Field 'dedup' could not be found in request message."
          },
          {
            "description": "Invalid JSON payload received. Unknown name \"partial_response\": Cannot bind query parameter. Field 'partial_response' could not be found in request message."
          }
        ]
      }
    ]
  }
}

This change proposes to add an optional flag to disable sending Thanos specific parameters.

Verification

The change works with GMP Frontend.

Here is a custom docker image to try: https://hub.docker.com/r/anasaso/thanos

@sonatype-lift
Copy link

sonatype-lift bot commented Jul 26, 2023

Sonatype Lift is retiring

Sonatype Lift will be retiring on Sep 12, 2023, with its analysis stopping on Aug 12, 2023. We understand that this news may come as a disappointment, and Sonatype is committed to helping you transition off it seamlessly. If you’d like to retain your data, please export your issues from the web console.
We are extremely grateful and thank you for your support over the years.

📖 Read about the impacts and timeline

bwplotka
bwplotka previously approved these changes Jul 27, 2023
Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Nice, just let's make this flag hidden so we can experiment with it a little bit (niche use case).

Also proposed better help, otherwise LGTM (:

cmd/thanos/config.go Outdated Show resolved Hide resolved
Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com>
Signed-off-by: Anas <anas-aso@users.noreply.github.com>
@anas-aso anas-aso changed the title Add flag to optionally disable adding Thanos params when querying met… Add flag to optionally disable adding Thanos params when querying metrics Jul 27, 2023
Signed-off-by: Anas <anas-aso@users.noreply.github.com>
@anas-aso anas-aso requested a review from bwplotka July 27, 2023 19:28
Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Thanks!

@bwplotka bwplotka merged commit 2790de4 into thanos-io:main Jul 27, 2023
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants