profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/bsnyder788/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Brett Snyder bsnyder788 @digitalocean OH Computer Scientist & Software Engineer

bsnyder788/18xx 0

A platform for playing 18xx games online!

bsnyder788/clojure-deps-edn 0

A collection of useful configuration and aliases for deps.edn based projects

bsnyder788/cockroach 0

CockroachDB - the open source, cloud-native SQL database.

bsnyder788/cortex 0

A horizontally scalable, highly available, multi-tenant, long term Prometheus.

bsnyder788/docbook4j 0

Simple embeddable java library able to render docbook documents into the well-known target formats (html, pdf, man,...).

bsnyder788/docker-vassal 0

Docker image for VASSAL, an open-source game engine for building and playing online adaptations of board games and card games

bsnyder788/doctl 0

The official command line interface for the DigitalOcean API.

bsnyder788/Elixir-Slack 0

Slack real time messaging and web API client in Elixir

bsnyder788/gleam 0

✨ A statically typed language for the Erlang VM

push eventdigitalocean/prometheus

Brett Snyder

commit sha ea0159db1dbed3a5b55ad1eab110c0ff6f092af5

add grpc streaming remote write endpoint

view details

push time in 14 hours

startedachannarasappa/ticker

started time in 2 days

PullRequestReviewEvent

Pull request review commentdigitalocean/do-agent

Added AlmaLinux OS Support

 function check_dist() { 	dist=$(echo "${dist}" | tr '[:upper:]' '[:lower:]')  	case "${dist}" in-		debian|ubuntu|centos|fedora)+		debian|ubuntu|centos|fedora|almalinux) 			echo "OK" 			;; 		cloudlinux)

Since almalinux is not officially supported by DO, can you move almalinux down to this block with cloudlinux ? \

nixjobin

comment created time in 2 days

PullRequestReviewEvent
PullRequestReviewEvent

issue commentdigitalocean/do-agent

do-agent --collector.<name> flags are confusing

still valid

alzeih

comment created time in 15 days

delete branch digitalocean/do-agent

delete branch : go117

delete time in 25 days

push eventdigitalocean/do-agent

Brett Snyder

commit sha cc3c845cbb70b824832af1c3be7f40c685136c01

upgrade to go1.17 (#249)

view details

push time in 25 days

PR merged digitalocean/do-agent

upgrade to go1.17
+2 -2

0 comment

2 changed files

bsnyder788

pr closed time in 25 days

PR opened digitalocean/do-agent

upgrade to go1.17
+2 -2

0 comment

2 changed files

pr created time in a month

create barnchdigitalocean/do-agent

branch : go117

created branch time in a month

fork bsnyder788/docker-vassal

Docker image for VASSAL, an open-source game engine for building and playing online adaptations of board games and card games

fork in a month

push eventdigitalocean/prometheus

Julius Volz

commit sha a3270a3a0f0db1f9d87e73c00420f73ebe2099e3

Add new "globalUrl" field to /api/v1/targets docs See https://github.com/prometheus/prometheus/pull/6794 Signed-off-by: Julius Volz <julius.volz@gmail.com>

view details

Krasi Georgiev

commit sha 9a75b5f84b01b891c7a2c6a003c3be8b83d97bcd

Avoid panic when the headChunk is nil during isolation. Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>

view details

Ganesh Vernekar

commit sha 30b2592fb5456954d51f9280f5035e32cd360336

Avoid empty mmap files by using .tmp files to write headers Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>

view details

Ganesh Vernekar

commit sha 64859ccbe6133e2e95127e2d2b3289e913f4d1ef

Merge pull request #7656 from codesome/release-2.19 Cherry pick commits for 2.19.3

view details

Ganesh Vernekar

commit sha 657ba532e42f1db8d7c77bf802378643da0d3118

Cut v2.19.3 (#7657) Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>

view details

jessicagreben

commit sha 7504b5ce7ccb5f38413a5342e6c1ec01da5ef99b

add rule importer with tsdb block writer Signed-off-by: jessicagreben <Jessica.greben1+github@gmail.com>

view details

jessicagreben

commit sha dfa510086be77f0a180362d35f7e16a079e911c9

add alignment, mv rule importer to promtool dir, add queryRange Signed-off-by: jessicagreben <jessicagrebens@gmail.com>

view details

jessicagreben

commit sha 2e526cf2a7b26706701878e2095f6c8127160269

add output dir parameter Signed-off-by: jessicagreben <jessicagrebens@gmail.com>

view details

jessicagreben

commit sha 36ac0b68f1997d061561ccfc3188f5d74e8eb453

merge master, fix conflicts

view details

jessicagreben

commit sha 3ed6457dd4d2f04ef8ad9f54366bbc349951c2c5

use blockwriter, rm multiwriter code Signed-off-by: jessicagreben <jessicagrebens@gmail.com>

view details

jessicagreben

commit sha 6980bcf6716426f8a5057bf0cb88f9a3bc443920

unexport backfiller Signed-off-by: jessicagreben <jessicagrebens@gmail.com>

view details

jessicagreben

commit sha 61c9a89120a24eae6112278d8019f0a2bed5f544

use milliseconds for blocksize Signed-off-by: jessicagreben <jessicagrebens@gmail.com>

view details

jessicagreben

commit sha 75654715d3be4476a473239dcc28a042e9ecbed6

fix panics Signed-off-by: jessicagreben <jessicagrebens@gmail.com>

view details

jessicagreben

commit sha 19dee0a5699c67191d352aa3c86d4ab4c341a879

add name and labels to metric, eval all rules for each block Signed-off-by: jessicagreben <jessicagrebens@gmail.com>

view details

jessicagreben

commit sha 5dd3577424008e6828952092b0b36fee9adb5c67

change name of promtool subcommand to create-blocks-from Signed-off-by: jessicagreben <jessicagrebens@gmail.com>

view details

jessicagreben

commit sha ee85c22adbc58308807b2c15d994d342afc4290e

flush samples to disk every 5k samples Signed-off-by: jessicagreben <jessicagrebens@gmail.com>

view details

jessicagreben

commit sha ac06d0a6570c53b42273da414f94f73f5e0e25cd

merge master/resolve conflict Signed-off-by: jessicagreben <jessicagrebens@gmail.com>

view details

jessicagreben

commit sha 2e9946e4d7407df3feaf673298e58c33b96f799b

add test Signed-off-by: jessicagreben <jessicagrebens@gmail.com>

view details

jessicagreben

commit sha cec3515fa3660de0307f88a3ee88778e6828722d

fix linter Signed-off-by: jessicagreben <jessicagrebens@gmail.com>

view details

jessicagreben

commit sha e32e4fcc5392864c88c2be30d950919f9cf0c134

fix unit test Signed-off-by: jessicagreben <jessicagrebens@gmail.com>

view details

push time in a month

push eventdigitalocean/prometheus

Matthew Smedberg

commit sha 8490273bac8f01f37833e7dcb5aacd9fb2b44a67

docs :: querying :: functions :: label_replace Clarify documentation for label_replace() because of ambiguities between label keys and label values. Signed-off-by: Matthew Smedberg <matthew.smedberg@gmail.com>

view details

Hu Shuai

commit sha 996848ef40650b6d95a41cb33f1ecbedb7ce088e

Fix golint issue Signed-off-by: Hu Shuai <hus.fnst@cn.fujitsu.com>

view details

Julien Pivotto

commit sha 0a28f1ae9d33b71ed2240d8e000ca5d73f6874fd

Merge pull request #8796 from hs0210/work Fix golint issue

view details

Julius Volz

commit sha e313ffa8abf61b5e2df3e917e2f31a899c91b66c

Fix "instant selector vector" typo in error messages (#8800) Signed-off-by: Julius Volz <julius.volz@gmail.com>

view details

songjiayang

commit sha 9a014727804451a4294f3886de63126de0c9938b

Refactor processExternalLabels method with slice copy for left labels Signed-off-by: songjiayang <songjiayang1@gmail.com>

view details

ide-rea

commit sha 277bac622ac74240bbe6b75cbe96fe3472a7dc48

validate exemplar labelSet length first (#8816) * ignore check exemplar labelSet length when append Signed-off-by: XiaoYu Zhang <ideoutrea@163.com> * validate exemplar labelSet length firstly Signed-off-by: XiaoYu Zhang <ideoutrea@163.com>

view details

kcx2366425574

commit sha be9c870b06fd0d032e9c83fd247fbe681b1bef8e

remove the param that is not used Signed-off-by: kcx2366425574 <kuangcx@inspur.com>

view details

kjinan

commit sha 24869ff2d0ff8c057ab3fb6a336ec503fb9f7cad

typos correct Signed-off-by: kjinan <2008kongxiangsheng@163.com>

view details

Julien Pivotto

commit sha a40743c4c05e6bd915a138af7eebd849427e84b6

Merge pull request #8819 from prometheus/release-2.27 Merge Relase 2.27 back to main

view details

Julien Pivotto

commit sha 11bcb9310064ef166b582a82aa8fd07e1cec6545

Merge pull request #8826 from kjinan/main typos correct

view details

Julien Pivotto

commit sha e1774b6f83a7554c91fa52bc420982dd0ac5a1e1

Fix the computation of prometheus_sd_discovered_targets prometheus_sd_discovered_targets is wrongly calculated when there are multiple SD configurations in place. One discovery manager can have multiple groups coming from multiple service discoveries. When multiple service discovery configs are used, we do not compute the metric correctly, and instead just set the metric to one of the service discoveries. Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>

view details

Sandro

commit sha 0ffcddbee8dd12739daabbe7c262ee889798a09f

Fix indentation Signed-off-by: Sandro Jäckel <sandro.jaeckel@gmail.com>

view details

Julien Pivotto

commit sha 58a6c7d69967db072f4458b3970a652139ff1f81

Merge pull request #8834 from SuperSandro2000/patch-1 Fix indentation

view details

Chris Marchbanks

commit sha 4bf7de3b5666551a4ddf274647d50353460828db

Merge pull request #8841 from prometheus/release-2.27 Merge 2.27.1 into main

view details

Matthias Loibl

commit sha 7e7efaba32311b53846c4e931824b535b4331e7d

storage: Split chunks if more than 120 samples (#8582) * storage: Split chunks if more than 120 samples Signed-off-by: Matthias Loibl <mail@matthiasloibl.com> * storage: Don't set maxt which is overwritten right away Signed-off-by: Matthias Loibl <mail@matthiasloibl.com> * storage: Improve comments on merge_test Signed-off-by: Matthias Loibl <mail@matthiasloibl.com> * storage: Improve comments and move code closer to usage Signed-off-by: Matthias Loibl <mail@matthiasloibl.com> * tsdb/tsdbutil: Add comment for GenerateSamples Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>

view details

Ben Ye

commit sha 0a8912433a457b54a871df75e72afc3e45a31d5c

allow compact series merger to be configurable (#8836) Signed-off-by: yeya24 <yb532204897@gmail.com>

view details

Julius Volz

commit sha e6bb865ad44a8e145850f6541aabba9a044bfc94

Add upcoming release shepherds and new releases (#8842) Signed-off-by: Julius Volz <julius.volz@gmail.com>

view details

Ben Ye

commit sha d95b0972505f61be0b23b4dfedb8b4816392491b

expose seriesToChunkEncoder (#8845) Signed-off-by: yeya24 <yb532204897@gmail.com>

view details

Julien Pivotto

commit sha ea33dbf80f9d14da046d1e8ef97acfe17d2c8aaa

Merge pull request #8822 from kcx2366425574/main remove unused param

view details

kjinan

commit sha e1370eecde7af30c8867089df3e93acee5e32df5

typos correct Signed-off-by: kjinan <2008kongxiangsheng@163.com>

view details

push time in a month

create barnchdigitalocean/prometheus

branch : remote_write_2_29_1

created branch time in a month

create barnchbsnyder788/godo

branch : insights-add-other-bandwidth-alert-types

created branch time in a month

push eventdigitalocean/prometheus

Julius Volz

commit sha a3270a3a0f0db1f9d87e73c00420f73ebe2099e3

Add new "globalUrl" field to /api/v1/targets docs See https://github.com/prometheus/prometheus/pull/6794 Signed-off-by: Julius Volz <julius.volz@gmail.com>

view details

Krasi Georgiev

commit sha 9a75b5f84b01b891c7a2c6a003c3be8b83d97bcd

Avoid panic when the headChunk is nil during isolation. Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>

view details

Ganesh Vernekar

commit sha 30b2592fb5456954d51f9280f5035e32cd360336

Avoid empty mmap files by using .tmp files to write headers Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>

view details

Ganesh Vernekar

commit sha 64859ccbe6133e2e95127e2d2b3289e913f4d1ef

Merge pull request #7656 from codesome/release-2.19 Cherry pick commits for 2.19.3

view details

Ganesh Vernekar

commit sha 657ba532e42f1db8d7c77bf802378643da0d3118

Cut v2.19.3 (#7657) Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>

view details

jessicagreben

commit sha 7504b5ce7ccb5f38413a5342e6c1ec01da5ef99b

add rule importer with tsdb block writer Signed-off-by: jessicagreben <Jessica.greben1+github@gmail.com>

view details

jessicagreben

commit sha dfa510086be77f0a180362d35f7e16a079e911c9

add alignment, mv rule importer to promtool dir, add queryRange Signed-off-by: jessicagreben <jessicagrebens@gmail.com>

view details

jessicagreben

commit sha 2e526cf2a7b26706701878e2095f6c8127160269

add output dir parameter Signed-off-by: jessicagreben <jessicagrebens@gmail.com>

view details

jessicagreben

commit sha 36ac0b68f1997d061561ccfc3188f5d74e8eb453

merge master, fix conflicts

view details

jessicagreben

commit sha 3ed6457dd4d2f04ef8ad9f54366bbc349951c2c5

use blockwriter, rm multiwriter code Signed-off-by: jessicagreben <jessicagrebens@gmail.com>

view details

jessicagreben

commit sha 6980bcf6716426f8a5057bf0cb88f9a3bc443920

unexport backfiller Signed-off-by: jessicagreben <jessicagrebens@gmail.com>

view details

jessicagreben

commit sha 61c9a89120a24eae6112278d8019f0a2bed5f544

use milliseconds for blocksize Signed-off-by: jessicagreben <jessicagrebens@gmail.com>

view details

jessicagreben

commit sha 75654715d3be4476a473239dcc28a042e9ecbed6

fix panics Signed-off-by: jessicagreben <jessicagrebens@gmail.com>

view details

jessicagreben

commit sha 19dee0a5699c67191d352aa3c86d4ab4c341a879

add name and labels to metric, eval all rules for each block Signed-off-by: jessicagreben <jessicagrebens@gmail.com>

view details

jessicagreben

commit sha 5dd3577424008e6828952092b0b36fee9adb5c67

change name of promtool subcommand to create-blocks-from Signed-off-by: jessicagreben <jessicagrebens@gmail.com>

view details

jessicagreben

commit sha ee85c22adbc58308807b2c15d994d342afc4290e

flush samples to disk every 5k samples Signed-off-by: jessicagreben <jessicagrebens@gmail.com>

view details

jessicagreben

commit sha ac06d0a6570c53b42273da414f94f73f5e0e25cd

merge master/resolve conflict Signed-off-by: jessicagreben <jessicagrebens@gmail.com>

view details

jessicagreben

commit sha 2e9946e4d7407df3feaf673298e58c33b96f799b

add test Signed-off-by: jessicagreben <jessicagrebens@gmail.com>

view details

jessicagreben

commit sha cec3515fa3660de0307f88a3ee88778e6828722d

fix linter Signed-off-by: jessicagreben <jessicagrebens@gmail.com>

view details

jessicagreben

commit sha e32e4fcc5392864c88c2be30d950919f9cf0c134

fix unit test Signed-off-by: jessicagreben <jessicagrebens@gmail.com>

view details

push time in 2 months

create barnchdigitalocean/prometheus

branch : remote_write_2_27_2

created branch time in 2 months

delete branch bsnyder788/doctl

delete branch : add-alert-policy-CRUD

delete time in 2 months

Pull request review commentdigitalocean/doctl

monitoring: add CRUD commands for alert policies

+/*+Copyright 2018 The Doctl Authors All rights reserved.+Licensed under the Apache License, Version 2.0 (the "License");+you may not use this file except in compliance with the License.+You may obtain a copy of the License at+    http://www.apache.org/licenses/LICENSE-2.0+Unless required by applicable law or agreed to in writing, software+distributed under the License is distributed on an "AS IS" BASIS,+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+See the License for the specific language governing permissions and+limitations under the License.+*/++package commands++import (+	"errors"+	"fmt"+	"strings"++	"github.com/digitalocean/doctl"+	"github.com/digitalocean/doctl/commands/displayers"+	"github.com/digitalocean/doctl/do"+	"github.com/digitalocean/godo"+	"github.com/spf13/cobra"+)++// Monitoring creates the monitoring commands hierarchy.+func Monitoring() *Command {+	cmd := &Command{+		Command: &cobra.Command{+			Use:   "monitoring",+			Short: "Display commands to manage monitoring",+			Long: `The sub-commands of ` + "`" + `doctl monitoring` + "`" + ` manage the monitoring on your account.++An alert policy can be applied to resource(s) (currently Droplets)+in order to alert on resource consumption.`,+		},+	}++	cmd.AddCommand(alertPolicies())+	return cmd+}++func alertPolicies() *Command {+	cmd := &Command{+		Command: &cobra.Command{+			Use:     "alert",+			Aliases: []string{"alerts", "a"},+			Short:   "Display commands for managing alert policies",+			Long:    "The commands under `doctl monitoring alert` are for the management of alert policies.",+		},+	}++	cmdAlertPolicyCreate := CmdBuilder(cmd, RunCmdAlertPolicyCreate, "create", "Create an alert policy", `Use this command to create a new alert policy.`, Writer)+	AddStringFlag(cmdAlertPolicyCreate, doctl.ArgAlertPolicyDescription, "", "", "A description of the alert policy.")+	AddStringFlag(cmdAlertPolicyCreate, doctl.ArgAlertPolicyType, "", "", "The type of alert policy.")+	AddStringFlag(cmdAlertPolicyCreate, doctl.ArgAlertPolicyCompare, "", "", "The comparator of the alert policy. Either `GreaterThan` or `LessThan`")+	AddStringFlag(cmdAlertPolicyCreate, doctl.ArgAlertPolicyWindow, "", "5m", "The window to apply the alert policy conditions against.")+	AddIntFlag(cmdAlertPolicyCreate, doctl.ArgAlertPolicyValue, "", 0, "The value of the alert policy to compare against.")+	AddBoolFlag(cmdAlertPolicyCreate, doctl.ArgAlertPolicyEnabled, "", true, "Whether the alert policy is enabled.")+	AddStringSliceFlag(cmdAlertPolicyCreate, doctl.ArgAlertPolicyEmails, "", nil, "Emails to send alerts to.")+	AddStringSliceFlag(cmdAlertPolicyCreate, doctl.ArgAlertPolicyTags, "", nil, "Tags to apply the alert against.")+	AddStringSliceFlag(cmdAlertPolicyCreate, doctl.ArgAlertPolicyEntities, "", nil, "Entities to apply the alert against.")

good call, I went ahead and clarified it with an example!

bsnyder788

comment created time in 2 months

PullRequestReviewEvent

push eventbsnyder788/doctl

Brett Snyder

commit sha 0e2b09dbab22e08bf542fa477fe3120b82601655

monitoring: add CRUD commands for alert policies

view details

push time in 2 months

Pull request review commentdigitalocean/doctl

monitoring: add CRUD commands for alert policies

+/*+Copyright 2018 The Doctl Authors All rights reserved.+Licensed under the Apache License, Version 2.0 (the "License");+you may not use this file except in compliance with the License.+You may obtain a copy of the License at+    http://www.apache.org/licenses/LICENSE-2.0+Unless required by applicable law or agreed to in writing, software+distributed under the License is distributed on an "AS IS" BASIS,+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+See the License for the specific language governing permissions and+limitations under the License.+*/++package commands++import (+	"errors"+	"fmt"+	"strings"++	"github.com/digitalocean/doctl"+	"github.com/digitalocean/doctl/commands/displayers"+	"github.com/digitalocean/doctl/do"+	"github.com/digitalocean/godo"+	"github.com/spf13/cobra"+)++// Monitoring creates the monitoring commands hierarchy.+func Monitoring() *Command {+	cmd := &Command{+		Command: &cobra.Command{+			Use:   "monitoring",+			Short: "Display commands to manage monitoring",+			Long: `The sub-commands of ` + "`" + `doctl monitoring` + "`" + ` manage the monitoring on your account.++An alert policy can be applied to resource(s) (currently Droplets)+in order to alert on resource consumption.`,+		},+	}++	cmd.AddCommand(alertPolicies())+	return cmd+}++func alertPolicies() *Command {+	cmd := &Command{+		Command: &cobra.Command{+			Use:     "alert",+			Aliases: []string{"alerts", "a"},+			Short:   "Display commands for managing alert policies",+			Long:    "The commands under `doctl monitoring alert` are for the management of alert policies.",+		},+	}++	cmdAlertPolicyCreate := CmdBuilder(cmd, RunCmdAlertPolicyCreate, "create", "Create an alert policy", `Use this command to create a new alert policy.`, Writer)+	AddStringFlag(cmdAlertPolicyCreate, doctl.ArgAlertPolicyDescription, "", "", "A description of the alert policy.")+	AddStringFlag(cmdAlertPolicyCreate, doctl.ArgAlertPolicyType, "", "", "The type of alert policy.")+	AddStringFlag(cmdAlertPolicyCreate, doctl.ArgAlertPolicyCompare, "", "", "The comparator of the alert policy. Either `GreaterThan` or `LessThan`")+	AddStringFlag(cmdAlertPolicyCreate, doctl.ArgAlertPolicyWindow, "", "5m", "The window to apply the alert policy conditions against.")+	AddIntFlag(cmdAlertPolicyCreate, doctl.ArgAlertPolicyValue, "", 0, "The value of the alert policy to compare against.")+	AddBoolFlag(cmdAlertPolicyCreate, doctl.ArgAlertPolicyEnabled, "", true, "Whether the alert policy is enabled.")+	AddStringSliceFlag(cmdAlertPolicyCreate, doctl.ArgAlertPolicyEmails, "", nil, "Emails to send alerts to.")+	AddStringSliceFlag(cmdAlertPolicyCreate, doctl.ArgAlertPolicyTags, "", nil, "Tags to apply the alert against.")+	AddStringSliceFlag(cmdAlertPolicyCreate, doctl.ArgAlertPolicyEntities, "", nil, "Entities to apply the alert against.")+	AddStringSliceFlag(cmdAlertPolicyCreate, doctl.ArgAlertPolicySlackChannels, "", nil, "Slack channels to send alerts to.")+	AddStringSliceFlag(cmdAlertPolicyCreate, doctl.ArgAlertPolicySlackURLs, "", nil, "Slack URLs to send alerts to.")++	cmdAlertPolicyUpdate := CmdBuilder(cmd, RunCmdAlertPolicyUpdate, "update <alert-policy-uuid>...", "Update an alert policy", `Use this command to update an existing alert policy.`, Writer)+	AddStringFlag(cmdAlertPolicyUpdate, doctl.ArgAlertPolicyDescription, "", "", "A description of the alert policy.")+	AddStringFlag(cmdAlertPolicyUpdate, doctl.ArgAlertPolicyType, "", "", "The type of alert policy.")+	AddStringFlag(cmdAlertPolicyUpdate, doctl.ArgAlertPolicyCompare, "", "", "The comparator of the alert policy. Either `GreaterThan` or `LessThan`")+	AddStringFlag(cmdAlertPolicyUpdate, doctl.ArgAlertPolicyWindow, "", "5m", "The window to apply the alert policy conditions against.")+	AddIntFlag(cmdAlertPolicyUpdate, doctl.ArgAlertPolicyValue, "", 0, "The value of the alert policy to compare against.")+	AddBoolFlag(cmdAlertPolicyUpdate, doctl.ArgAlertPolicyEnabled, "", true, "Whether the alert policy is enabled.")+	AddStringSliceFlag(cmdAlertPolicyUpdate, doctl.ArgAlertPolicyEmails, "", nil, "Emails to send alerts to.")+	AddStringSliceFlag(cmdAlertPolicyUpdate, doctl.ArgAlertPolicyTags, "", nil, "Tags to apply the alert against.")+	AddStringSliceFlag(cmdAlertPolicyUpdate, doctl.ArgAlertPolicyEntities, "", nil, "Entities to apply the alert against.")+	AddStringSliceFlag(cmdAlertPolicyUpdate, doctl.ArgAlertPolicySlackChannels, "", nil, "Slack channels to send alerts to.")+	AddStringSliceFlag(cmdAlertPolicyUpdate, doctl.ArgAlertPolicySlackURLs, "", nil, "Slack URLs to send alerts to.")++	CmdBuilder(cmd, RunCmdAlertPolicyGet, "get <alert-policy-uuid>", "Retrieve information about an alert policy", `Use this command to retrieve an alert policy and see its configuration.`, Writer,+		displayerType(&displayers.AlertPolicy{}))++	CmdBuilder(cmd, RunCmdAlertPolicyList, "list", "List all alert policies", `Use this command to retrieve a list of all the alert policies in your account.`, Writer,+		aliasOpt("ls"), displayerType(&displayers.AlertPolicy{}))++	cmdRunAlertPolicyDelete := CmdBuilder(cmd, RunCmdAlertPolicyDelete, "delete <alert-policy-uuid>...", "Delete an alert policy", `Use this command to delete an alert policy.`, Writer)+	AddBoolFlag(cmdRunAlertPolicyDelete, doctl.ArgForce, doctl.ArgShortForce, false, "Delete an alert policy without confirmation prompt")++	return cmd+}++// RunCmdAlertPolicyCreate runs alert policy create.+func RunCmdAlertPolicyCreate(c *CmdConfig) error {+	ms := c.Monitoring()++	desc, err := c.Doit.GetString(c.NS, doctl.ArgAlertPolicyDescription)+	if err != nil {+		return err+	}+	alertType, err := c.Doit.GetString(c.NS, doctl.ArgAlertPolicyType)+	if err != nil {+		return err+	}+	value, err := c.Doit.GetInt(c.NS, doctl.ArgAlertPolicyValue)+	if err != nil {+		return err+	}++	window, err := c.Doit.GetString(c.NS, doctl.ArgAlertPolicyWindow)+	if err != nil {+		return err+	}++	entities, err := c.Doit.GetStringSlice(c.NS, doctl.ArgAlertPolicyEntities)+	if err != nil {+		return err+	}++	tags, err := c.Doit.GetStringSlice(c.NS, doctl.ArgAlertPolicyTags)+	if err != nil {+		return err+	}++	enabled, err := c.Doit.GetBoolPtr(c.NS, doctl.ArgAlertPolicyEnabled)+	if err != nil {+		return err+	}++	compareStr, err := c.Doit.GetString(c.NS, doctl.ArgAlertPolicyCompare)+	if err != nil {+		return err+	}++	compare, err := getCompartor(compareStr)+	if err != nil {+		return err+	}++	emails, err := c.Doit.GetStringSlice(c.NS, doctl.ArgAlertPolicyEmails)+	if err != nil {+		return err+	}++	slackChannels, err := c.Doit.GetStringSlice(c.NS, doctl.ArgAlertPolicySlackChannels)+	if err != nil {+		return err+	}++	slackURLs, err := c.Doit.GetStringSlice(c.NS, doctl.ArgAlertPolicySlackURLs)+	if err != nil {+		return err+	}++	if len(slackURLs) != len(slackChannels) {+		return errors.New("must provide the same number of slack channels as slack URLs")+	}++	slacks := make([]godo.SlackDetails, len(slackChannels))+	for i, channel := range slackChannels {+		slacks[i] = godo.SlackDetails{Channel: channel, URL: slackURLs[i]}+	}++	apcr := &godo.AlertPolicyCreateRequest{

I added some more input validation for both the update and create commands!

bsnyder788

comment created time in 2 months

PullRequestReviewEvent

pull request commentdigitalocean/doctl

monitoring: add CRUD commands for alert policies

This is looking great! A couple very minor bits in line. It would be great to get some integration tests as well. See:

https://github.com/digitalocean/doctl/tree/main/integration https://github.com/digitalocean/doctl/blob/main/CONTRIBUTING.md#integration-tests

I did have trouble testing the create command, but that might be expected right now?

./builds/doctl monitoring alerts create --compare GreaterThan --value 50 --type v1/insights/droplet/cpu --description "Test alert" --enabled  --tags personal
Error: POST https://api.digitalocean.com/v2/monitoring/alerts: 500 (request "4fec9302-c09c-4da5-ab86-7dea6a8ec900") Server Error

I went ahead and added more integration tests.

bsnyder788

comment created time in 2 months

push eventbsnyder788/doctl

Brett Snyder

commit sha b14ac1bb18588dd0fa1fa90c7c3e541c4fa8fdbe

monitoring: add CRUD commands for alert policies

view details

push time in 2 months