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

If I want to change the Prometheus Command-Line Flags. #2236

Closed
barnettZQG opened this Issue Nov 30, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@barnettZQG
Copy link

barnettZQG commented Nov 30, 2016

If I want to change the Prometheus Command-Line Flags when prometheus is running.
Example: -storage.local.memory-chunks or alertmanager.url ...
Now,I only restart the running prometheus. But it is a time-consuming operation.I have to wait for Prometheus program to a full stop to start a new.
Do not know to have a better way to let me complete the need to modify the prometheus flags.

func KillPrometheus() error {
	if prometheusCMD.Process != nil {
		err := prometheusCMD.Process.Signal(os.Interrupt)
		if err != nil {
			yiyun.Error("Kill Prometheus Process Error.", err.Error())
			return err
		}
		yiyun.Info("Killed old prometheus server")
	} else {
		yiyun.Info("prometheus process is nil")
	}
	return nil
}
@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Nov 30, 2016

All configuration options provided through flags are fixed and can only be changed by restarting Prometheus.

To configure Alertmanagers, we added a section to the config file in our 1.4 release. You can now use the same service discovery mechanisms you can use for targets: https://prometheus.io/docs/operating/configuration/#<alertmanager_config>
Changes to the configuration file can be applied at runtime by hitting the /-/reload endpoint or sending a SIGHUP to the process.

The -alertmanager.url flag is only around for backwards compatibility.
That said, currently the file based configuration is still flagged as alpha but is unlikely to change.

@barnettZQG

This comment has been minimized.

Copy link
Author

barnettZQG commented Nov 30, 2016

I see.

@barnettZQG barnettZQG closed this Nov 30, 2016

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 24, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.