Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bootstrap ¶
type Bootstrap struct {
// Logger is the configured logger for the exporter process.
Logger *slog.Logger
// MetricsPath is the parsed value of --web.telemetry-path.
MetricsPath string
// FlagConfig contains the parsed exporter-toolkit web flags.
FlagConfig *web.FlagConfig
// DisableExporterMetrics reports whether exporter self-metrics should be disabled.
DisableExporterMetrics bool
// MaxRequests is the parsed value of --web.max-requests.
MaxRequests int
}
Bootstrap captures parsed startup options that handler factories can use to construct exporter-specific HTTP handlers after CLI parsing.
type Config ¶
type Config struct {
// App is the Kingpin application to register flags on. When nil,
// kingpin.CommandLine is used.
App *kingpin.Application
// Name is the exporter name used for version output and startup logging.
Name string
// Description is used as the default landing page description.
Description string
// DefaultAddress is the default value for --web.listen-address.
DefaultAddress string
// Logger is the logger to use. When nil, toolkit configures promslog flags
// and builds a logger during Parse.
Logger *slog.Logger
// LandingConfig customizes the generated landing page.
LandingConfig web.LandingConfig
// MetricsHandler is the static handler to register at the metrics path.
MetricsHandler http.Handler
// MetricsHandlerFactory builds the metrics handler after flags are parsed.
MetricsHandlerFactory MetricsHandlerFactory
}
Config defines the generic exporter bootstrap inputs.
type MetricsHandlerFactory ¶
MetricsHandlerFactory builds an exporter-specific metrics handler after the common toolkit flags have been parsed.
type Runner ¶
type Runner struct {
// Logger is the resolved logger after parsing configuration.
Logger *slog.Logger
// MetricsPath is the parsed value of --web.telemetry-path.
MetricsPath string
// FlagConfig contains the parsed exporter-toolkit web flags.
FlagConfig *web.FlagConfig
// DisableExporterMetrics is the parsed value of --web.disable-exporter-metrics.
DisableExporterMetrics bool
// MaxRequests is the parsed value of --web.max-requests.
MaxRequests int
// LandingConfig is the resolved landing page configuration.
LandingConfig web.LandingConfig
// MetricsHandler is the configured static metrics handler.
MetricsHandler http.Handler
// MetricsHandlerFactory is the configured deferred metrics handler builder.
MetricsHandlerFactory MetricsHandlerFactory
// contains filtered or unexported fields
}
Runner manages generic exporter startup around flag parsing, landing page setup, and web listener bootstrapping.
Click to show internal directories.
Click to hide internal directories.