Aggregating labels between timeseries
up vote
0
down vote
favorite
I have metrics that look like this:
myMetric{client="A",server="1",otherlabel="W"} 10
myMetric{client="A",server="2",otherlabel="X"} 21
myMetric{client="B",server="1",otherlabel="Y"} 32
myMetric{client="B",server="4",otherlabel="Z"} 43
I'm trying to find this data:
myMetric{client="A",servers="1,2"} 31
myMetric{client="B",servers="1,4"} 75
Is this even possible? The data's there, I just can't figure out how to write the query.
prometheus promql
add a comment |
up vote
0
down vote
favorite
I have metrics that look like this:
myMetric{client="A",server="1",otherlabel="W"} 10
myMetric{client="A",server="2",otherlabel="X"} 21
myMetric{client="B",server="1",otherlabel="Y"} 32
myMetric{client="B",server="4",otherlabel="Z"} 43
I'm trying to find this data:
myMetric{client="A",servers="1,2"} 31
myMetric{client="B",servers="1,4"} 75
Is this even possible? The data's there, I just can't figure out how to write the query.
prometheus promql
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have metrics that look like this:
myMetric{client="A",server="1",otherlabel="W"} 10
myMetric{client="A",server="2",otherlabel="X"} 21
myMetric{client="B",server="1",otherlabel="Y"} 32
myMetric{client="B",server="4",otherlabel="Z"} 43
I'm trying to find this data:
myMetric{client="A",servers="1,2"} 31
myMetric{client="B",servers="1,4"} 75
Is this even possible? The data's there, I just can't figure out how to write the query.
prometheus promql
I have metrics that look like this:
myMetric{client="A",server="1",otherlabel="W"} 10
myMetric{client="A",server="2",otherlabel="X"} 21
myMetric{client="B",server="1",otherlabel="Y"} 32
myMetric{client="B",server="4",otherlabel="Z"} 43
I'm trying to find this data:
myMetric{client="A",servers="1,2"} 31
myMetric{client="B",servers="1,4"} 75
Is this even possible? The data's there, I just can't figure out how to write the query.
prometheus promql
prometheus promql
asked Nov 6 at 23:29
aayore
1158
1158
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
That's not possible, however:
sum without(server, otherLabel)(myMetric)
will give you that with just the client
label.
Thank you! I'm currently doing asum(myMetric) by (client)
, but then I'm not able to correlate the servers. :/
– aayore
Nov 7 at 15:59
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
That's not possible, however:
sum without(server, otherLabel)(myMetric)
will give you that with just the client
label.
Thank you! I'm currently doing asum(myMetric) by (client)
, but then I'm not able to correlate the servers. :/
– aayore
Nov 7 at 15:59
add a comment |
up vote
0
down vote
accepted
That's not possible, however:
sum without(server, otherLabel)(myMetric)
will give you that with just the client
label.
Thank you! I'm currently doing asum(myMetric) by (client)
, but then I'm not able to correlate the servers. :/
– aayore
Nov 7 at 15:59
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
That's not possible, however:
sum without(server, otherLabel)(myMetric)
will give you that with just the client
label.
That's not possible, however:
sum without(server, otherLabel)(myMetric)
will give you that with just the client
label.
answered Nov 7 at 9:08
brian-brazil
14k12735
14k12735
Thank you! I'm currently doing asum(myMetric) by (client)
, but then I'm not able to correlate the servers. :/
– aayore
Nov 7 at 15:59
add a comment |
Thank you! I'm currently doing asum(myMetric) by (client)
, but then I'm not able to correlate the servers. :/
– aayore
Nov 7 at 15:59
Thank you! I'm currently doing a
sum(myMetric) by (client)
, but then I'm not able to correlate the servers. :/– aayore
Nov 7 at 15:59
Thank you! I'm currently doing a
sum(myMetric) by (client)
, but then I'm not able to correlate the servers. :/– aayore
Nov 7 at 15:59
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53181636%2faggregating-labels-between-timeseries%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown