Skip to content

Commit

Permalink
fix: collect separate metrics for root alised services and worker spe…
Browse files Browse the repository at this point in the history
…lls [fixes NET-431] (#1539)
  • Loading branch information
kmd-fl committed Apr 6, 2023
1 parent ed1ce37 commit 270cfd2
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion particle-services/src/app_services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,20 @@ impl ParticleAppServices {
// ));
// }

let service_type = ServiceType::Service(service.aliases.first().cloned());
// Metrics collection are enables for services with aliases which are installed on root worker or worker spells.
let allowed_alias = if worker_id == self.config.local_peer_id {
service.aliases.first().cloned()
} else if service
.aliases
.first()
.map(|alias| alias == "worker-spell")
.unwrap_or(false)
{
Some("worker-spell".to_string())
} else {
None
};
let service_type = ServiceType::Service(allowed_alias);

// TODO: move particle vault creation to aquamarine::particle_functions
self.create_vault(&particle.id)?;
Expand Down

0 comments on commit 270cfd2

Please sign in to comment.