-
Notifications
You must be signed in to change notification settings - Fork 83
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 toolkit package #147
base: master
Are you sure you want to change the base?
Add toolkit package #147
Conversation
6782d2c
to
6557753
Compare
Here's what a basic startup looks like: landingConfig := web.LandingConfig{
Name: "Node Exporter",
Description: "Prometheus Node Exporter",
Version: version.Info(),
}
toolkitConfig := toolkit.Config{
MetricsHandler: newHandler(!*disableExporterMetrics, *maxRequests, logger),
FlagConfig: toolkitFlags,
LandingConfig: landingConfig,
Logger: logger,
}
if err := toolkit.Run(toolkitConfig); err != nil {
level.Error(logger).Log("err", err)
os.Exit(1)
} |
Still some work to do, tests, etc. But what do you think of this concept so far? |
6557753
to
6ae4ad8
Compare
Ok, new example setup. There's an annoying chicken-and-egg problem with the MetricsHandler, since if we want to pass a logger to the handler, we need to
|
02608de
to
aa26aca
Compare
One solution, I could implement part of the node_exporter's handler into this. One of the nice features is that it would implement the |
Implement a top level package to make it easy to bootstrap an exporter. * Move the flag package to the top level. * Add support for `--web.telemetry-path` flag. Defaults to`/metrics`. * Add a self-check function to the web FlagConfig. Signed-off-by: SuperQ <[email protected]>
aa26aca
to
54b38e7
Compare
Implement a top level package to make it easy to bootstrap an exporter.
--web.telemetry-path
flag. Defaults to/metrics
.