Skip to content

Commit

Permalink
feat: pubsub widget
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoReboul committed Jan 15, 2021
1 parent 705ccc2 commit 6591037
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
46 changes: 46 additions & 0 deletions utilities/mon/const_widgetsuboldestunackedmsg.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// Copyright 2020 Google LLC
//
// 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 mon

const widgetSubOldestUnackedMsg = `
{
"title": "mservice_name pubsub oldest unacked msg",
"xyChart": {
"chartOptions": {
"mode": "COLOR"
},
"dataSets": [
{
"minAlignmentPeriod": "60s",
"plotType": "LINE",
"timeSeriesQuery": {
"timeSeriesFilter": {
"aggregation": {
"perSeriesAligner": "ALIGN_MEAN"
},
"filter": "metric.type=\"pubsub.googleapis.com/subscription/oldest_unacked_message_age\" resource.type=\"pubsub_subscription\" resource.label.\"subscription_id\"=monitoring.regex.full_match(\".*mservice_name.*\")",
"secondaryAggregation": {}
}
}
}
],
"timeshiftDuration": "0s",
"yAxis": {
"label": "y1Axis",
"scale": "LINEAR"
}
}
}
`
2 changes: 2 additions & 0 deletions utilities/mon/func_getgcfwidget.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ func GetGCFWidget(microserviceName string, widgetType string) (widget monitoring
widgetTypeJSON = widgetRAMLatency
case "widgetRAMTriggerAge":
widgetTypeJSON = widgetRAMTriggerAge
case "widgetSubOldestUnackedMsg":
widgetTypeJSON = widgetSubOldestUnackedMsg
default:
return widget, fmt.Errorf("Unsupported widgetType")
}
Expand Down
2 changes: 1 addition & 1 deletion utilities/ramcli/meth_deployment_configuresetdashboards.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (deployment *Deployment) configureSetDashboards() (err error) {
// dashboards["RAM latency"] = dashboard

dashboard.columns = 3
dashboard.widgetTypeList = []string{"widgetRAMe2eLatency", "widgetRAMLatency", "widgetRAMTriggerAge", "widgetGCFActiveInstances", "widgetGCFExecutionCount", "widgetGCFExecutionTime", "widgetGCFMemoryUsage"}
dashboard.widgetTypeList = []string{"widgetRAMe2eLatency", "widgetRAMLatency", "widgetRAMTriggerAge", "widgetSubOldestUnackedMsg", "widgetGCFActiveInstances", "widgetGCFExecutionCount", "widgetGCFExecutionTime", "widgetGCFMemoryUsage"}
for _, microServiceName := range []string{"stream2bq", "monitor", "upload2gcs", "publish2fs", "splitdump", "dumpinventory", "listgroupmembers", "getgroupsettings", "listgroups", "convertlog2feed"} {
dashboard.microServiceNameList = []string{microServiceName}
dashboards[fmt.Sprintf("RAM %s", microServiceName)] = dashboard
Expand Down

0 comments on commit 6591037

Please sign in to comment.