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 config option collect_timeout #67

Merged
merged 4 commits into from
Mar 21, 2024

Conversation

sudeephb
Copy link
Contributor

@sudeephb sudeephb commented Mar 20, 2024

Add a config option --collect-timeout which can be used to change the timeout used by the collectors while making subprocess calls.

@sudeephb sudeephb requested a review from a team as a code owner March 20, 2024 07:56
@Pjack
Copy link

Pjack commented Mar 20, 2024

I suggest to provide only 1 configuration to user , maybe named "scrape_timeout".
We can align the timeout value between grafana-agent and commandline tool internal.

Copy link

@Pjack Pjack left a comment

Choose a reason for hiding this comment

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

Do we need to change the scrape_timeout as well? And I suggest to use the same name with grafana-agent.

@sudeephb sudeephb changed the title Add config option command_timeout Add config option scrape_timeout Mar 20, 2024
@sudeephb
Copy link
Contributor Author

@Pjack I have changed the name of the option.

@facundofc
Copy link

Even though a detail, I strongly disagree with the name change. Scraping is what prometheus does to the exporter, and it will lend to confusion using the same name here. Just imagine having a conversation about this exporter and scrape timeout comes up.

I'd suggest collect_timeout, as that is the right name for this concept: the exporter collects the data when prometheus scrapes the target.

@Pjack
Copy link

Pjack commented Mar 20, 2024

Even though a detail, I strongly disagree with the name change. Scraping is what prometheus does to the exporter, and it will lend to confusion using the same name here. Just imagine having a conversation about this exporter and scrape timeout comes up.

I'd suggest collect_timeout, as that is the right name for this concept: the exporter collects the data when prometheus scrapes the target.

scrape_timeout is configurable from exporter when we relate with grafana-agent. We also need to change it. That's why I suggest to use the same name. But collect_timeout or timeout , some common name are good to me too. I hope we only expose one configuration to user and we align the timeout within grafana-agent and subprocess internally.

@sudeephb sudeephb changed the title Add config option scrape_timeout Add config option collect_timeout Mar 20, 2024
Copy link
Contributor

@dashmage dashmage left a comment

Choose a reason for hiding this comment

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

LGTM 🚀 Just left one small, non-blocking comment to get some info.

It does feel a bit wasteful that we pass the full Config object to each of the collector classes even though they just need to use thecollect_timeout parameter to send it to their Command super class. But I'm guessing it's not that much overhead and it's easier to manage all these config options in one place.

tests/unit/test_collector.py Show resolved Hide resolved
@sudeephb
Copy link
Contributor Author

It does feel a bit wasteful that we pass the full Config object to each of the collector classes even though they just need to use thecollect_timeout parameter to send it to their Command super class.

If we only pass the collect_timeout option, we'd need to provide more arguments if we need to add extra config in the future, so I think managing all of them inside the config object is okay. Additionally, the config won't be big, it's just 5-6 options, so it's not a huge amount of data.

@jneo8
Copy link
Contributor

jneo8 commented Mar 21, 2024

Even though a detail, I strongly disagree with the name change. Scraping is what prometheus does to the exporter, and it will lend to confusion using the same name here. Just imagine having a conversation about this exporter and scrape timeout comes up.

I'd suggest collect_timeout, as that is the right name for this concept: the exporter collects the data when prometheus scrapes the target.

+1 for this. We should keep the exporter simple and leave the relate configuration with grafana-agent in the charm.

@sudeephb sudeephb merged commit f3e9563 into canonical:main Mar 21, 2024
3 checks passed
@sudeephb sudeephb self-assigned this Mar 21, 2024
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.

5 participants