mirror of
https://github.com/status-im/status-go.git
synced 2025-02-11 22:37:41 +00:00
Replace telemetry with local metrics using prometheus client. Add parameters to InitializeApplication for enabling waku metrics over prometheus and specifying which port to use.
37 lines
1.0 KiB
Go
37 lines
1.0 KiB
Go
package requests
|
|
|
|
import (
|
|
"errors"
|
|
)
|
|
|
|
var (
|
|
ErrInitializeApplicationInvalidDataDir = errors.New("initialize-centralized-metric: no dataDir")
|
|
)
|
|
|
|
type InitializeApplication struct {
|
|
DataDir string `json:"dataDir"`
|
|
MixpanelAppID string `json:"mixpanelAppId"`
|
|
MixpanelToken string `json:"mixpanelToken"`
|
|
// MediaServerEnableTLS is optional, if not provided, media server will use TLS by default
|
|
MediaServerEnableTLS *bool `json:"mediaServerEnableTLS"`
|
|
SentryDSN string `json:"sentryDSN"`
|
|
|
|
// LogDir specifies the directory where logs are stored.
|
|
// If empty, logs are stored in the `DataDir`.
|
|
LogDir string `json:"logDir"`
|
|
|
|
LogEnabled bool `json:"logEnabled"`
|
|
LogLevel string `json:"logLevel"`
|
|
APILoggingEnabled bool `json:"apiLoggingEnabled"`
|
|
|
|
MetricsEnabled bool `json:"metricsEnabled"`
|
|
MetricsAddress string `json:"metricsAddress"`
|
|
}
|
|
|
|
func (i *InitializeApplication) Validate() error {
|
|
if len(i.DataDir) == 0 {
|
|
return ErrInitializeApplicationInvalidDataDir
|
|
}
|
|
return nil
|
|
}
|