Skip to content

Commit 7685554

Browse files
print debug [OC-2764]
1 parent e294939 commit 7685554

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

core/src/registry.cc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <iterator>
66
#include <stdexcept>
77
#include <tuple>
8+
#include <iostream>
89

910
#include "prometheus/counter.h"
1011
#include "prometheus/detail/future_std.h"
@@ -108,6 +109,16 @@ Family<T>& Registry::Add(const std::string& name, const std::string& help,
108109
std::lock_guard<std::mutex> lock{mutex_};
109110

110111
if (NameExistsInOtherType<T>(name)) {
112+
std::cerr << "Family name already exists with different type (name '" << name
113+
<< "', type: '" << typeid(T).name() << "')"
114+
<< std::endl;
115+
std::cerr << "help: " << help << std::endl;
116+
std::cerr << "labels: ";
117+
for (const auto& label : labels) {
118+
std::cerr << label.first << "=" << label.second << ",";
119+
}
120+
std::cerr << std::endl;
121+
111122
throw std::invalid_argument(
112123
"Family name already exists with different type");
113124
}

0 commit comments

Comments
 (0)