Skip to main content

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").
  • Signoz:
    • Type: Signoz
    • Description: Configuration for the internal SigNoz Alertmanager.
  • Legacy:
    • Type: Legacy
    • Description: Configuration for the legacy Alertmanager.

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.
  • Config:
    • Type: alertmanagerserver.Config
    • Description: Configuration for the alertmanager server. This is embedded using squash, meaning the fields of alertmanagerserver.Config are directly included in Signoz.

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.

NewConfigFactory

  • Purpose: Creates a new factory.ConfigFactory for the Alertmanager configuration.
  • Parameters: None
  • Returns:
    • Type: factory.ConfigFactory
    • Description: A new configuration factory instance.

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.

(Config) Validate

  • Purpose: Placeholder for configuration validation logic. Currently, it always returns nil (no error).
  • Parameters:
    • c:
      • Type: Config
      • Description: The configuration to validate.
  • Returns:
    • Type: error
    • Description: Returns nil indicating no validation errors.

Code Examples

None

Clarity and Accuracy

The documentation aims to be precise based on the code.

Include in Getting Started: NO