Skip to content

Commit

Permalink
renaming metrics to conform with prom
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickhuie19 committed Nov 5, 2024
1 parent 4dd7268 commit 47f75ba
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
26 changes: 13 additions & 13 deletions observability-lib/dashboards/keystone-workflows/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func vars(p *Props) []cog.Builder[dashboard.VariableModel] {
Name: "env",
},
Datasource: p.MetricsDataSource.Name,
Query: `label_values(platform.engine.workflows.count, env)`,
Query: `label_values(platform_engine_workflows_count, env)`,
Multi: false,
}))

Expand All @@ -49,7 +49,7 @@ func vars(p *Props) []cog.Builder[dashboard.VariableModel] {
Name: "cluster",
},
Datasource: p.MetricsDataSource.Name,
Query: `label_values(platform.engine.workflows.count{env="$env"}, cluster)`,
Query: `label_values(platform_engine_workflows_count{env="$env"}, cluster)`,
}))

variables = append(variables, grafana.NewQueryVariable(&grafana.QueryVariableOptions{
Expand All @@ -58,7 +58,7 @@ func vars(p *Props) []cog.Builder[dashboard.VariableModel] {
Name: "workflowOwner",
},
Datasource: p.MetricsDataSource.Name,
Query: `label_values(platform.engine.workflows.count{env="$env", cluster="$cluster"}, workflowOwner)`,
Query: `label_values(platform_engine_workflows_count{env="$env", cluster="$cluster"}, workflowOwner)`,
Multi: false,
}))

Expand All @@ -68,7 +68,7 @@ func vars(p *Props) []cog.Builder[dashboard.VariableModel] {
Name: "workflowName",
},
Datasource: p.MetricsDataSource.Name,
Query: `label_values(platform.engine.workflows.count{env="$env", cluster="$cluster", workflowOwner="$workflowOwner"}, workflowName)`,
Query: `label_values(platform_engine_workflows_count{env="$env", cluster="$cluster", workflowOwner="$workflowOwner"}, workflowName)`,
}))

