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

Allow Users to Run Multiple Scripts #103

Merged
merged 1 commit into from
Dec 1, 2023
Merged

Conversation

ricoberger
Copy link
Owner

Until now it was only possible to run a single script within one Prometheus job, because the script parameter could only be provided one time.

With the changes in this commit it is now possible to run multiple scripts within one Prometheus job, for that the script parameter can be specified multiple times. For each specified script we are running the same logic as for a single script and then we merge the output of each script execution into one result.

Limitations:

  • The specified parameters are used for all scripts, it is not possible to specifiy different parameters for the scripts.
  • The timeout specified via the X-Prometheus-Scrape-Timeout-Seconds might not work correctly, if the offset is not large enough, since the timout logic is applied for all scripts.
  • If there is an error in the logic for one script, e.g. one of the defined scripts can not be found, the other scripts will also return not output.

Closes #100

@ricoberger ricoberger added the changelog: added A new feature was added label Dec 1, 2023
@ricoberger ricoberger force-pushed the run-multiple-scripts branch 2 times, most recently from 97c8444 to 0753bfc Compare December 1, 2023 10:18
Until now it was only possible to run a single script within one
Prometheus job, because the `script` parameter could only be provided
one time.

With the changes in this commit it is now possible to run multiple
scripts within one Prometheus job, for that the `script` parameter can
be specified multiple times. For each specified script we are running
the same logic as for a single script and then we merge the output of
each script execution into one result.

Limitations:
- The specified parameters are used for all scripts, it is not possible
  to specifiy different parameters for the scripts.
- The timeout specified via the `X-Prometheus-Scrape-Timeout-Seconds`
  might not work correctly, if the offset is not large enough, since the
  timout logic is applied for all scripts.
- If there is an error in the logic for one script, e.g. one of the
  defined scripts can not be found, the other scripts will also return
  not output.
@ricoberger ricoberger merged commit 6265b1a into main Dec 1, 2023
1 check passed
@ricoberger ricoberger deleted the run-multiple-scripts branch December 1, 2023 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: added A new feature was added
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is it possible to run multiple scripts on the same prometheus job/endpoint
1 participant