Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions config/notifiers.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ var (
AgentID: `{{ template "wechat.default.agent_id" . }}`,
}

// DefaultVictorOpsConfig defines default values for VictorOps configurations.
// DefaultVictorOpsConfig defines default values for Splunk On-Call configurations.
DefaultVictorOpsConfig = VictorOpsConfig{
NotifierConfig: amcommoncfg.NotifierConfig{
VSendResolved: true,
Expand Down Expand Up @@ -388,7 +388,8 @@ func (c *WechatConfig) UnmarshalYAML(unmarshal func(any) error) error {
return nil
}

// VictorOpsConfig configures notifications via VictorOps.
// VictorOpsConfig configures notifications through Splunk On-Call.
// The type name is retained for configuration compatibility.
type VictorOpsConfig struct {
amcommoncfg.NotifierConfig `yaml:",inline" json:",inline"`

Expand Down
16 changes: 10 additions & 6 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ global:
[ slack_app_token_file: <filepath> ]
[ slack_app_url: <string> ]

# The default API key to use when talking to the VictorOps API.
# The default API key to use when talking to the Splunk On-Call API.
# It is mutually exclusive with `victorops_api_key_file`.
[ victorops_api_key: <secret> ]
# Reads the default API key to use when talking to the VictorOps API from a file.
# Reads the default API key to use when talking to the Splunk On-Call API from a file.
# It is mutually exclusive with `victorops_api_key`.
[ victorops_api_key_file: <filepath> ]
[ victorops_api_url: <string> | default = "https://alert.victorops.com/integrations/generic/20131114/alert/" ]
Expand Down Expand Up @@ -1904,21 +1904,25 @@ attributes:

### `<victorops_config>`

VictorOps notifications are sent out via the [VictorOps API](https://help.victorops.com/knowledge-base/rest-endpoint-integration-guide/)
Splunk On-Call (formerly VictorOps) notifications are sent through the
[Splunk On-Call REST endpoint integration](https://help.splunk.com/en/splunk-enterprise/alert-and-respond/splunk-on-call/integrations-with-splunk-on-call/rest-endpoint-integration-for-splunk-on-call).
The `victorops_config` name and related `victorops_*` global fields are retained
Comment thread
SoloJacobs marked this conversation as resolved.
for backward compatibility. Metrics, logs, traces, and validation errors also
continue to use the VictorOps identifier so existing integrations remain stable.

```yaml
# Whether to notify about resolved alerts.
[ send_resolved: <boolean> | default = true ]

# The API key to use when talking to the VictorOps API.
# The API key to use when talking to the Splunk On-Call API.
# It is mutually exclusive with `api_key_file`.
[ api_key: <secret> | default = global.victorops_api_key ]

# Reads the API key to use when talking to the VictorOps API from a file.
# Reads the API key to use when talking to the Splunk On-Call API from a file.
# It is mutually exclusive with `api_key`.
[ api_key_file: <filepath> | default = global.victorops_api_key_file ]

# The VictorOps API URL.
# The Splunk On-Call API URL.
[ api_url: <string> | default = global.victorops_api_url ]

# A key used to map the alert to a team.
Expand Down
2 changes: 1 addition & 1 deletion docs/integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Alertmanager supports a number of notification integrations via the [configurati
| [Rocket.Chat](https://rocket.chat/) | [rocketchat_config](configuration.md#rocketchat_config) | [Personal Access Tokens](https://docs.rocket.chat/use-rocket.chat/user-guides/user-panel/my-account#personal-access-tokens) | [Rocket.Chat REST API](https://developer.rocket.chat/reference/api/rest-api/endpoints/messaging/chat-endpoints/postmessage) |
| [Slack](https://slack.com/) | [slack_config](configuration.md#slack_config) | [Incoming Webhooks](https://api.slack.com/messaging/webhooks) / [Bot Tokens](https://api.slack.com/authentication/token-types) | [Slack API](https://api.slack.com/methods/chat.postMessage) |
| [Telegram](https://telegram.org/) | [telegram_config](configuration.md#telegram_config) | [Telegram Bots](https://core.telegram.org/bots) | [Telegram Bot API](https://core.telegram.org/bots/api) |
| [VictorOps](https://victorops.com/) | [victorops_config](configuration.md#victorops_config) | [REST Endpoint Integration Guide](https://help.victorops.com/knowledge-base/rest-endpoint-integration-guide/) | [VictorOps REST API](https://help.victorops.com/knowledge-base/rest-endpoint-integration-guide/) |
| [Splunk On-Call](https://help.splunk.com/en/splunk-enterprise/alert-and-respond/splunk-on-call/introduction-to-splunk-on-call/getting-started-guide-for-splunk-on-call-admins) (formerly VictorOps) | [victorops_config](configuration.md#victorops_config) | [REST Endpoint Integration Guide](https://help.splunk.com/en/splunk-enterprise/alert-and-respond/splunk-on-call/integrations-with-splunk-on-call/rest-endpoint-integration-for-splunk-on-call) | [REST Endpoint Reference](https://help.splunk.com/en/splunk-enterprise/alert-and-respond/splunk-on-call/integrations-with-splunk-on-call/rest-endpoint-integration-for-splunk-on-call) |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are these links coming from, is that really that best resource?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the current official help.splunk.com pages for the Splunk On-Call getting-started guide and REST endpoint integration. I also rechecked both links directly today; each returns HTTP 200. The integration guide is the closest current official replacement for the retired VictorOps guide.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but the links are identical, aren't they? I don't really think it makes sense to list the same link under the same header.

Also, the victorops.com site forwards to a different website, and not the help article. What was the rational behind that change?

If you want to change the urls, you have to read the content and compare them, not just the status code.

| [Webex](https://www.webex.com/) | [webex_config](configuration.md#webex_config) | [Webex for Developers](https://developer.webex.com/) | [Webex Messages API](https://developer.webex.com/docs/api/v1/messages) |
| [Webhook](https://en.wikipedia.org/wiki/Webhook) | [webhook_config](configuration.md#webhook_config) | [Webhook Integrations](https://prometheus.io/docs/operating/integrations/#alertmanager-webhook-receiver) | - |
| [WeChat](https://www.wechat.com/) | [wechat_config](configuration.md#wechat_config) | [WeChat Work Documentation](https://developers.weixin.qq.com/doc/offiaccount/en/Message_Management/Service_Center_messages.html) | [WeChat Work API](https://developers.weixin.qq.com/doc/offiaccount/en/Message_Management/Service_Center_messages.html) |
Expand Down
9 changes: 5 additions & 4 deletions notify/victorops/victorops.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ import (
"github.com/prometheus/alertmanager/types"
)

// https://help.victorops.com/knowledge-base/incident-fields-glossary/ - 20480 characters.
// The Splunk On-Call incident fields glossary documents a 20480-character limit.
// https://help.splunk.com/en/splunk-enterprise/alert-and-respond/splunk-on-call/alerts/incident-fields-glossary
const maxMessageLenRunes = 20480

// Notifier implements a Notifier for VictorOps notifications.
// Notifier implements a Notifier for Splunk On-Call notifications.
type Notifier struct {
conf *config.VictorOpsConfig
tmpl *template.Template
Expand All @@ -44,7 +45,7 @@ type Notifier struct {
retrier *notify.Retrier
}

// New returns a new VictorOps notifier.
// New returns a new Splunk On-Call notifier.
func New(c *config.VictorOpsConfig, t *template.Template, l *slog.Logger, httpOpts ...commoncfg.HTTPClientOption) (*Notifier, error) {
client, err := notify.NewClientWithTracing(*c.HTTPConfig, "victorops", httpOpts...)
if err != nil {
Expand Down Expand Up @@ -109,7 +110,7 @@ func (n *Notifier) Notify(ctx context.Context, as ...*types.Alert) (bool, error)
return shouldRetry, err
}

// Create the JSON payload to be sent to the VictorOps API.
// createVictorOpsPayload creates the JSON payload sent to the Splunk On-Call API.
func (n *Notifier) createVictorOpsPayload(ctx context.Context, as ...*types.Alert) (*bytes.Buffer, error) {
victorOpsAllowedEvents := map[string]bool{
"INFO": true,
Expand Down