Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: collect separate metrics for root alised services and worker spells [fixes NET-431] #1539

Merged
merged 7 commits into from
Apr 6, 2023
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