Add owner tag on partitions in burrow input (#4281)

This commit is contained in:
Arkady Emelyanov 2018-06-13 23:05:27 +03:00 committed by Daniel Nelson
parent 7557ad465b
commit 2d9f9e3f2d
4 changed files with 9 additions and 6 deletions

View File

@ -92,6 +92,7 @@ Supported Burrow version: `1.x`
- group (string) - group (string)
- topic (string) - topic (string)
- partition (int) - partition (int)
- owner (string)
* `burrow_topic` * `burrow_topic`
- cluster (string) - cluster (string)

View File

@ -116,6 +116,7 @@ type (
Start apiStatusResponseLagItem `json:"start"` Start apiStatusResponseLagItem `json:"start"`
End apiStatusResponseLagItem `json:"end"` End apiStatusResponseLagItem `json:"end"`
CurrentLag int64 `json:"current_lag"` CurrentLag int64 `json:"current_lag"`
Owner string `json:"owner"`
} }
// response: lag field item // response: lag field item
@ -447,6 +448,7 @@ func (b *burrow) genGroupLagMetrics(r *apiResponse, cluster, group string, acc t
"group": group, "group": group,
"topic": partition.Topic, "topic": partition.Topic,
"partition": strconv.FormatInt(int64(partition.Partition), 10), "partition": strconv.FormatInt(int64(partition.Partition), 10),
"owner": partition.Owner,
}, },
) )
} }

View File

@ -129,9 +129,9 @@ func TestBurrowPartition(t *testing.T) {
}, },
} }
tags := []map[string]string{ tags := []map[string]string{
{"cluster": "clustername1", "group": "group1", "topic": "topicA", "partition": "0"}, {"cluster": "clustername1", "group": "group1", "topic": "topicA", "partition": "0", "owner": "kafka1"},
{"cluster": "clustername1", "group": "group1", "topic": "topicA", "partition": "1"}, {"cluster": "clustername1", "group": "group1", "topic": "topicA", "partition": "1", "owner": "kafka2"},
{"cluster": "clustername1", "group": "group1", "topic": "topicA", "partition": "2"}, {"cluster": "clustername1", "group": "group1", "topic": "topicA", "partition": "2", "owner": "kafka3"},
} }
require.Empty(t, acc.Errors) require.Empty(t, acc.Errors)

View File

@ -10,7 +10,7 @@
{ {
"topic": "topicA", "topic": "topicA",
"partition": 0, "partition": 0,
"owner": "kafka", "owner": "kafka1",
"status": "OK", "status": "OK",
"start": { "start": {
"offset": 431323195, "offset": 431323195,
@ -28,7 +28,7 @@
{ {
"topic": "topicA", "topic": "topicA",
"partition": 1, "partition": 1,
"owner": "kafka", "owner": "kafka2",
"status": "OK", "status": "OK",
"start": { "start": {
"offset": 431322962, "offset": 431322962,
@ -46,7 +46,7 @@
{ {
"topic": "topicA", "topic": "topicA",
"partition": 2, "partition": 2,
"owner": "kafka", "owner": "kafka3",
"status": "OK", "status": "OK",
"start": { "start": {
"offset": 428636563, "offset": 428636563,