Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openfaas-faas
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Team Jaz CS 598 CCC Final Project
openfaas-faas
Commits
cdd52192
Commit
cdd52192
authored
8 years ago
by
Alex
Browse files
Options
Downloads
Patches
Plain Diff
Tweak alertmanager timeout + simplify down-scale of replicas
parent
59ca5979
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gateway/server.go
+12
-3
12 additions, 3 deletions
gateway/server.go
prometheus/alertmanager.yml
+4
-3
4 additions, 3 deletions
prometheus/alertmanager.yml
with
16 additions
and
6 deletions
gateway/server.go
+
12
−
3
View file @
cdd52192
...
...
@@ -32,12 +32,21 @@ func scaleService(req requests.PrometheusAlert, c *client.Client) error {
}
else
{
return
err
}
}
else
{
replicas
=
*
service
.
Spec
.
Mode
.
Replicated
.
Replicas
-
uint64
(
5
)
if
replicas
<=
0
{
}
else
{
// Resolved event.
// Previously decremented by 5, but event only fires once, so set to 1/1.
if
*
service
.
Spec
.
Mode
.
Replicated
.
Replicas
>
1
{
// replicas = *service.Spec.Mode.Replicated.Replicas - uint64(5)
// if replicas < 1 {
// replicas = 1
// }
// return nil
replicas
=
1
}
else
{
return
nil
}
}
log
.
Printf
(
"Scaling %s to %d replicas.
\n
"
,
serviceName
,
replicas
)
service
.
Spec
.
Mode
.
Replicated
.
Replicas
=
&
replicas
...
...
This diff is collapsed.
Click to expand it.
prometheus/alertmanager.yml
+
4
−
3
View file @
cdd52192
...
...
@@ -25,15 +25,15 @@ route:
# This way ensures that you get multiple alerts for the same group that start
# firing shortly after another are batched together on the first
# notification.
group_wait
:
30
s
group_wait
:
5
s
# When the first notification was sent, wait 'group_interval' to send a batch
# of new alerts that started firing for that group.
group_interval
:
5m
group_interval
:
10s
# If an alert has successfully been sent, wait 'repeat_interval' to
# resend them.
repeat_interval
:
3
h
repeat_interval
:
3
0s
# A default receiver
receiver
:
scale-up
...
...
@@ -66,3 +66,4 @@ receivers:
webhook_configs
:
-
url
:
http://gateway:8080/system/alert
send_resolved
:
true
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment