Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var (
VersionHash string
VersionDate string

ExcludeVBE bool
PrometheusExporter = NewPrometheusExporter()
VarnishVersion = NewVarnishVersion()
ExitHandler = &exitHandler{}
Expand Down Expand Up @@ -93,12 +94,15 @@ func main() {
flag.BoolVar(&StartParams.Test, "test", StartParams.Test, "Test varnishstat availability, prints available metrics and exits.")
flag.BoolVar(&StartParams.Raw, "raw", StartParams.Test, "Raw stdout logging without timestamps.")
flag.BoolVar(&StartParams.WithGoMetrics, "with-go-metrics", StartParams.WithGoMetrics, "Export go runtime and http handler metrics")
excludeVbe := flag.Bool("e", false, "Exclude metrics starting with VBE.")

// deprecated
flag.BoolVar(&StartParams.noExit, "no-exit", StartParams.noExit, "Deprecated: see -exit-on-errors")

flag.Parse()

ExcludeVBE = *excludeVbe

if version {
fmt.Printf("%s %s\n", ApplicationName, getVersion(true))
os.Exit(0)
Expand Down
3 changes: 3 additions & 0 deletions varnish.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ func ScrapeVarnishFrom(buf []byte, ch chan<- prometheus.Metric) ([]byte, error)
if isOutdatedVbe(vName, mostRecentVbeReloadPrefix) {
continue
}
if ExcludeVBE && strings.HasPrefix(vName, "VBE.") {
continue
}
if vName == "timestamp" {
continue
}
Expand Down