Skip to content

Commit

Permalink
OTLP: Move policy name to attributes (#699)
Browse files Browse the repository at this point in the history
* OTLP: Move policy name to attributes

* restore set_name
  • Loading branch information
leoparente authored Nov 11, 2023
1 parent ab14a07 commit 28a389b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/CoreServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,10 @@ void CoreServer::_setup_routes(const PrometheusConfig &prom_config)
try {
auto [policy, lock] = _registry->policy_manager()->module_get_locked(p_mname);
auto scope = resource.add_scope_metrics();
scope->mutable_scope()->set_name(p_mname);
scope->mutable_scope()->set_name("pktvisor/" + p_mname);
auto attr = scope->mutable_scope()->add_attributes();
attr->set_key("policy_name");
attr->mutable_value()->set_string_value(p_mname);
policy->opentelemetry_metrics(*scope);
} catch (const std::exception &) {
return false;
Expand Down

0 comments on commit 28a389b

Please sign in to comment.