-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add kafka fields needed for dashboards #8504
Changes from 1 commit
5a0a8b8
c8c4845
0a6334e
b266c2a
41c151f
935a103
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ package consumergroup | |
|
||
import ( | ||
"crypto/tls" | ||
"fmt" | ||
|
||
"github.com/pkg/errors" | ||
|
||
|
@@ -111,6 +112,10 @@ func (m *MetricSet) Fetch(r mb.ReporterV2) { | |
} | ||
|
||
emitEvent := func(event common.MapStr) { | ||
// Helpful IDs for dashboards | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would rather describe it as helpful for queries. For the future: I wonder if this is work that should be done in the processors to have it config based instead of in the code. |
||
partitionTopicID := fmt.Sprintf("%d-%s", event["partition"], event["topic"]) | ||
partitionTopicBrokerID := fmt.Sprintf("%s-%d", partitionTopicID, m.broker.ID()) | ||
|
||
// TODO (deprecation): Remove fields from MetricSetFields moved to ModuleFields | ||
event["broker"] = brokerInfo | ||
r.Event(mb.Event{ | ||
|
@@ -120,7 +125,9 @@ func (m *MetricSet) Fetch(r mb.ReporterV2) { | |
"name": event["topic"], | ||
}, | ||
"partition": common.MapStr{ | ||
"id": event["partition"], | ||
"id": event["partition"], | ||
"topic_id": partitionTopicID, | ||
"topic_broker_id": partitionTopicBrokerID, | ||
}, | ||
}, | ||
MetricSetFields: event, | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
"address": "172.18.0.2:9092", | ||
"id": 0 | ||
}, | ||
"id": 0, | ||
"offset": { | ||
"newest": 0, | ||
"oldest": 0 | ||
|
@@ -26,11 +27,13 @@ | |
"replica": 0 | ||
}, | ||
"topic": { | ||
"name": "foo-1532945633-185372965" | ||
} | ||
"name": "foo-1538389014-739473801" | ||
}, | ||
"topic_broker_id": "0-foo-1538389014-739473801-0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not really sure about the naming and placing of these composed ids, in demo they are directly at the module level as In any case I don't have a strong opinion on these names, so as you prefer. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see now that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The fields added in this PR are created by us to help on queries and don't exist in kafka, they identify the partition in the topic and in the broker (there can be two partitions with the same id, but of different topics, and two partitions with the same id and different topics and/or brokers), this is why I'd add them under There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible that that more then one topic.id shows up in a single event? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure of following you... a single event will have an only There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That actually answers my questions. There are 2 topic.id in 1 event so there have to be different fields like you suggested. |
||
"topic_id": "0-foo-1538389014-739473801" | ||
}, | ||
"topic": { | ||
"name": "foo-1532945633-185372965" | ||
"name": "foo-1538389014-739473801" | ||
} | ||
}, | ||
"metricset": { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Dot missing at the end.