Skip to content

Add scrape.static_targets to prom_scraper job - #738

Closed
Kump3r wants to merge 1 commit into
cloudfoundry:mainfrom
Kump3r:main
Closed

Kump3r wants to merge 1 commit into
cloudfoundry:mainfrom
Kump3r:main

Conversation

@Kump3r

@Kump3r Kump3r commented Oct 23, 2026

Copy link
Copy Markdown

Description

Adds a scrape.static_targets property to the prom_scraper job, allowing operators to define scrape targets directly in the BOSH manifest instead of requiring a prom_scraper_config.yml file on disk. This is useful when co-located jobs cannot place config files themselves (e.g. non-BOSH components or jobs from other releases).

Static targets are merged with file-discovered targets at startup and support all the same fields as prom_scraper_config.yml (port, source_id, scheme, server_name, path, headers, labels, scrape_interval, etc.).

The config provider now supports a YAML sequence format in addition to the existing single-target map format, making both file-based and static targets work through the same code path. Existing deployments are unaffected — the property defaults to an empty list.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Testing performed?

  • Unit tests
  • Integration tests
  • Acceptance tests

Checklist:

  • This PR is being made against the main branch, or relevant version branch
  • I have made corresponding changes to the documentation
  • I have added testing for my changes

Signed-off-by: Kump3r <tonevkalin@gmail.com>
@chombium

Copy link
Copy Markdown
Contributor

Hi @Kump3r,

Thanks for you PR and the inspiration to update the Prom Scraper's docs.

There is no need to make any changes to the Prom Scraper as it always has to be deployed together with the rest of the agents from this release. The Prom Scraper needs at least the Forwarder Agent in order to send data to downstream consumers. Therefore, there is no need to add some extra spec parameters as the Prom Scraper's auto-discovery will work. The problem is how to create a prom scraper configuration for a job in a release which one doesn't own.

I've created a PR with documentation on how to do that with a BOSH runtime config and the os-conf-release.

Feel free to try it and give feedback if there are some improvements needed. I will keep this PR open until I hear from you.

@Kump3r

Kump3r commented Oct 26, 2026 •

Copy link
Copy Markdown
Author

I haven’t had the chance to test it, but it looks fine as an approach. Thanks for the suggestion you can close the PR and issue

@chombium

chombium commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Closing this as we've found another way how to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

2 participants