Don't include endpoint label/value when collecting metrics internally

This commit is contained in:
Tim Wojtulewicz 2024-03-12 14:17:36 -07:00
parent 4718e5cf00
commit abb84db6c8
4 changed files with 15 additions and 7 deletions

View file

@ -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);