Skip to content

Commit 28a389b

Browse files
authored
OTLP: Move policy name to attributes (#699)
* OTLP: Move policy name to attributes * restore set_name
1 parent ab14a07 commit 28a389b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/CoreServer.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,10 @@ void CoreServer::_setup_routes(const PrometheusConfig &prom_config)
448448
try {
449449
auto [policy, lock] = _registry->policy_manager()->module_get_locked(p_mname);
450450
auto scope = resource.add_scope_metrics();
451-
scope->mutable_scope()->set_name(p_mname);
451+
scope->mutable_scope()->set_name("pktvisor/" + p_mname);
452+
auto attr = scope->mutable_scope()->add_attributes();
453+
attr->set_key("policy_name");
454+
attr->mutable_value()->set_string_value(p_mname);
452455
policy->opentelemetry_metrics(*scope);
453456
} catch (const std::exception &) {
454457
return false;

0 commit comments

Comments
 (0)