mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 04:58:21 +00:00
Don't include endpoint label/value when collecting metrics internally
This commit is contained in:
parent
4718e5cf00
commit
abb84db6c8
4 changed files with 15 additions and 7 deletions
|
@ -124,8 +124,11 @@ public:
|
|||
std::vector<RecordValPtr> records;
|
||||
for ( const auto& ctr : counters ) {
|
||||
auto label_values_vec = make_intrusive<VectorVal>(string_vec_type);
|
||||
for ( const auto& [label_key, label] : ctr->Labels() )
|
||||
label_values_vec->Append(make_intrusive<StringVal>(label));
|
||||
for ( const auto& [label_key, label] : ctr->Labels() ) {
|
||||
// We don't include the endpoint key/value unless it's a prometheus request
|
||||
if ( label_key != "endpoint" )
|
||||
label_values_vec->Append(make_intrusive<StringVal>(label));
|
||||
}
|
||||
|
||||
auto r = make_intrusive<zeek::RecordVal>(metric_record_type);
|
||||
r->Assign(labels_idx, label_values_vec);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue