Documentation
¶
Index ¶
- Constants
- Variables
- type ApplicationCategorySettings
- type ApplicationDeployment
- type ApplicationSettings
- type ApplicationSettingsPyroscope
- type ApplicationSettingsTracing
- type CheckConfigs
- type DB
- func (db *DB) CreateOrUpdateIncident(projectId ProjectId, appId model.ApplicationId, now timeseries.Time, ...) (*model.ApplicationIncident, error)
- func (db *DB) DB() *sql.DB
- func (db *DB) DeleteProject(id ProjectId) error
- func (db *DB) GetApplicationDeployments(projectId ProjectId) (map[model.ApplicationId][]*model.ApplicationDeployment, error)
- func (db *DB) GetApplicationIncidents(projectId ProjectId, from, to timeseries.Time) (map[model.ApplicationId][]*model.ApplicationIncident, error)
- func (db *DB) GetApplicationSettings(projectId ProjectId, appId model.ApplicationId) (*ApplicationSettings, error)
- func (db *DB) GetCheckConfigs(projectId ProjectId) (model.CheckConfigs, error)
- func (db *DB) GetIncidentByKey(projectId ProjectId, key string) (*model.ApplicationIncident, error)
- func (db *DB) GetNotSentIncidentNotifications(from timeseries.Time) ([]IncidentNotification, error)
- func (db *DB) GetPreviousIncidentNotifications(n IncidentNotification) ([]IncidentNotification, error)
- func (db *DB) GetProject(id ProjectId) (*Project, error)
- func (db *DB) GetProjectNames() (map[ProjectId]string, error)
- func (db *DB) GetProjects() ([]*Project, error)
- func (db *DB) GetSentIncidentNotificationsStat(from timeseries.Time) map[IntegrationType]int
- func (db *DB) IsUniqueViolationError(err error) bool
- func (db *DB) Migrate(tables ...Table) error
- func (db *DB) MigrateDefault(extraTables ...Table) error
- func (db *DB) PutIncidentNotification(n IncidentNotification)
- func (db *DB) SaveApplicationCategory(id ProjectId, category, newName model.ApplicationCategory, ...) error
- func (db *DB) SaveApplicationDeployment(projectId ProjectId, d *model.ApplicationDeployment) error
- func (db *DB) SaveApplicationDeploymentMetricsSnapshot(projectId ProjectId, d *model.ApplicationDeployment) error
- func (db *DB) SaveApplicationDeploymentNotifications(projectId ProjectId, d *model.ApplicationDeployment) error
- func (db *DB) SaveApplicationSetting(projectId ProjectId, appId model.ApplicationId, s any) error
- func (db *DB) SaveCheckConfig(projectId ProjectId, appId model.ApplicationId, checkId model.CheckId, cfg any) error
- func (db *DB) SaveIntegrationsBaseUrl(id ProjectId, baseUrl string) error
- func (db *DB) SaveProject(p Project) (ProjectId, error)
- func (db *DB) SaveProjectIntegration(p *Project, typ IntegrationType) error
- func (db *DB) ToggleConfigurationHint(id ProjectId, appType model.ApplicationType, mute bool) error
- func (db *DB) Type() Type
- func (db *DB) UpdateIncidentNotification(n IncidentNotification) error
- type Incident
- type IncidentNotification
- type IncidentNotificationDetails
- type IncidentNotificationDetailsReport
- type IntegrationClickhouse
- type IntegrationInfo
- type IntegrationOpsgenie
- type IntegrationPagerduty
- type IntegrationPyroscope
- type IntegrationSlack
- type IntegrationTeams
- type IntegrationType
- type Integrations
- type IntegrationsPrometheus
- type Migrator
- type Project
- type ProjectId
- type Settings
- type Table
- type Type
Constants ¶
View Source
const (
DefaultRefreshInterval = 30
)
View Source
const (
DeploymentsLastN = 100
)
Variables ¶
View Source
var ( ErrNotFound = errors.New("not found") ErrConflict = errors.New("conflict") )
Functions ¶
This section is empty.
Types ¶
type ApplicationCategorySettings ¶
type ApplicationCategorySettings struct {
NotifyOfDeployments bool `json:"notify_of_deployments"`
}
type ApplicationDeployment ¶
type ApplicationDeployment model.ApplicationDeployment
func (*ApplicationDeployment) Migrate ¶
func (ad *ApplicationDeployment) Migrate(m *Migrator) error
type ApplicationSettings ¶
type ApplicationSettings struct {
Pyroscope *ApplicationSettingsPyroscope `json:"pyroscope,omitempty"`
Tracing *ApplicationSettingsTracing `json:"tracing,omitempty"`
}
func (*ApplicationSettings) Migrate ¶
func (s *ApplicationSettings) Migrate(m *Migrator) error
type ApplicationSettingsPyroscope ¶
type ApplicationSettingsPyroscope struct {
Application string `json:"application"`
}
type ApplicationSettingsTracing ¶
type ApplicationSettingsTracing struct {
Service string `json:"service"`
}
type CheckConfigs ¶
type CheckConfigs struct{}
func (*CheckConfigs) Migrate ¶
func (cc *CheckConfigs) Migrate(m *Migrator) error
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) CreateOrUpdateIncident ¶
func (db *DB) CreateOrUpdateIncident(projectId ProjectId, appId model.ApplicationId, now timeseries.Time, severity model.Status) (*model.ApplicationIncident, error)
func (*DB) DeleteProject ¶
func (*DB) GetApplicationDeployments ¶
func (db *DB) GetApplicationDeployments(projectId ProjectId) (map[model.ApplicationId][]*model.ApplicationDeployment, error)
func (*DB) GetApplicationIncidents ¶
func (db *DB) GetApplicationIncidents(projectId ProjectId, from, to timeseries.Time) (map[model.ApplicationId][]*model.ApplicationIncident, error)
func (*DB) GetApplicationSettings ¶
func (db *DB) GetApplicationSettings(projectId ProjectId, appId model.ApplicationId) (*ApplicationSettings, error)
func (*DB) GetCheckConfigs ¶
func (db *DB) GetCheckConfigs(projectId ProjectId) (model.CheckConfigs, error)
func (*DB) GetIncidentByKey ¶
func (*DB) GetNotSentIncidentNotifications ¶
func (db *DB) GetNotSentIncidentNotifications(from timeseries.Time) ([]IncidentNotification, error)
func (*DB) GetPreviousIncidentNotifications ¶
func (db *DB) GetPreviousIncidentNotifications(n IncidentNotification) ([]IncidentNotification, error)
func (*DB) GetProjects ¶
func (*DB) GetSentIncidentNotificationsStat ¶
func (db *DB) GetSentIncidentNotificationsStat(from timeseries.Time) map[IntegrationType]int
func (*DB) IsUniqueViolationError ¶
func (*DB) MigrateDefault ¶
func (*DB) PutIncidentNotification ¶
func (db *DB) PutIncidentNotification(n IncidentNotification)
func (*DB) SaveApplicationCategory ¶
func (*DB) SaveApplicationDeployment ¶
func (db *DB) SaveApplicationDeployment(projectId ProjectId, d *model.ApplicationDeployment) error
func (*DB) SaveApplicationDeploymentMetricsSnapshot ¶
func (db *DB) SaveApplicationDeploymentMetricsSnapshot(projectId ProjectId, d *model.ApplicationDeployment) error
func (*DB) SaveApplicationDeploymentNotifications ¶
func (db *DB) SaveApplicationDeploymentNotifications(projectId ProjectId, d *model.ApplicationDeployment) error
func (*DB) SaveApplicationSetting ¶
func (*DB) SaveCheckConfig ¶
func (*DB) SaveIntegrationsBaseUrl ¶
func (*DB) SaveProjectIntegration ¶
func (db *DB) SaveProjectIntegration(p *Project, typ IntegrationType) error
func (*DB) ToggleConfigurationHint ¶
func (*DB) UpdateIncidentNotification ¶
func (db *DB) UpdateIncidentNotification(n IncidentNotification) error
type Incident ¶
type Incident model.ApplicationIncident
type IncidentNotification ¶
type IncidentNotification struct {
ProjectId ProjectId
ApplicationId model.ApplicationId
IncidentKey string
Status model.Status
Destination IntegrationType
Timestamp timeseries.Time
SentAt timeseries.Time
ExternalKey string
Details *IncidentNotificationDetails
}
func (*IncidentNotification) Migrate ¶
func (n *IncidentNotification) Migrate(m *Migrator) error
type IncidentNotificationDetails ¶
type IncidentNotificationDetails struct {
Reports []IncidentNotificationDetailsReport `json:"reports"`
}
type IncidentNotificationDetailsReport ¶
type IncidentNotificationDetailsReport struct {
Name model.AuditReportName `json:"name"`
Check string `json:"check"`
Message string `json:"message"`
}
type IntegrationClickhouse ¶
type IntegrationInfo ¶
type IntegrationOpsgenie ¶
type IntegrationPagerduty ¶
type IntegrationPyroscope ¶
type IntegrationSlack ¶
type IntegrationTeams ¶
type IntegrationType ¶
type IntegrationType string
const ( IntegrationTypePrometheus IntegrationType = "prometheus" IntegrationTypePyroscope IntegrationType = "pyroscope" IntegrationTypeClickhouse IntegrationType = "clickhouse" IntegrationTypeSlack IntegrationType = "slack" IntegrationTypePagerduty IntegrationType = "pagerduty" IntegrationTypeTeams IntegrationType = "teams" IntegrationTypeOpsgenie IntegrationType = "opsgenie" )
type Integrations ¶
type Integrations struct {
BaseUrl string `json:"base_url"`
Slack *IntegrationSlack `json:"slack,omitempty"`
Pagerduty *IntegrationPagerduty `json:"pagerduty,omitempty"`
Teams *IntegrationTeams `json:"teams,omitempty"`
Opsgenie *IntegrationOpsgenie `json:"opsgenie,omitempty"`
Pyroscope *IntegrationPyroscope `json:"pyroscope,omitempty"`
Clickhouse *IntegrationClickhouse `json:"clickhouse,omitempty"`
}
func (Integrations) GetInfo ¶
func (integrations Integrations) GetInfo() []IntegrationInfo
type IntegrationsPrometheus ¶
type IntegrationsPrometheus struct {
Url string `json:"url"`
RefreshInterval timeseries.Duration `json:"refresh_interval"`
TlsSkipVerify bool `json:"tls_skip_verify"`
BasicAuth *utils.BasicAuth `json:"basic_auth"`
ExtraSelector string `json:"extra_selector"`
CustomHeaders []utils.Header `json:"custom_headers"`
}
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
func (*Migrator) AddColumnIfNotExists ¶
type Project ¶
type Project struct {
Id ProjectId
Name string
Prometheus IntegrationsPrometheus
Settings Settings
}
type Settings ¶
type Settings struct {
ConfigurationHintsMuted map[model.ApplicationType]bool `json:"configuration_hints_muted"`
ApplicationCategories map[model.ApplicationCategory][]string `json:"application_categories"`
ApplicationCategorySettings map[model.ApplicationCategory]ApplicationCategorySettings `json:"application_category_settings"`
Integrations Integrations `json:"integrations"`
}
Click to show internal directories.
Click to hide internal directories.