fix: metrics doc_pid use pid as label

so it would be use on the other metrics for lookup with promql group_left

Change-Id: eaba5e26f99b4cb0843c16f6f5b840c6
Signed-off-by: genofire <geno+dev@fireorbit.de>
pull/7681/head
genofire 2023-11-17 13:14:41 +01:00 committed by Michael Meeks
parent e8e3a2ccdb
commit e4ac11756a
1 changed files with 2 additions and 1 deletions

View File

@ -1193,7 +1193,8 @@ void AdminModel::getMetrics(std::ostringstream &oss)
Poco::URI::encode(doc.getFilename(), " ", encodedFilename);
oss << "doc_pid{host=\"" << doc.getHostName() << "\","
"key=\"" << doc.getDocKey() << "\","
"filename=\"" << encodedFilename << "\"} " << pid << "\n";
"filename=\"" << encodedFilename << "\","
"pid=\"" << pid << "\"} 1\n";
std::string suffix = "{pid=\"" + pid + "\"} ";
oss << "doc_views" << suffix << doc.getViews().size() << "\n";