-
Notifications
You must be signed in to change notification settings - Fork 22
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 a static metrics server #67
Add a static metrics server #67
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! This looks good to me! 💪🏻
But maybe we can make it more generic, as this fits quite a lot of use cases? One small suggestion about that!
|
||
// NewStaticMetricsServer creates a new nginx server that serves the content of metrics as /metrics endpoint. | ||
// This is useful for testing different metrics scrapers. | ||
func NewStaticMetricsServer(e e2e.Environment, name string, metrics []byte) *InstrumentedRunnable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! I feel like the functionality this provides, goes beyond just metrics scrape.
This can be used for quite a few things apart from Prometheus scraping, like for example serving webpage to web scraper tool or something that polls remote config.
Maybe we can make it a bit generic, and put this in its own package? We can document the metrics scraping as one possible use case then. 🙂
func NewStaticMetricsServer(e e2e.Environment, name string, metrics []byte) *InstrumentedRunnable { | |
func NewStaticServer(e e2e.Environment, name, filename, endpoint string, content []byte) *InstrumentedRunnable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine to focus on one small specific aspect for now. We can review later before 1.0 and see if other use cases pop up (:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 👍🏽
|
||
// NewStaticMetricsServer creates a new nginx server that serves the content of metrics as /metrics endpoint. | ||
// This is useful for testing different metrics scrapers. | ||
func NewStaticMetricsServer(e e2e.Environment, name string, metrics []byte) *InstrumentedRunnable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine to focus on one small specific aspect for now. We can review later before 1.0 and see if other use cases pop up (:
Extracted from thanos-io/thanos#6377.
Has been useful to have this for testing systems scraping Prometheus metrics, like the Thanos Receiver, with different topologies and configurations.