Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c77c0e91
Commit
c77c0e91
authored
Apr 05, 2021
by
syasonik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new metric definition for on-call notifications
parent
50912ad6
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
98 additions
and
1 deletion
+98
-1
changelogs/unreleased/sy-on-call-usage-ping.yml
changelogs/unreleased/sy-on-call-usage-ping.yml
+5
-0
config/feature_flags/development/usage_data_i_incident_management_oncall_notification_sent.yml
...e_data_i_incident_management_oncall_notification_sent.yml
+8
-0
doc/development/usage_ping/dictionary.md
doc/development/usage_ping/dictionary.md
+24
-0
ee/app/services/ee/notification_service.rb
ee/app/services/ee/notification_service.rb
+4
-0
ee/config/metrics/counts_28d/20210405222005_i_incident_management_oncall_notification_sent_monthly.yml
..._incident_management_oncall_notification_sent_monthly.yml
+18
-0
ee/config/metrics/counts_7d/20210405220139_i_incident_management_oncall_notification_sent_weekly.yml
...i_incident_management_oncall_notification_sent_weekly.yml
+18
-0
ee/spec/services/ee/notification_service_spec.rb
ee/spec/services/ee/notification_service_spec.rb
+13
-0
lib/gitlab/usage_data_counters/known_events/common.yml
lib/gitlab/usage_data_counters/known_events/common.yml
+6
-0
spec/lib/gitlab/usage_data_counters/hll_redis_counter_spec.rb
.../lib/gitlab/usage_data_counters/hll_redis_counter_spec.rb
+1
-0
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+1
-1
No files found.
changelogs/unreleased/sy-on-call-usage-ping.yml
0 → 100644
View file @
c77c0e91
---
title
:
Add count of unique users to receive on-call notification to usage ping
merge_request
:
58606
author
:
type
:
changed
config/feature_flags/development/usage_data_i_incident_management_oncall_notification_sent.yml
0 → 100644
View file @
c77c0e91
---
name
:
usage_data_i_incident_management_oncall_notification_sent
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/58606
rollout_issue_url
:
milestone
:
'
13.11'
type
:
development
group
:
group::monitor
default_enabled
:
true
doc/development/usage_ping/dictionary.md
View file @
c77c0e91
...
...
@@ -10340,6 +10340,30 @@ Status: `data_available`
Tiers:
### `redis_hll_counters.incident_management.i_incident_management_oncall_notification_sent_monthly`
Count of unique users to receive a notification while on-call
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_28d/20210405222005_i_incident_management_oncall_notification_sent_monthly.yml
)
Group:
`group::monitor`
Status:
`implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.incident_management.i_incident_management_oncall_notification_sent_weekly`
Count of unique users to receive a notification while on-call
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210405220139_i_incident_management_oncall_notification_sent_weekly.yml
)
Group:
`group::monitor`
Status:
`implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.incident_management.incident_management_alert_assigned_monthly`
Missing description
...
...
ee/app/services/ee/notification_service.rb
View file @
c77c0e91
...
...
@@ -2,6 +2,8 @@
module
EE
module
NotificationService
include
::
Gitlab
::
Utils
::
UsageData
# When we add approvers to a merge request we should send an email to:
#
# * the new approvers
...
...
@@ -67,6 +69,8 @@ module EE
end
def
notify_oncall_users_of_alert
(
users
,
alert
)
track_usage_event
(
:i_incident_management_oncall_notification_sent
,
users
.
map
(
&
:id
))
users
.
each
do
|
user
|
mailer
.
prometheus_alert_fired_email
(
alert
.
project
,
user
,
alert
).
deliver_later
end
...
...
ee/config/metrics/counts_28d/20210405222005_i_incident_management_oncall_notification_sent_monthly.yml
0 → 100644
View file @
c77c0e91
---
key_path
:
redis_hll_counters.incident_management.i_incident_management_oncall_notification_sent_monthly
description
:
Count of unique users to receive a notification while on-call
product_section
:
ops
product_stage
:
monitor
product_group
:
group::monitor
product_category
:
incident_management
value_type
:
number
status
:
implemented
milestone
:
"
13.11"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/58606
time_frame
:
28d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/config/metrics/counts_7d/20210405220139_i_incident_management_oncall_notification_sent_weekly.yml
0 → 100644
View file @
c77c0e91
---
key_path
:
redis_hll_counters.incident_management.i_incident_management_oncall_notification_sent_weekly
description
:
Count of unique users to receive a notification while on-call
product_section
:
ops
product_stage
:
monitor
product_group
:
group::monitor
product_category
:
incident_management
value_type
:
number
status
:
implemented
milestone
:
"
13.11"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/58606
time_frame
:
7d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/spec/services/ee/notification_service_spec.rb
View file @
c77c0e91
...
...
@@ -899,12 +899,25 @@ RSpec.describe EE::NotificationService, :mailer do
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:alert
)
{
create
(
:alert_management_alert
)
}
let_it_be
(
:project
)
{
alert
.
project
}
let
(
:tracking_params
)
do
{
event_names:
'i_incident_management_oncall_notification_sent'
,
start_date:
1
.
week
.
ago
,
end_date:
1
.
week
.
from_now
}
end
it
'sends an email to the specified users'
do
expect
(
Notify
).
to
receive
(
:prometheus_alert_fired_email
).
with
(
project
,
user
,
alert
).
and_call_original
subject
.
notify_oncall_users_of_alert
([
user
],
alert
)
end
it
'tracks a count of unique recipients'
,
:clean_gitlab_redis_shared_state
do
expect
{
subject
.
notify_oncall_users_of_alert
([
user
],
alert
)
}
.
to
change
{
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
.
unique_events
(
**
tracking_params
)
}
.
by
1
end
end
end
end
lib/gitlab/usage_data_counters/known_events/common.yml
View file @
c77c0e91
...
...
@@ -247,6 +247,12 @@
category
:
incident_management_alerts
aggregation
:
weekly
feature_flag
:
usage_data_incident_management_alert_create_incident
# Incident management on-call
-
name
:
i_incident_management_oncall_notification_sent
redis_slot
:
incident_management
category
:
incident_management_oncall
aggregation
:
weekly
feature_flag
:
usage_data_i_incident_management_oncall_notification_sent
# Testing category
-
name
:
i_testing_test_case_parsed
category
:
testing
...
...
spec/lib/gitlab/usage_data_counters/hll_redis_counter_spec.rb
View file @
c77c0e91
...
...
@@ -34,6 +34,7 @@ RSpec.describe Gitlab::UsageDataCounters::HLLRedisCounter, :clean_gitlab_redis_s
'source_code'
,
'incident_management'
,
'incident_management_alerts'
,
'incident_management_oncall'
,
'testing'
,
'issues_edit'
,
'ci_secrets_management'
,
...
...
spec/lib/gitlab/usage_data_spec.rb
View file @
c77c0e91
...
...
@@ -1362,7 +1362,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
let
(
:categories
)
{
::
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
.
categories
}
let
(
:ineligible_total_categories
)
do
%w[source_code ci_secrets_management incident_management_alerts snippets terraform]
%w[source_code ci_secrets_management incident_management_alerts snippets terraform
incident_management_oncall
]
end
context
'with redis_hll_tracking feature enabled'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment