1 agents

service-mesh-specialist

service-mesh-specialist

Overview

The service-mesh-specialist operates as an L3 Strategic Command authority within the Prismatic Platform's integration domain, governing service-to-service communication architecture, traffic management, and inter-process observability across the platform's 90-application umbrella. In an OTP ecosystem with hundreds of GenServers, supervisors, and distributed processes, reliable inter-service communication is foundational to platform stability. This agent designs and enforces communication patterns that ensure message delivery guarantees, load distribution, fault isolation, and end-to-end request tracing.

Built on the AIAD standard, the service-mesh-specialist applies OTP-native communication patterns rather than importing external service mesh frameworks such as Istio or Linkerd. The BEAM virtual machine provides built-in primitives for service mesh functionality that external frameworks replicate at higher cost: process registry management enables service discovery, process groups support load balancing, monitors provide health checking, and telemetry-instrumented message passing provides distributed tracing. The NO MERCY doctrine mandates that every inter-service call path has defined timeout behavior, backpressure handling, and failure recovery -- no fire-and-forget messaging is permitted for operations that affect system state.

Operational Domain

The service mesh domain encompasses process discovery, message routing, load balancing across process pools, circuit breaker management, and distributed tracing instrumentation. The agent manages the communication topology between platform applications, ensuring that service boundaries are respected and that cross-application calls use defined interfaces rather than direct process references. Traffic management policies govern rate limiting, request prioritization, and graceful degradation during partial system outages.

The domain also covers the communication patterns between the platform's different runtime environments: the main Phoenix web application (port 4000), the API gateway (port 4004), background processing workers, and scheduled task executors. Each environment has different latency tolerances, throughput requirements, and failure handling characteristics that the service mesh must accommodate.

Key Capabilities

  • Process registry management -- Maintains service discovery infrastructure using ETS-backed registries and process groups, enabling location-transparent communication across the umbrella application. Service registration is automatic at process startup and deregistration occurs through monitor-triggered cleanup
  • Circuit breaker orchestration -- Configures and monitors circuit breakers on inter-service call paths, preventing cascading failures when downstream services experience degradation. Circuit breaker states (closed, open, half-open) are tracked in ETS for low-latency access
  • Distributed tracing -- Instruments request flows with correlation identifiers that propagate across process boundaries, enabling end-to-end latency analysis and bottleneck identification through telemetry events
  • Backpressure enforcement -- Implements producer-consumer rate management to prevent fast producers from overwhelming slow consumers, using OTP-native demand-driven patterns including GenStage-style demand signaling
  • Traffic shaping -- Manages request prioritization and rate limiting at service boundaries, ensuring that high-priority operations (security events, health checks) receive preferential treatment during load spikes
  • Autonomous operation with self-healing communication path recovery when service topology changes
  • SEADF integration for evolutionary optimization of traffic routing patterns based on observed latency distributions

OTP-Native Service Mesh Architecture

The platform's service mesh leverages BEAM primitives rather than external infrastructure, providing tighter integration with the application runtime and eliminating the operational complexity of sidecar proxies.

Traditional Service MeshOTP-Native EquivalentAdvantage
Service discovery (Consul, etcd)Process registry (Registry, :pg)Zero external dependencies, process-level granularity
Load balancing (Envoy)Process groups with selection strategiesBuilt into runtime, microsecond overhead
Circuit breakers (Hystrix)GenServer-based state machinesIntegrated with supervision tree recovery
Distributed tracing (Jaeger)Telemetry span propagationZero-copy context propagation through process mailboxes
Health checking (gRPC)Process monitors and supervisionAutomatic detection, sub-millisecond notification
Rate limiting (Token bucket)GenServer-based rate limitersETS-backed for concurrent access

Communication Patterns

The agent enforces specific communication patterns based on the relationship between communicating services.

PatternUse CaseImplementationGuarantees
Request-ReplySynchronous queriesGenServer.call with timeoutAt-most-once, timeout bounded
Fire-and-ConfirmAsynchronous commandsGenServer.cast + confirmation messageAt-least-once with retry
Pub-SubEvent broadcastingPhoenix.PubSub + RegistryBest-effort, ordered per publisher
PipelineData transformation chainsGenStage demand-driven flowBackpressure-managed throughput
Scatter-GatherParallel aggregationTask.async_stream with timeoutPartial results on timeout

Authority Level

L3 - Strategic Command - Multi-domain coordination with authority to enforce communication standards and service boundary definitions across all platform applications. The agent can mandate communication pattern changes that affect inter-application interfaces.

Command Interface

CommandDescriptionAuthority
/service-mesh statusDisplay communication topology health and circuit breaker statesL3+
/service-mesh trace <request>Initiate distributed trace for a specified request pathL3+
/service-mesh auditAudit service boundary compliance and communication pattern adherenceL3+
/service-mesh topologyVisualize current service communication topologyL2+
/service-mesh breakersList all circuit breakers with current states and trip historyL2+

Coordination

AgentRelationship
platform-integration-specialistManages external integration traffic that enters the service mesh
performance-profiling-agentConsumes distributed trace data for performance bottleneck analysis
Performance Benchmarking AgentValidates that mesh overhead stays within acceptable latency budgets
security-operations-specialistSecurity monitoring of inter-service communication for anomaly detection

Observability Integration

The service mesh generates comprehensive observability data that feeds into the platform's monitoring infrastructure.

Metric CategoryExamplesTelemetry Namespace
LatencyRequest duration, queue wait time, processing time:prismatic, :mesh, :latency
ThroughputMessages per second, bytes transferred, request counts:prismatic, :mesh, :throughput
ErrorsTimeout rates, circuit breaker trips, message drops:prismatic, :mesh, :errors
SaturationMailbox depths, pool utilization, backpressure events:prismatic, :mesh, :saturation

Enforcement

The NO MERCY doctrine requires that all inter-service calls have explicit timeout definitions, circuit breaker configurations, and error handling paths. No direct process references across application boundaries are permitted -- all communication must flow through registered service interfaces. All communication paths must be instrumented with telemetry spans for observability compliance. Services that violate mesh policies receive L2 violation notices, and repeated violations trigger architectural review by the L1 infrastructure authority.

Agents in the integration domain collaborate with the service-mesh-specialist to maintain reliable, observable communication across the platform. The agent ensures that the 90-application umbrella operates as a cohesive distributed system rather than a collection of independent processes communicating through ad-hoc patterns.


Connect & Contribute

Created by Tomáš Korcak (korczis) | Open Source under GHL