Alertmanager Channel Convertors (alertmanagertypes/channelconvertors.go)

signoz · pkg/types/alertmanagertypes/channelconvertors.go · go · MIT
integration, chat, lang:go, tag:alertmanager, tag:conversion, tag:config

Converts between API notification channel payloads and internal alertmanager Receiver/Channel storage types, deriving configs and counting notifier fields.

// Source: https://github.com/SigNoz/signoz | License: MIT | Copyright 2020-present SigNoz Inc
// Provided via justclaw.it.com; keep this notice with the code.
package alertmanagertypes

import (
	"encoding/json"
	"reflect"
	"time"

	"github.com/SigNoz/signoz/pkg/errors"
	"github.com/SigNoz/signoz/pkg/types"
	"github.com/SigNoz/signoz/pkg/valuer"
	"github.com/prometheus/alertmanager/config"
)

// ════════════════════════════════════════════════════════════════════════
// API -> storage
// ════════════════════════════════════════════════════════════════════════

// ToChannel returns the receiver alongside because the alertmanager config is
// updated from it, not from the channel.
func (p *PostableNotificationChannel) ToChannel(orgID string) (*Channel, *Receiver, error) {
	receiver, err := 

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key