diff --git a/scripts/monitoring/dashboards/dev.json b/scripts/monitoring/dashboards/dev.json deleted file mode 100644 index 06e5fd4dc..000000000 --- a/scripts/monitoring/dashboards/dev.json +++ /dev/null @@ -1,152 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "gnetId": null, - "graphTooltip": 0, - "links": [], - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "Prometheus", - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 14, - "w": 24, - "x": 0, - "y": 0 - }, - "hiddenSeries": false, - "id": 2, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "mesg_execution_created", - "refId": "A" - }, - { - "expr": "mesg_execution_pre_signed", - "refId": "C" - }, - { - "expr": "mesg_execution_signed", - "refId": "D" - }, - { - "expr": "mesg_execution_in_progress", - "refId": "B" - }, - { - "expr": "mesg_execution_completed", - "refId": "E" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Execution", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - } - ], - "refresh": "5s", - "schemaVersion": 22, - "style": "dark", - "tags": [], - "templating": { - "list": [] - }, - "time": { - "from": "now-30m", - "to": "now" - }, - "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ] - }, - "timezone": "", - "title": "Dev dashboard", - "uid": "Ac3dzdUWz", - "version": 1 -} \ No newline at end of file diff --git a/scripts/monitoring/dashboards/execution.json b/scripts/monitoring/dashboards/execution.json new file mode 100644 index 000000000..907341359 --- /dev/null +++ b/scripts/monitoring/dashboards/execution.json @@ -0,0 +1,501 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "links": [], + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 24, + "x": 0, + "y": 0 + }, + "hiddenSeries": false, + "id": 2, + "legend": { + "alignAsTable": true, + "avg": true, + "current": false, + "max": true, + "min": true, + "rightSide": true, + "show": true, + "sideWidth": 350, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "tendermint_consensus_total_txs{chain_id=\"mesg-dev-chain\",instance=\"engine\",job=\"testnet\"}", + "yaxis": 2 + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "mesg_execution_created", + "legendFormat": "Created", + "refId": "A" + }, + { + "expr": "mesg_execution_in_progress", + "legendFormat": "In Progress", + "refId": "B" + }, + { + "expr": "mesg_execution_updated", + "legendFormat": "Updated", + "refId": "C" + }, + { + "expr": "mesg_execution_completed", + "legendFormat": "Completed", + "refId": "E" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Executions", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "none", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "none", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "Prometheus", + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 24, + "x": 0, + "y": 10 + }, + "hiddenSeries": false, + "id": 7, + "legend": { + "alignAsTable": true, + "avg": true, + "current": false, + "max": true, + "min": true, + "rightSide": true, + "show": true, + "sideWidth": 350, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "tendermint_consensus_total_txs{chain_id=\"mesg-dev-chain\",instance=\"engine\",job=\"testnet\"}", + "yaxis": 2 + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(mesg_execution_created[1m])", + "interval": "", + "legendFormat": "Created", + "refId": "A" + }, + { + "expr": "rate(mesg_execution_in_progress[1m])", + "interval": "", + "legendFormat": "In Progress", + "refId": "B" + }, + { + "expr": "rate(mesg_execution_updated[1m])", + "interval": "", + "legendFormat": "Updated", + "refId": "C" + }, + { + "expr": "rate(mesg_execution_completed[1m])", + "interval": "", + "legendFormat": "Completed", + "refId": "E" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Executions / 1min", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "none", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "none", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": null, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 10, + "w": 24, + "x": 0, + "y": 20 + }, + "hiddenSeries": false, + "id": 4, + "legend": { + "alignAsTable": true, + "avg": true, + "current": false, + "hideEmpty": false, + "hideZero": false, + "max": true, + "min": true, + "rightSide": true, + "show": true, + "sideWidth": 350, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "Consensus", + "yaxis": 1 + }, + { + "alias": "tendermint_consensus_total_txs{chain_id=\"mesg-dev-chain\",instance=\"engine\",job=\"testnet\"}", + "yaxis": 2 + }, + { + "alias": "Total", + "yaxis": 2 + }, + { + "alias": "Failed", + "yaxis": 2 + }, + { + "alias": "total Failed", + "yaxis": 2 + }, + { + "alias": "Total Failed", + "yaxis": 2 + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "tendermint_mempool_size", + "legendFormat": "Mempool", + "refId": "A" + }, + { + "expr": "tendermint_consensus_num_txs", + "legendFormat": "Consensus", + "refId": "C" + }, + { + "expr": "tendermint_mempool_failed_txs", + "legendFormat": "Total Failed", + "refId": "B" + }, + { + "expr": "tendermint_consensus_total_txs", + "legendFormat": "Total", + "refId": "D" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Transactions", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "none", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "none", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": null, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 30 + }, + "hiddenSeries": false, + "id": 6, + "legend": { + "alignAsTable": true, + "avg": true, + "current": false, + "max": true, + "min": true, + "rightSide": true, + "show": true, + "sideWidth": 350, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "dataLinks": [] + }, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "tendermint_state_block_processing_time_count{chain_id=\"mesg-dev-chain\",instance=\"engine\",job=\"testnet\"}", + "yaxis": 2 + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "tendermint_consensus_block_size_bytes", + "legendFormat": "Block size", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Blocks", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "bytes", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": "5s", + "schemaVersion": 22, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-30m", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "timezone": "", + "title": "Executions", + "uid": "Ac3dzdUWz", + "version": 1 +} \ No newline at end of file diff --git a/sdk/execution/keeper.go b/sdk/execution/keeper.go index 96baeb28f..f27b9f986 100644 --- a/sdk/execution/keeper.go +++ b/sdk/execution/keeper.go @@ -80,7 +80,9 @@ func (k *Keeper) Create(request cosmostypes.Request, msg msgCreateExecution) (*e if err != nil { return nil, err } - m.InProgress.Add(1) + if !request.IsCheckTx() { + m.InProgress.Add(1) + } store.Set(exec.Hash, value) return exec, nil } @@ -115,7 +117,9 @@ func (k *Keeper) Update(request cosmostypes.Request, msg msgUpdateExecution) (*e if err != nil { return nil, err } - m.Completed.Add(1) + if !request.IsCheckTx() { + m.Completed.Add(1) + } store.Set(exec.Hash, value) return exec, nil } diff --git a/sdk/execution/metrics.go b/sdk/execution/metrics.go index 1e1ac8ea0..f763d09e8 100644 --- a/sdk/execution/metrics.go +++ b/sdk/execution/metrics.go @@ -10,9 +10,8 @@ var m *metric type metric struct { Created metrics.Counter - PreSigned metrics.Counter - Signed metrics.Counter InProgress metrics.Counter + Updated metrics.Counter Completed metrics.Counter } @@ -24,24 +23,18 @@ func newMetric() *metric { Name: "created", Help: "executions created", }, []string{}), - Signed: prometheus.NewCounterFrom(stdprometheus.CounterOpts{ - Namespace: "mesg", - Subsystem: "execution", - Name: "signed", - Help: "executions signed", - }, []string{}), - PreSigned: prometheus.NewCounterFrom(stdprometheus.CounterOpts{ - Namespace: "mesg", - Subsystem: "execution", - Name: "pre_signed", - Help: "executions pre signed", - }, []string{}), InProgress: prometheus.NewCounterFrom(stdprometheus.CounterOpts{ Namespace: "mesg", Subsystem: "execution", Name: "in_progress", Help: "executions in progress", }, []string{}), + Updated: prometheus.NewCounterFrom(stdprometheus.CounterOpts{ + Namespace: "mesg", + Subsystem: "execution", + Name: "updated", + Help: "executions updated", + }, []string{}), Completed: prometheus.NewCounterFrom(stdprometheus.CounterOpts{ Namespace: "mesg", Subsystem: "execution", diff --git a/sdk/execution/sdk.go b/sdk/execution/sdk.go index 0b1431d61..111f76930 100644 --- a/sdk/execution/sdk.go +++ b/sdk/execution/sdk.go @@ -39,10 +39,8 @@ func (s *SDK) Create(req *api.CreateExecutionRequest) (*execution.Execution, err if err != nil { return nil, err } - m.PreSigned.Add(1) msg := newMsgCreateExecution(req, acc.GetAddress()) tx, err := s.client.BuildAndBroadcastMsg(msg) - m.Signed.Add(1) if err != nil { return nil, err } @@ -51,6 +49,7 @@ func (s *SDK) Create(req *api.CreateExecutionRequest) (*execution.Execution, err // Update updates a execution. func (s *SDK) Update(req *api.UpdateExecutionRequest) (*execution.Execution, error) { + m.Updated.Add(1) acc, err := s.client.GetAccount() if err != nil { return nil, err