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

max_returned_metrics: parse string value with fallback #539

Merged
merged 3 commits into from
Aug 23, 2024

Conversation

tbavelier
Copy link
Member

What does this PR do ?

This PR allows the use of integer string value for the max_returned_metrics parameter. If the string cannot be parsed, falls back to default limit instead.

Motivation

Recent customer case where their JMX configuration would not work once they added max_returned_metrics. As they were using k8s annotations, they tried to use a string in the JSON instead of the integer, causing the instance not to be loaded with the error message Unable to create instance. Please check your yaml file :

{
  "instances": [
    {
      "host": "%%host%%",
      "port": 9999,
      "max_returned_metrics": "2000"
    }
  ]
}

instead of

{
  "instances": [
    {
      "host": "%%host%%",
      "port": 9999,
      "max_returned_metrics": 2000
    }
  ]
}

With this PR, both syntaxes would work.

@carlosroman carlosroman merged commit 356f27b into master Aug 23, 2024
9 checks passed
@carlosroman carlosroman deleted the tbavelier/fallback__max_returned_metrics branch August 23, 2024 11:14
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.

2 participants