config.go
config.go - Overview
This file defines the configuration structure for the Alertmanager component within the SigNoz platform. It includes configurations for different Alertmanager providers (internal and legacy) and related settings like poll intervals and API URLs.
Detailed Documentation
Config
- Purpose: Defines the overall configuration structure for the Alertmanager. It specifies the provider type and configurations specific to each provider.
- Parameters: None
- Returns: None
Fields:
Provider
:- Type:
string
- Description: Specifies the provider for the Alertmanager service (e.g., "legacy").
- Type:
Signoz
:- Type:
Signoz
- Description: Configuration for the internal SigNoz Alertmanager.
- Type:
Legacy
:- Type:
Legacy
- Description: Configuration for the legacy Alertmanager.
- Type:
Signoz
- Purpose: Defines the configuration structure for the internal SigNoz Alertmanager.
- Parameters: None
- Returns: None
Fields:
PollInterval
:- Type:
time.Duration
- Description: The interval at which the Alertmanager is synced.
- Type:
Config
:- Type:
alertmanagerserver.Config
- Description: Configuration for the alertmanager server. This is embedded using
squash
, meaning the fields ofalertmanagerserver.Config
are directly included inSignoz
.
- Type:
Legacy
- Purpose: Defines the configuration structure for the legacy Alertmanager.
- Parameters: None
- Returns: None
Fields:
ApiURL
:- Type:
*url.URL
- Description: The URL of the legacy SigNoz Alertmanager API.
- Type:
NewConfigFactory
- Purpose: Creates a new
factory.ConfigFactory
for the Alertmanager configuration. - Parameters: None
- Returns:
- Type:
factory.ConfigFactory
- Description: A new configuration factory instance.
- Type:
newConfig
- Purpose: Creates a new default
Config
instance for the Alertmanager. - Parameters: None
- Returns:
- Type:
factory.Config
- Description: A new
Config
instance with default values.
- Type:
(Config) Validate
- Purpose: Placeholder for configuration validation logic. Currently, it always returns
nil
(no error). - Parameters:
c
:- Type:
Config
- Description: The configuration to validate.
- Type:
- Returns:
- Type:
error
- Description: Returns
nil
indicating no validation errors.
- Type:
Code Examples
None
Clarity and Accuracy
The documentation aims to be precise based on the code.
Include in Getting Started: NO