Skip to content

Commit

Permalink
Add 'all' to metric Keys (#1283)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatiasFrank authored Oct 16, 2024
1 parent 1f05bb1 commit 64912f0
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 12 deletions.
25 changes: 23 additions & 2 deletions docs/docs/api/platform-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8245,6 +8245,25 @@ A docker image tag.



<a name="api-v1-metrics-Keys"></a>

### Keys



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| project | [bool](#bool) | | |
| environment | [bool](#bool) | | |
| capsule | [bool](#bool) | | |
| metric_name | [bool](#bool) | | |
| all | [bool](#bool) | | |






<a name="api-v1-metrics-Metric"></a>

### Metric
Expand Down Expand Up @@ -8385,7 +8404,8 @@ A docker image tag.
| left | [Expression](#api-v1-metrics-Expression) | | |
| right | [Expression](#api-v1-metrics-Expression) | | |
| operation | [BinOp](#api-v1-metrics-BinOp) | | |
| tags | [Tags](#api-v1-metrics-Tags) | | |
| on | [Keys](#api-v1-metrics-Keys) | | |
| ignore | [Keys](#api-v1-metrics-Keys) | | |



Expand All @@ -8400,7 +8420,8 @@ A docker image tag.

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| tags | [Tags](#api-v1-metrics-Tags) | | |
| on | [Keys](#api-v1-metrics-Keys) | | |
| ignore | [Keys](#api-v1-metrics-Keys) | | |
| expression | [Expression](#api-v1-metrics-Expression) | | |


Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ require (
github.com/nyaruka/phonenumbers v1.1.7
github.com/pkg/errors v0.9.1
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.70.0
github.com/rigdev/rig-go-api v0.0.0-20241007181528-92da8b148ff2
github.com/rigdev/rig-go-api v0.0.0-20241016085442-e5380ca42f6e
github.com/rigdev/rig-go-sdk v0.0.0-20240612092526-69df8621bc22
github.com/rivo/tview v0.0.0-20240524063012-037df494fb76
github.com/robfig/cron v1.2.0
Expand Down Expand Up @@ -182,7 +182,7 @@ require (
golang.org/x/time v0.6.0 // indirect
golang.org/x/tools v0.25.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gotest.tools/v3 v3.5.1 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJ
github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0=
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
github.com/rigdev/rig-go-api v0.0.0-20241007181528-92da8b148ff2 h1:rt8ShFpqN82wcFdh9OXaeqY2OMj5zSa1AInnNGFpxwI=
github.com/rigdev/rig-go-api v0.0.0-20241007181528-92da8b148ff2/go.mod h1:rv3OvS9vbQjOK8qv/lukBXkEE9Cv6nU22SHUrcOCaJU=
github.com/rigdev/rig-go-api v0.0.0-20241016085442-e5380ca42f6e h1:HNra1/GQrYbPbb9V4DD+mpLjLtdSGpKZNNfqgyvOkiI=
github.com/rigdev/rig-go-api v0.0.0-20241016085442-e5380ca42f6e/go.mod h1:6xxlwvADYBFRiIrot3yrcXVJT2IMGfkTZ5LIRomNlXY=
github.com/rigdev/rig-go-sdk v0.0.0-20240612092526-69df8621bc22 h1:NFjBY/F42lcgqnqru+h1q3RrzRk645HUilCvbZD7exI=
github.com/rigdev/rig-go-sdk v0.0.0-20240612092526-69df8621bc22/go.mod h1:bmASl5RyuOoEddGeaOxHB27W3KDI4sBxqfnR1cRTstY=
github.com/rivo/tview v0.0.0-20240524063012-037df494fb76 h1:iqvDlgyjmqleATtFbA7c14djmPh2n4mCYUv7JlD/ruA=
Expand Down Expand Up @@ -516,8 +516,8 @@ gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuB
google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 h1:KAeGQVN3M9nD0/bQXnr/ClcEMJ968gUXJQ9pwfSynuQ=
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8=
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo=
google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 h1:QCqS/PdaHTSWGvupk2F/ehwHtGc0/GYkT+3GAcR1CCc=
google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI=
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 h1:X58yt85/IXCx0Y3ZwN6sEIKZzQtDEYaBWrDvErdXrRE=
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI=
google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E=
google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA=
Expand Down
11 changes: 10 additions & 1 deletion proto/rig/api/v1/metrics/metrics.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,13 @@ message Tags {
string environment = 2;
string capsule = 3;
string metric_name = 4;
}
}

message Keys {
bool project = 1;
bool environment = 2;
bool capsule = 3;
bool metric_name = 4;
bool all = 5;
}

8 changes: 5 additions & 3 deletions proto/rig/api/v1/metrics/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ message Expression {
Expression left = 1;
Expression right = 2;
BinOp operation = 3;
Tags tags = 4;
Keys on = 4;
Keys ignore = 5;
}

message Constant {
Expand All @@ -87,8 +88,9 @@ message Expression {
}

message Sum {
Tags tags = 1;
Expression expression = 2;
Keys on = 1;
Keys ignore = 2;
Expression expression = 3;
}

oneof expression {
Expand Down

0 comments on commit 64912f0

Please sign in to comment.