return variables
Expand All @@ -86,7 +86,7 @@ func general(p *Props) []*grafana.Panel {
Height: 8,
Query: []grafana.Query{
{
Expr: `sum(platform.engine.workflows.count{` + p.platformOpts.LabelQuery + `}) by (workflowOwner, workflowName)`,
Expr: `sum(platform_engine_workflows_count{` + p.platformOpts.LabelQuery + `}) by (workflowOwner, workflowName)`,
Legend: "{{ workflowOwner }} - {{ workflowName }}",
},
},
Expand All @@ -102,7 +102,7 @@ func general(p *Props) []*grafana.Panel {
NoDataState: alerting.RuleNoDataStateOK,
Query: []grafana.RuleQuery{
{
Expr: `sum(platform.engine.workflows.count{` + p.AlertsFilters + `})`,
Expr: `sum(platform_engine_workflows_count{` + p.AlertsFilters + `})`,
RefID: "A",
Datasource: p.MetricsDataSource.UID,
},
Expand Down Expand Up @@ -132,7 +132,7 @@ func general(p *Props) []*grafana.Panel {
Height: 8,
Query: []grafana.Query{
{
Expr: `sum(platform.engine.workflows.count{` + p.platformOpts.LabelQuery + `}) by (status)`,
Expr: `sum(platform_engine_workflows_count{` + p.platformOpts.LabelQuery + `}) by (status)`,
Legend: "{{ status }}",
},
},
Expand All @@ -149,7 +149,7 @@ func general(p *Props) []*grafana.Panel {
Unit: "ms",
Query: []grafana.Query{
{
Expr: `sum(platform.engine.workflow.time{` + p.platformOpts.LabelQuery + `}) by (workflowExecutionID)`,
Expr: `sum(platform_engine_workflow_time{` + p.platformOpts.LabelQuery + `}) by (workflowExecutionID)`,
Legend: "WorkflowExecID: {{workflowExecutionID}}",
},
},
Expand All @@ -165,7 +165,7 @@ func general(p *Props) []*grafana.Panel {
Height: 8,
Query: []grafana.Query{
{
Expr: `platform.engine.workflow.errors{` + p.platformOpts.LabelQuery + `}`,
Expr: `platform_engine_workflow_errors{` + p.platformOpts.LabelQuery + `}`,
Legend: "",
},
},
Expand All @@ -181,7 +181,7 @@ func general(p *Props) []*grafana.Panel {
Height: 8,
Query: []grafana.Query{
{
Expr: `platform.engine.register_trigger.failures{` + p.platformOpts.LabelQuery + `}`,
Expr: `platform_engine_registertrigger_failures{` + p.platformOpts.LabelQuery + `}`,
Legend: "",
},
},
Expand All @@ -197,7 +197,7 @@ func general(p *Props) []*grafana.Panel {
Height: 8,
Query: []grafana.Query{
{
Expr: `platform.engine.capabilities_invoked.count{` + p.platformOpts.LabelQuery + `}`,
Expr: `platform_engine_capabilities_count{` + p.platformOpts.LabelQuery + `}`,
Legend: "",
},
},
Expand All @@ -213,7 +213,7 @@ func general(p *Props) []*grafana.Panel {
Height: 8,
Query: []grafana.Query{
{
Expr: `platform.registry_syncer.sync.failures{` + p.platformOpts.LabelQuery + `}`,
Expr: `platform_registrysyncer_sync_failures{` + p.platformOpts.LabelQuery + `}`,
Legend: "",
},
},
Expand All @@ -229,7 +229,7 @@ func general(p *Props) []*grafana.Panel {
Height: 8,
Query: []grafana.Query{
{
Expr: `platform.registry_syncer.launch.failures{` + p.platformOpts.LabelQuery + `}`,
Expr: `platform_registrysyncer_launch_failures{` + p.platformOpts.LabelQuery + `}`,
Legend: "",
},
},
Expand Down
22 changes: 11 additions & 11 deletions observability-lib/dashboards/keystone-workflows/test-output.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"id": 1,
"targets": [
{
"expr": "sum(platform.engine.workflows.count{}) by (workflowOwner, workflowName)",
"expr": "sum(platform_engine_workflows_count{}) by (workflowOwner, workflowName)",
"format": "",
"legendFormat": "{{ workflowOwner }} - {{ workflowName }}",
"refId": ""
Expand Down Expand Up @@ -83,7 +83,7 @@
"id": 2,
"targets": [
{
"expr": "sum(platform.engine.workflows.count{}) by (status)",
"expr": "sum(platform_engine_workflows_count{}) by (status)",
"format": "",
"legendFormat": "{{ status }}",
"refId": ""
Expand Down Expand Up @@ -133,7 +133,7 @@
"id": 3,
"targets": [
{
"expr": "sum(platform.engine.workflow.time{}) by (workflowExecutionID)",
"expr": "sum(platform_engine_workflow_time{}) by (workflowExecutionID)",
"format": "",
"legendFormat": "WorkflowExecID: {{workflowExecutionID}}",
"refId": ""
Expand Down Expand Up @@ -183,7 +183,7 @@
"id": 4,
"targets": [
{
"expr": "platform.engine.workflow.errors{}",
"expr": "platform_engine_workflow_errors{}",
"format": "",
"legendFormat": "",
"refId": ""
Expand Down Expand Up @@ -233,7 +233,7 @@
"id": 5,
"targets": [
{
"expr": "platform.engine.register_trigger.failures{}",
"expr": "platform_engine_registertrigger_failures{}",
"format": "",
"legendFormat": "",
"refId": ""
Expand Down Expand Up @@ -283,7 +283,7 @@
"id": 6,
"targets": [
{
"expr": "platform.engine.capabilities_invoked.count{}",
"expr": "platform_engine_capabilities_count{}",
"format": "",
"legendFormat": "",
"refId": ""
Expand Down Expand Up @@ -336,7 +336,7 @@
"name": "env",
"label": "Environment",
"description": "",
"query": "label_values(platform.engine.workflows.count, env)",
"query": "label_values(platform_engine_workflows_count, env)",
"datasource": {
"uid": "Prometheus"
},
Expand All @@ -357,7 +357,7 @@
"name": "cluster",
"label": "Cluster",
"description": "",
"query": "label_values(platform.engine.workflows.count{env=\"$env\"}, cluster)",
"query": "label_values(platform_engine_workflows_count{env=\"$env\"}, cluster)",
"datasource": {
"uid": "Prometheus"
},
Expand All @@ -378,7 +378,7 @@
"name": "workflowOwner",
"label": "Workflow Owner",
"description": "",
"query": "label_values(platform.engine.workflows.count{env=\"$env\", cluster=\"$cluster\"}, workflowOwner)",
"query": "label_values(platform_engine_workflows_count{env=\"$env\", cluster=\"$cluster\"}, workflowOwner)",
"datasource": {
"uid": "Prometheus"
},
Expand All @@ -399,7 +399,7 @@
"name": "workflowName",
"label": "Workflow Name",
"description": "",
"query": "label_values(platform.engine.workflows.count{env=\"$env\", cluster=\"$cluster\", workflowOwner=\"$workflowOwner\"}, workflowName)",
"query": "label_values(platform_engine_workflows_count{env=\"$env\", cluster=\"$cluster\", workflowOwner=\"$workflowOwner\"}, workflowName)",
"datasource": {
"uid": "Prometheus"
},
Expand Down Expand Up @@ -431,7 +431,7 @@
{
"datasourceUid": "1",
"model": {
"expr": "sum(platform.engine.workflows.count{})",
"expr": "sum(platform_engine_workflows_count{})",
"legendFormat": "__auto",
"refId": "A"
},
Expand Down

0 comments on commit 47f75ba

Please sign in to comment.