mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-08 05:56:37 +00:00
chore(deps): update golangci/golangci-lint-action action to v7 (#1976)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
4
.github/workflows/lint.yml
vendored
4
.github/workflows/lint.yml
vendored
@@ -90,8 +90,8 @@ jobs:
|
|||||||
go-version-file: 'go.mod'
|
go-version-file: 'go.mod'
|
||||||
|
|
||||||
- name: golangci-lint
|
- name: golangci-lint
|
||||||
uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6.5.2
|
uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7.0.0
|
||||||
with:
|
with:
|
||||||
# renovate: github=golangci/golangci-lint
|
# renovate: github=golangci/golangci-lint
|
||||||
version: v1.64.8
|
version: v2.0.2
|
||||||
args: "--max-same-issues=0"
|
args: "--max-same-issues=0"
|
||||||
|
|||||||
152
.golangci.yaml
152
.golangci.yaml
@@ -1,5 +1,6 @@
|
|||||||
|
version: "2"
|
||||||
linters:
|
linters:
|
||||||
enable-all: true
|
default: all
|
||||||
disable:
|
disable:
|
||||||
- cyclop
|
- cyclop
|
||||||
- depguard
|
- depguard
|
||||||
@@ -13,74 +14,93 @@ linters:
|
|||||||
- goconst
|
- goconst
|
||||||
- gocyclo
|
- gocyclo
|
||||||
- godot
|
- godot
|
||||||
- paralleltest
|
|
||||||
- lll
|
- lll
|
||||||
- maintidx
|
- maintidx
|
||||||
- mnd
|
- mnd
|
||||||
|
- paralleltest
|
||||||
- testpackage
|
- testpackage
|
||||||
- varnamelen
|
- varnamelen
|
||||||
- wrapcheck
|
- wrapcheck
|
||||||
|
settings:
|
||||||
run:
|
forbidigo:
|
||||||
timeout: 15m
|
forbid:
|
||||||
|
- pattern: ^(fmt\.Print(|f|ln)|print|println)$
|
||||||
output:
|
- pattern: ^syscall\.(.{1,7}|.{7}[^N]|.{9,})$
|
||||||
sort-results: true
|
msg: use golang.org/x/sys/windows instead of syscall
|
||||||
|
- pattern: ^windows\.NewLazyDLL$
|
||||||
linters-settings:
|
msg: use NewLazySystemDLL instead NewLazyDLL
|
||||||
gosec:
|
gosec:
|
||||||
excludes:
|
excludes:
|
||||||
- G101 # Potential hardcoded credentials
|
- G101
|
||||||
- G115 # integer overflow conversion
|
- G115
|
||||||
|
sloglint:
|
||||||
gci:
|
no-mixed-args: true
|
||||||
sections:
|
kv-only: false
|
||||||
- prefix(github.com/prometheus-community/windows_exporter/internal/windowsservice)
|
attr-only: true
|
||||||
- standard # Standard section: captures all standard packages.
|
no-global: all
|
||||||
- default # Default section: contains all imports that could not be matched to another section type.
|
context: scope
|
||||||
custom-order: true
|
static-msg: false
|
||||||
tagliatelle:
|
no-raw-keys: false
|
||||||
case:
|
key-naming-case: snake
|
||||||
use-field-name: true
|
forbidden-keys:
|
||||||
rules:
|
- time
|
||||||
# Any struct tag type can be used.
|
- level
|
||||||
# Support string case: `camel`, `pascal`, `kebab`, `snake`, `upperSnake`, `goCamel`, `goPascal`, `goKebab`, `goSnake`, `upper`, `lower`, `header`
|
- msg
|
||||||
json: camel
|
- source
|
||||||
yaml: snake
|
args-on-sep-lines: true
|
||||||
forbidigo:
|
staticcheck:
|
||||||
forbid:
|
checks:
|
||||||
- "^(fmt\\.Print(|f|ln)|print|println)$"
|
- -ST1003
|
||||||
- p: "^syscall\\.(.{1,7}|.{7}[^N]|.{9,})$"
|
- all
|
||||||
msg: use golang.org/x/sys/windows instead of syscall
|
tagliatelle:
|
||||||
- p: "^windows\\.NewLazyDLL$"
|
case:
|
||||||
msg: use NewLazySystemDLL instead NewLazyDLL
|
rules:
|
||||||
sloglint:
|
json: camel
|
||||||
no-mixed-args: true
|
yaml: snake
|
||||||
kv-only: false
|
use-field-name: true
|
||||||
attr-only: true
|
exclusions:
|
||||||
no-global: "all"
|
generated: lax
|
||||||
context: "scope"
|
presets:
|
||||||
static-msg: false
|
- comments
|
||||||
no-raw-keys: false
|
- common-false-positives
|
||||||
key-naming-case: snake
|
- legacy
|
||||||
forbidden-keys:
|
- std-error-handling
|
||||||
- time
|
rules:
|
||||||
- level
|
- linters:
|
||||||
- msg
|
- revive
|
||||||
- source
|
text: '`?\w+`? should be `?\w+`?'
|
||||||
args-on-sep-lines: true
|
- linters:
|
||||||
stylecheck:
|
- revive
|
||||||
checks: ["all", "-ST1003"]
|
text: don't use ALL_CAPS in Go names; use CamelCase
|
||||||
issues:
|
- path: .+\.go$
|
||||||
exclude:
|
text: don't use underscores in Go names
|
||||||
- don't use underscores in Go names
|
- path: .+\.go$
|
||||||
- don't use an underscore in package name
|
text: don't use an underscore in package name
|
||||||
- exported type .+ should have comment or be unexported
|
- path: .+\.go$
|
||||||
exclude-rules:
|
text: exported type .+ should have comment or be unexported
|
||||||
- # Golint has many capitalisation complaints on WMI class names
|
- linters:
|
||||||
text: "`?\\w+`? should be `?\\w+`?"
|
- staticcheck
|
||||||
linters:
|
text: "ST1003:"
|
||||||
- revive
|
paths:
|
||||||
- text: "don't use ALL_CAPS in Go names; use CamelCase"
|
- third_party$
|
||||||
linters:
|
- builtin$
|
||||||
- revive
|
- examples$
|
||||||
|
formatters:
|
||||||
|
enable:
|
||||||
|
- gci
|
||||||
|
- gofmt
|
||||||
|
- gofumpt
|
||||||
|
- goimports
|
||||||
|
settings:
|
||||||
|
gci:
|
||||||
|
sections:
|
||||||
|
- prefix(github.com/prometheus-community/windows_exporter/internal/windowsservice)
|
||||||
|
- standard
|
||||||
|
- default
|
||||||
|
custom-order: true
|
||||||
|
exclusions:
|
||||||
|
generated: lax
|
||||||
|
paths:
|
||||||
|
- third_party$
|
||||||
|
- builtin$
|
||||||
|
- examples$
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ const (
|
|||||||
subCollectorAutoDiscover = "Autodiscover"
|
subCollectorAutoDiscover = "Autodiscover"
|
||||||
subCollectorWorkloadManagement = "WorkloadManagement"
|
subCollectorWorkloadManagement = "WorkloadManagement"
|
||||||
subCollectorRpcClientAccess = "RpcClientAccess"
|
subCollectorRpcClientAccess = "RpcClientAccess"
|
||||||
subCollectorMapiHttpEmsmdb = "MapiHttpEmsmdb"
|
subCollectorMapiHTTPEmsmdb = "MapiHttpEmsmdb"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
@@ -59,7 +59,7 @@ var ConfigDefaults = Config{
|
|||||||
subCollectorAutoDiscover,
|
subCollectorAutoDiscover,
|
||||||
subCollectorWorkloadManagement,
|
subCollectorWorkloadManagement,
|
||||||
subCollectorRpcClientAccess,
|
subCollectorRpcClientAccess,
|
||||||
subCollectorMapiHttpEmsmdb,
|
subCollectorMapiHTTPEmsmdb,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ type Collector struct {
|
|||||||
collectorAutoDiscover
|
collectorAutoDiscover
|
||||||
collectorAvailabilityService
|
collectorAvailabilityService
|
||||||
collectorHTTPProxy
|
collectorHTTPProxy
|
||||||
collectorMapiHttpEmsmdb
|
collectorMapiHTTPEmsMDB
|
||||||
collectorOWA
|
collectorOWA
|
||||||
collectorRpcClientAccess
|
collectorRpcClientAccess
|
||||||
collectorTransportQueues
|
collectorTransportQueues
|
||||||
@@ -129,7 +129,7 @@ func NewWithFlags(app *kingpin.Application) *Collector {
|
|||||||
subCollectorAutoDiscover: "[29240] MSExchange Autodiscover",
|
subCollectorAutoDiscover: "[29240] MSExchange Autodiscover",
|
||||||
subCollectorWorkloadManagement: "[19430] MSExchange WorkloadManagement Workloads",
|
subCollectorWorkloadManagement: "[19430] MSExchange WorkloadManagement Workloads",
|
||||||
subCollectorRpcClientAccess: "[29336] MSExchange RpcClientAccess",
|
subCollectorRpcClientAccess: "[29336] MSExchange RpcClientAccess",
|
||||||
subCollectorMapiHttpEmsmdb: "[26463] MSExchange MapiHttp Emsmdb",
|
subCollectorMapiHTTPEmsmdb: "[26463] MSExchange MapiHttp Emsmdb",
|
||||||
}
|
}
|
||||||
|
|
||||||
sb := strings.Builder{}
|
sb := strings.Builder{}
|
||||||
@@ -219,10 +219,10 @@ func (c *Collector) Build(_ *slog.Logger, _ *mi.Session) error {
|
|||||||
collect: c.collectRpcClientAccess,
|
collect: c.collectRpcClientAccess,
|
||||||
close: c.perfDataCollectorRpcClientAccess.Close,
|
close: c.perfDataCollectorRpcClientAccess.Close,
|
||||||
},
|
},
|
||||||
subCollectorMapiHttpEmsmdb: {
|
subCollectorMapiHTTPEmsmdb: {
|
||||||
build: c.buildMapiHttpEmsmdb,
|
build: c.buildMapiHTTPEmsMDB,
|
||||||
collect: c.collectMapiHttpEmsmdb,
|
collect: c.collectMapiHTTPEmsMDB,
|
||||||
close: c.perfDataCollectorMapiHttpEmsmdb.Close,
|
close: c.perfDataCollectorMapiHTTPEmsMDB.Close,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,26 +23,26 @@ import (
|
|||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
)
|
)
|
||||||
|
|
||||||
type collectorMapiHttpEmsmdb struct {
|
type collectorMapiHTTPEmsMDB struct {
|
||||||
perfDataCollectorMapiHttpEmsmdb *pdh.Collector
|
perfDataCollectorMapiHTTPEmsMDB *pdh.Collector
|
||||||
perfDataObjectMapiHttpEmsmdb []perfDataCounterValuesMapiHttpEmsmdb
|
perfDataObjectMapiHTTPEmsMDB []perfDataCounterValuesMapiHTTPEmsMDB
|
||||||
|
|
||||||
activeUserCountMapiHttpEmsMDB *prometheus.Desc
|
activeUserCountMapiHTTPEmsMDB *prometheus.Desc
|
||||||
}
|
}
|
||||||
|
|
||||||
type perfDataCounterValuesMapiHttpEmsmdb struct {
|
type perfDataCounterValuesMapiHTTPEmsMDB struct {
|
||||||
ActiveUserCount float64 `perfdata:"Active User Count"`
|
ActiveUserCount float64 `perfdata:"Active User Count"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Collector) buildMapiHttpEmsmdb() error {
|
func (c *Collector) buildMapiHTTPEmsMDB() error {
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
c.perfDataCollectorMapiHttpEmsmdb, err = pdh.NewCollector[perfDataCounterValuesMapiHttpEmsmdb](pdh.CounterTypeRaw, "MSExchange MapiHttp Emsmdb", pdh.InstancesAll)
|
c.perfDataCollectorMapiHTTPEmsMDB, err = pdh.NewCollector[perfDataCounterValuesMapiHTTPEmsMDB](pdh.CounterTypeRaw, "MSExchange MapiHttp Emsmdb", pdh.InstancesAll)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to create MSExchange MapiHttp Emsmdb: %w", err)
|
return fmt.Errorf("failed to create MSExchange MapiHttp Emsmdb: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
c.activeUserCountMapiHttpEmsMDB = prometheus.NewDesc(
|
c.activeUserCountMapiHTTPEmsMDB = prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(types.Namespace, Name, "mapihttp_emsmdb_active_user_count"),
|
prometheus.BuildFQName(types.Namespace, Name, "mapihttp_emsmdb_active_user_count"),
|
||||||
"Number of unique outlook users that have shown some kind of activity in the last 2 minutes",
|
"Number of unique outlook users that have shown some kind of activity in the last 2 minutes",
|
||||||
nil,
|
nil,
|
||||||
@@ -52,15 +52,15 @@ func (c *Collector) buildMapiHttpEmsmdb() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Collector) collectMapiHttpEmsmdb(ch chan<- prometheus.Metric) error {
|
func (c *Collector) collectMapiHTTPEmsMDB(ch chan<- prometheus.Metric) error {
|
||||||
err := c.perfDataCollectorMapiHttpEmsmdb.Collect(&c.perfDataObjectMapiHttpEmsmdb)
|
err := c.perfDataCollectorMapiHTTPEmsMDB.Collect(&c.perfDataObjectMapiHTTPEmsMDB)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to collect MSExchange MapiHttp Emsmdb metrics: %w", err)
|
return fmt.Errorf("failed to collect MSExchange MapiHttp Emsmdb metrics: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, data := range c.perfDataObjectMapiHttpEmsmdb {
|
for _, data := range c.perfDataObjectMapiHTTPEmsMDB {
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.activeUserCountMapiHttpEmsMDB,
|
c.activeUserCountMapiHTTPEmsMDB,
|
||||||
prometheus.GaugeValue,
|
prometheus.GaugeValue,
|
||||||
data.ActiveUserCount,
|
data.ActiveUserCount,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ func (c *MetricsHTTPHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
w.WriteHeader(http.StatusBadRequest)
|
w.WriteHeader(http.StatusBadRequest)
|
||||||
_, _ = w.Write([]byte(fmt.Sprintf("Couldn't create filtered metrics handler: %s", err)))
|
_, _ = fmt.Fprintf(w, "Couldn't create filtered metrics handler: %s", err)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,8 +81,8 @@ func New(config *Config) (*slog.Logger, error) {
|
|||||||
return nil, errors.New("log file undefined")
|
return nil, errors.New("log file undefined")
|
||||||
}
|
}
|
||||||
|
|
||||||
config.Config.Writer = config.File.w
|
config.Writer = config.File.w
|
||||||
config.Config.Style = promslog.SlogStyle
|
config.Style = promslog.SlogStyle
|
||||||
|
|
||||||
return promslog.New(config.Config), nil
|
return promslog.New(config.Config), nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,13 +26,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
applicationID = "windows_exporter"
|
|
||||||
|
|
||||||
LocaleEnglish = "en-us"
|
LocaleEnglish = "en-us"
|
||||||
)
|
)
|
||||||
|
|
||||||
//nolint:gochecknoglobals
|
//nolint:gochecknoglobals
|
||||||
var (
|
var (
|
||||||
|
applicationID = UTF16PtrFromString[*uint16]("windows_exporter")
|
||||||
// DestinationOptionsTimeout is the key for the timeout option.
|
// DestinationOptionsTimeout is the key for the timeout option.
|
||||||
//
|
//
|
||||||
// https://github.com/microsoft/win32metadata/blob/527806d20d83d3abd43d16cd3fa8795d8deba343/generation/WinSDK/RecompiledIdlHeaders/um/mi.h#L7830
|
// https://github.com/microsoft/win32metadata/blob/527806d20d83d3abd43d16cd3fa8795d8deba343/generation/WinSDK/RecompiledIdlHeaders/um/mi.h#L7830
|
||||||
@@ -99,21 +98,16 @@ type DestinationOptionsFT struct {
|
|||||||
GetInterval uintptr
|
GetInterval uintptr
|
||||||
}
|
}
|
||||||
|
|
||||||
// Application_Initialize initializes the MI [Application].
|
// ApplicationInitialize initializes the MI [Application].
|
||||||
// It is recommended to have only one Application per process.
|
// It is recommended to have only one Application per process.
|
||||||
//
|
//
|
||||||
// https://learn.microsoft.com/en-us/windows/win32/api/mi/nf-mi-mi_application_initializev1
|
// https://learn.microsoft.com/en-us/windows/win32/api/mi/nf-mi-mi_application_initializev1
|
||||||
func Application_Initialize() (*Application, error) {
|
func ApplicationInitialize() (*Application, error) {
|
||||||
application := &Application{}
|
application := &Application{}
|
||||||
|
|
||||||
applicationId, err := windows.UTF16PtrFromString(applicationID)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
r0, _, err := procMIApplicationInitialize.Call(
|
r0, _, err := procMIApplicationInitialize.Call(
|
||||||
0,
|
0,
|
||||||
uintptr(unsafe.Pointer(applicationId)),
|
uintptr(unsafe.Pointer(applicationID)),
|
||||||
0,
|
0,
|
||||||
uintptr(unsafe.Pointer(application)),
|
uintptr(unsafe.Pointer(application)),
|
||||||
)
|
)
|
||||||
@@ -129,7 +123,7 @@ func Application_Initialize() (*Application, error) {
|
|||||||
return application, nil
|
return application, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close deinitializes the management infrastructure client API that was initialized through a call to Application_Initialize.
|
// Close deinitializes the management infrastructure client API that was initialized through a call to ApplicationInitialize.
|
||||||
//
|
//
|
||||||
// https://learn.microsoft.com/en-us/windows/win32/api/mi/nf-mi-mi_application_close
|
// https://learn.microsoft.com/en-us/windows/win32/api/mi/nf-mi-mi_application_close
|
||||||
func (application *Application) Close() error {
|
func (application *Application) Close() error {
|
||||||
|
|||||||
@@ -164,29 +164,3 @@ func (instance *Instance) GetClassName() (string, error) {
|
|||||||
|
|
||||||
return windows.UTF16PtrToString(classNameUTF16), nil
|
return windows.UTF16PtrToString(classNameUTF16), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Instance_Print(instance *Instance) (string, error) {
|
|
||||||
elementMap := map[string]any{}
|
|
||||||
|
|
||||||
properties := instance.classDecl.Properties()
|
|
||||||
|
|
||||||
count, err := instance.GetElementCount()
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
|
|
||||||
if count == 0 {
|
|
||||||
return "", nil
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, property := range properties {
|
|
||||||
name := windows.UTF16PtrToString(property.Name)
|
|
||||||
|
|
||||||
element, _ := instance.GetElement(name)
|
|
||||||
value, _ := element.GetValue()
|
|
||||||
|
|
||||||
elementMap[windows.UTF16PtrToString(property.Name)] = value
|
|
||||||
}
|
|
||||||
|
|
||||||
return fmt.Sprintf("%v", elementMap), nil
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func Benchmark_MI_Query_Unmarshal(b *testing.B) {
|
func Benchmark_MI_Query_Unmarshal(b *testing.B) {
|
||||||
application, err := mi.Application_Initialize()
|
application, err := mi.ApplicationInitialize()
|
||||||
require.NoError(b, err)
|
require.NoError(b, err)
|
||||||
require.NotEmpty(b, application)
|
require.NotEmpty(b, application)
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ type win32Process struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Test_MI_Application_Initialize(t *testing.T) {
|
func Test_MI_Application_Initialize(t *testing.T) {
|
||||||
application, err := mi.Application_Initialize()
|
application, err := mi.ApplicationInitialize()
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.NotEmpty(t, application)
|
require.NotEmpty(t, application)
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ func Test_MI_Application_Initialize(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Test_MI_Application_TestConnection(t *testing.T) {
|
func Test_MI_Application_TestConnection(t *testing.T) {
|
||||||
application, err := mi.Application_Initialize()
|
application, err := mi.ApplicationInitialize()
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.NotEmpty(t, application)
|
require.NotEmpty(t, application)
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ func Test_MI_Application_TestConnection(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Test_MI_Query(t *testing.T) {
|
func Test_MI_Query(t *testing.T) {
|
||||||
application, err := mi.Application_Initialize()
|
application, err := mi.ApplicationInitialize()
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.NotEmpty(t, application)
|
require.NotEmpty(t, application)
|
||||||
|
|
||||||
@@ -120,7 +120,7 @@ func Test_MI_Query(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Test_MI_QueryUnmarshal(t *testing.T) {
|
func Test_MI_QueryUnmarshal(t *testing.T) {
|
||||||
application, err := mi.Application_Initialize()
|
application, err := mi.ApplicationInitialize()
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.NotEmpty(t, application)
|
require.NotEmpty(t, application)
|
||||||
|
|
||||||
@@ -155,7 +155,7 @@ func Test_MI_QueryUnmarshal(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Test_MI_EmptyQuery(t *testing.T) {
|
func Test_MI_EmptyQuery(t *testing.T) {
|
||||||
application, err := mi.Application_Initialize()
|
application, err := mi.ApplicationInitialize()
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.NotEmpty(t, application)
|
require.NotEmpty(t, application)
|
||||||
|
|
||||||
@@ -194,7 +194,7 @@ func Test_MI_EmptyQuery(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Test_MI_Query_Unmarshal(t *testing.T) {
|
func Test_MI_Query_Unmarshal(t *testing.T) {
|
||||||
application, err := mi.Application_Initialize()
|
application, err := mi.ApplicationInitialize()
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.NotEmpty(t, application)
|
require.NotEmpty(t, application)
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ func TestCollector[C collector.Collector, V interface{}](t *testing.T, fn func(*
|
|||||||
c := fn(conf)
|
c := fn(conf)
|
||||||
ch := make(chan prometheus.Metric, 10000)
|
ch := make(chan prometheus.Metric, 10000)
|
||||||
|
|
||||||
miApp, err := mi.Application_Initialize()
|
miApp, err := mi.ApplicationInitialize()
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
miSession, err := miApp.NewSession(nil)
|
miSession, err := miApp.NewSession(nil)
|
||||||
|
|||||||
@@ -275,7 +275,7 @@ func (c *Collection) Close() error {
|
|||||||
|
|
||||||
// initMI To be called by the exporter for collector initialization.
|
// initMI To be called by the exporter for collector initialization.
|
||||||
func (c *Collection) initMI() error {
|
func (c *Collection) initMI() error {
|
||||||
app, err := mi.Application_Initialize()
|
app, err := mi.ApplicationInitialize()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error from initialize MI application: %w", err)
|
return fmt.Errorf("error from initialize MI application: %w", err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user