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

process: Use registry collector for V1 data #1814

Merged
merged 10 commits into from
Dec 21, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
wip
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
  • Loading branch information
jkroepke committed Dec 20, 2024
commit 3eb433d632b4d5eaf3b365575dad3fda71333aea
13 changes: 10 additions & 3 deletions cmd/windows_exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@
package main

//goland:noinspection GoUnsortedImport
//nolint:gofumpt

Check failure on line 21 in cmd/windows_exporter/main.go

View workflow job for this annotation

GitHub Actions / lint

directive `//nolint:gofumpt` is unused for linter "gofumpt" (nolintlint)
import (
// Its important that we do these first so that we can register with the Windows service control ASAP to avoid timeouts.
"github.com/prometheus-community/windows_exporter/internal/windowsservice"

"context"
"errors"
"fmt"
Expand All @@ -33,10 +30,14 @@
"os/signal"
"os/user"
"runtime"
"runtime/debug"
"slices"
"strings"
"time"

// Its important that we do these first so that we can register with the Windows service control ASAP to avoid timeouts.
"github.com/prometheus-community/windows_exporter/internal/windowsservice"

"github.com/alecthomas/kingpin/v2"
"github.com/prometheus-community/windows_exporter/internal/config"
"github.com/prometheus-community/windows_exporter/internal/httphandler"
Expand Down Expand Up @@ -103,6 +104,10 @@
"process.priority",
"Priority of the exporter process. Higher priorities may improve exporter responsiveness during periods of system load. Can be one of [\"realtime\", \"high\", \"abovenormal\", \"normal\", \"belownormal\", \"low\"]",
).Default("normal").String()
memoryLimit = app.Flag(
"process.memory-limit",
"Limit memory usage in bytes. This is a soft-limit and not guaranteed. 0 means no limit. Read more at https://pkg.go.dev/runtime/debug#SetMemoryLimit .",
).Default("200000000").Int64()
)

logFile := &log.AllowedFile{}
Expand Down Expand Up @@ -132,6 +137,8 @@
return 1
}

debug.SetMemoryLimit(*memoryLimit)

logger, err := log.New(logConfig)
if err != nil {
//nolint:sloglint // we do not have an logger yet
Expand Down
Loading