WIP: Gleam PoC for poller #2247
Closed
mfreeman451 wants to merge 12 commits from
refs/pull/2247/head into main
pull from: refs/pull/2247/head
merge into: carverauto:main
carverauto:staging
carverauto:demo/prod-release
carverauto:add-dashboard-srql-service-views
carverauto:enhance-dashboard-creator-visual-builder
carverauto:fix-release-1-2-78-ci-failures
carverauto:refactor-agent-plugin-runtime
carverauto:add-dashboard-creator
carverauto:update/plugin-system
carverauto:add-service-monitoring-foundation
carverauto:fix/cli-auth-settings-navigation
carverauto:fix/device-unknown-facet
carverauto:fix-plugin-assignment-upgrades
carverauto:fix/sweep-profile-mode-status
carverauto:fix/armis-northbound-fixes
carverauto:fix-proxmox-console-react-client-render
carverauto:fix-openbao-signing-job-token-mount
carverauto:fix-services-plugin-status-read-model
carverauto:fix-stream-status-final-chunk
carverauto:codex/fix-prod-armis-sync-icmp
carverauto:fix-demo-cnpg-operator-networkpolicy
carverauto:update/docs-cleanup
carverauto:fix-armis-northbound-raw-token-auth
carverauto:fix-armis-northbound-stuck-running
carverauto:update-manual-device-hostname-readd
carverauto:fix/observability-severity-card-links
carverauto:renovate/debian_testing_slim-testing-slim
carverauto:docs/kubernetes-ingestion-gateway
carverauto:fix/flow-collector-external-network-policy
carverauto:fix/armis-availability-and-stream-config
carverauto:refactor-fast-fresh-db-bootstrap
carverauto:fix/cnpg-not-found
carverauto:fix/docker-update/cnpg
carverauto:renovate/debian_bookworm_slim-bookworm-slim
carverauto:add-socket-firewall-ci
carverauto:add-ipv6-sweep-scanners
carverauto:fix-armis-northbound
carverauto:add-streamed-agent-config
carverauto:fix/sweep-ip-family-routing
carverauto:codex/fix-core-migration-hook-upgrade
carverauto:renovate/arc_runner
carverauto:renovate/actions_runner
carverauto:codex/remote-access-desktop-rdp
carverauto:updates/missing-fixes
carverauto:fix/batched-sweep-targets
carverauto:fix/agent-sysmon-memory-growth
carverauto:fix/armis-northbound-single-run-and-timestamps
carverauto:release/1.2.67
carverauto:fix/wasm-plugin-service-status
carverauto:fix/armis-names-string
carverauto:codex/harden-remote-access-app-tcp-followup
carverauto:codex/harden-remote-access-app-tcp
carverauto:codex/harden-gateway-proxy-auth
carverauto:codex/harden-remote-access-destroy-rbac
carverauto:codex/harden-ssh-ca-remote-access
carverauto:codex/harden-remote-access-broker-registry
carverauto:codex/harden-remote-access-approval-policy
carverauto:codex/harden-remote-access-file-transfer
carverauto:codex/harden-remote-access-attach-ticket
carverauto:fix-release-plugin-list-cleanup
carverauto:codex/harden-grpc-logger-payloads
carverauto:propose-interface-action-target-context
carverauto:add-signed-northbound-action-callbacks
carverauto:fix/reap-stale-self-scheduled-oban-jobs
carverauto:fix/device-logs-tab-async
carverauto:fix/device-metadata-summary
carverauto:fix/northbound-launch-target-auth
carverauto:fix/northbound-provider-atomic-read
carverauto:proposal/add-sample-northbound-wasm-plugin
carverauto:proposal/northbound-action-integrations
carverauto:fix/ansible-run-job-device-launch
carverauto:codex/fix-audit-events-shell-theme
carverauto:codex/fix-sweep-tcp-availability
carverauto:codex/fix-armis-names-string
carverauto:fix/update-nats-2-14
carverauto:fix/elixir-quality-release-blockers
carverauto:fix/latest-release-device-ingest-ui-bugs
carverauto:fix/release-1.2.61-ci-failures
carverauto:fix/web-ng-precommit-format
carverauto:fix/wasm-tinygo-go125
carverauto:fix/agent-file-transfer-bazel-src
carverauto:fix/release-key-stamp-root
carverauto:fix/release-1.2.59-staging
carverauto:main
carverauto:fix/agent-accept-deprecated-remote-access-config
carverauto:fix/device-results-count-facets
carverauto:fix/bazelisk-installer-retries
carverauto:fix/tinygo-host-toolchain-fetch
carverauto:add-per-agent-availability
carverauto:fix/forgejo-release-multipart-assets
carverauto:fix/agent-config-stale-session
carverauto:fix/mtr-hop-dns-resolution
carverauto:fix/hostname-only-device-create
carverauto:fix/otlp-log-metadata-sanitization
carverauto:fix/sweep-icmp-legacy-mode-classification
carverauto:add-nats-object-store-retention
carverauto:fix/helm-serviceradar-state-pvc
carverauto:harden/forgejo-ci-nonroot
carverauto:codex/expand-remote-access-teleport-parity
carverauto:fix/sweep-port-history-consistency
carverauto:fix/remote-access-ssh-feature-flag
carverauto:fix/devices-refresh-artifacts
carverauto:fix/identity-ingestion-sweep-availability
carverauto:spec/identity-cache-ingestion-correctness
carverauto:fix/sweep-mapper-promotion-stale-cache
carverauto:fix/sweep-provisional-duplicate-ip
carverauto:fix/sweep-target-invalid-ip-order
carverauto:fix/armis-large-sync-streaming
carverauto:fix/docusaurus-blog-build-date
carverauto:fix/armis-sync-compat-deep-dive
carverauto:fix/awx-controller-credential-secret
carverauto:fix/demo-release-source-branch
carverauto:demo/release-v1.2.44-source-fix
carverauto:codex/teleport-agent-routed-remote-access
carverauto:feature/agent-config-dependency-catalog
carverauto:proposal/agent-config-dependency-catalog
carverauto:bugfix/armis-credentials-save-display
carverauto:bugfix/armis-integration-credentials
carverauto:fix/web-ng-precommit-formatting
carverauto:bugfix/armis-secret-config-push
carverauto:feature/close-controllers-to-pipelines
carverauto:carverauto/extract-palisade
carverauto:feature/migrate-dashboard-cli-to-plugs
carverauto:feature/audit-history-page
carverauto:feature/migrate-controllers-to-security-pipelines
carverauto:fix/security-events-test-and-retention-worker
carverauto:feature/add-platform-security-hardening
carverauto:demo-rollout-proxmox-bazel-fix
carverauto:bug/armis-sync-issues
carverauto:add-virtualization-srql-queries
carverauto:add-proxmox-ingestion-hardening-tests
carverauto:add-ssh-private-key-credential-rules
carverauto:redact-plugin-credential-material
carverauto:add-credential-rules-settings-entry
carverauto:add-credential-rules-settings-flows
carverauto:require-network-credential-broker-grants
carverauto:preview-credential-rule-target-scope
carverauto:add-proxmox-credential-secret-preset
carverauto:harden-credential-rules-live-tests
carverauto:clarify-proxmox-plugin-credential-modes
carverauto:docs-proxmox-credential-operations
carverauto:fingerprint-proxmox-candidates
carverauto:proxmox-resource-efficiency-dashboard
carverauto:proxmox-console-security-docs
carverauto:proxmox-focused-quality-validation
carverauto:proxmox-metric-baseline-alerts
carverauto:proxmox-device-scoped-logs
carverauto:proxmox-defer-vector-log-forwarding
carverauto:proxmox-console-session-tickets
carverauto:proxmox-console-xterm-shell
carverauto:proxmox-console-websocket-broker
carverauto:proxmox-console-control-frames
carverauto:proxmox-console-agent-session-manager
carverauto:proxmox-console-plugin-pty-bridge
carverauto:proxmox-console-assignment-materializer
carverauto:proxmox-console-ssh-connector
carverauto:proxmox-console-agent-local-broker
carverauto:proxmox-console-device-actions
carverauto:proxmox-console-stream-timeouts
carverauto:proxmox-console-guest-mode-gating
carverauto:proxmox-console-ci-race-fix
carverauto:fix/falco-alert-routing-datasvc-channel
carverauto:fix-agent-release-page-bugs
carverauto:add-proxmox-device-details-summary
carverauto:add-proxmox-virtualization-ingestor
carverauto:add-virtualization-inventory-schema
carverauto:add-proxmox-infrastructure-inventory
carverauto:add-proxmox-plugin-live-smoke
carverauto:add-proxmox-local-api-smoke
carverauto:add-proxmox-credential-test-dispatch
carverauto:add-proxmox-credential-test-plan
carverauto:add-network-credential-rule-preview
carverauto:add-proxmox-plugin-inventory-details
carverauto:add-proxmox-credential-reconcile-worker
carverauto:add-proxmox-credential-assignment-materializer
carverauto:add-plugin-input-template-secret-refs
carverauto:add-proxmox-plugin-policy-inputs
carverauto:add-proxmox-wasm-plugin-scaffold
carverauto:add-network-credential-rules-model
carverauto:add-proxmox-plugin-credential-rules
carverauto:fix/rperf-rustls-provider-demo
carverauto:fix/dashboard-template-sdk-014
carverauto:fix/tinygo-go126-release
carverauto:fix/reqsign-provider-bazel-deps
carverauto:fix/release-bazel-rust-crates
carverauto:fix/core-coordinator-connection-leak
carverauto:chore/security-updates
carverauto:update/readme-versions-update
carverauto:docs/readme-dashboard-sdk
carverauto:chore/cli-0.1.5
carverauto:fix/dashboard-cli-local-map-dev
carverauto:fix/dashboard-cli-hmr-map-libraries
carverauto:chore/bump-serviceradar-cli-0.1.2
carverauto:fix/dashboard-cli-hmr-harness
carverauto:fix/helm-contour-liveview-websocket
carverauto:fix/helm-cnpg-pooler-defaults
carverauto:updates/helm-fixes
carverauto:update/fix-light-mode-analytics
carverauto:ual/dashboard-sdk-dx
carverauto:security/postgres-update
carverauto:update-falco-alert-diagnostics
carverauto:ual/react-dashboard-sdk
carverauto:fix/cnpg-saturation-fk-and-bootstrap
carverauto:ual/wifi-site-map
carverauto:fix-coraza-log-db-writer
carverauto:fix-log-viewer-syslog-processed
carverauto:plan-fieldsurvey-spatial-selection
carverauto:plan-envoy-coraza-waf
carverauto:plan-alienvault-otx-integration
carverauto:plan-fieldsurvey-sidekick-daemon
carverauto:cleanup-openspec-archive-closed-proposals
carverauto:bug-core-elx-ip-enrichment-reap
carverauto:fix-release-libcap2-pin-v125
carverauto:fix-camera-stream-gateway-route
carverauto:add-core-elx-prometheus-metrics
carverauto:add-serviceradar-observability-dashboards
carverauto:add-pgbouncer-helm-cnpg
carverauto:renovate/ghcr.io-actions-actions-runner
carverauto:feat/cluster-agent-runtime-metadata-stability
carverauto:feat/observability-shell-standardization
carverauto:feat/observability-live-log-toggle
carverauto:fix/mtr-bulk-queue-and-srql-targets
carverauto:fix/mtr-profile-protocol-keyerror
carverauto:fix/mtr-diagnostics-keyerror
carverauto:add-demo-rollout-skills
carverauto:fix-web-ng-test-support-dialyzer
carverauto:fix-web-ng-dialyzer-findings
carverauto:add-bulk-queued-mtr-diagnostics
carverauto:fix-serviceradar-core-integration-failures
carverauto:harden-agent-updater-exec-arguments
carverauto:harden-agent-release-trust-boundaries
carverauto:fix-compose-hermetic-nats-datasvc-bootstrap
carverauto:fix/openbao-release-issues
carverauto:elixir/formatting-updates
carverauto:codex/demo-cnpg-signing-release-fixes
carverauto:chore/lint-fixes
carverauto:fix/bazel-alpine-bump-and-cosign-skip
carverauto:update-event-alert-dedup-and-suppression
carverauto:armis-northbound-events
carverauto:armis-northbound-availability-updates
carverauto:push-owvypksrmooo
carverauto:codex/topology-endpoint-evidence-investigation
carverauto:codex/topology-bootstrap-and-layout-simplification
carverauto:codex/remove-ingress-nginx-edge
carverauto:fix/forgejo-ci-snmp-cache-and-ubuntu24
carverauto:bug/cnpg-mtls-failure
carverauto:bug/log-collector
carverauto:fix/forgejo-runner-labels
carverauto:fix/cargo-lock-sync
carverauto:remove-arc-runner-from-push-all
carverauto:fix-push-all-cosign-preflight
carverauto:fix-go-ci
carverauto:add-versioned-openapi-publish
carverauto:chore/forgejo-hardening
carverauto:security/k8s-hardening
carverauto:update/cluster-page-agents
carverauto:updates/helm-security-updates
carverauto:2406-feat-agent-fleet-management-secure-self-update-system
carverauto:bug/k8s-helm-deployments
carverauto:chore/k8s-arc-update
carverauto:rust-fix
carverauto:2371-analytics-stats-cards-should-abbreviate-numbers
carverauto:chore/perl-cleanup
carverauto:2942-featweb-ng-add-logs-tab-to-device-details-page
carverauto:192-feat-tftp-server
carverauto:mikemiles-dev/feature/netflow_collection
carverauto:testing
carverauto:dependabot/cargo/hostname-0.4.1
carverauto:dependabot/cargo/redis-1.0.1
carverauto:dependabot/cargo/bb8-0.9.0
carverauto:dependabot/cargo/rcgen-0.14.6
carverauto:dependabot/cargo/hyper-1.8.1
carverauto:dependabot/cargo/hyper-util-0.1.19
carverauto:dependabot/cargo/clap-4.5.51
carverauto:dependabot/cargo/thiserror-2.0.17
carverauto:dependabot/cargo/time-tz-2.0.0
carverauto:dependabot/cargo/tonic-build-0.14.2
carverauto:backup/main-pre-staging-sync-2026-04-02
carverauto:dependabot/npm_and_yarn/docs/mdast-util-to-hast-13.2.1
carverauto:815-feat-support-win32-for-agentpoller
carverauto:gh-pages
No reviewers
Labels
Clear labels
1week
2weeks
Failed compliance check
IP cameras
NATS
NATS JetStream
Possible security concern
Review effort 1/5
Review effort 2/5
Review effort 3/5
Review effort 4/5
Review effort 5/5
UI
aardvark
accessibility
amd64
api
arm64
auth
back-end
bgp
blog
bug
Something isn't working
build
checkers
ci-cd
continuous integration-continuous deployments
cleanup
cnpg
cloud-native postgres
codex
core
core service
dependencies
Pull requests that update a dependency file
device-management
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
dusk
ebpf
enhancement
New feature or request
eta 1d
eta 1hr
eta 3d
eta 3hr
feature
fieldsurvey
github_actions
Pull requests that update GitHub Actions code
go
Pull requests that update Go code
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
javascript
Pull requests that update Javascript code
k8s
log-collector
mapper
mtr
multi traceroute
needs-triage
netflow
network-sweep
observability
oracle
Oracle Linux related issues
otel
opentelemetry logs, traces, metrics
plug-in
proton
timeplus proton streaming database
python
question
Further information is requested
reddit
redhat
research
rperf
rperf-checker
rust
Pull requests that update rust code
sdk
security
serviceradar-agent
serviceradar-agent-gateway
serviceradar-web
serviceradar-web-ng
siem
snmp
sysmon
topology
ubiquiti
wasm
wontfix
This will not be worked on
zen-engine
No labels
1week
2weeks
Failed compliance check
IP cameras
NATS
Possible security concern
Review effort 1/5
Review effort 2/5
Review effort 3/5
Review effort 4/5
Review effort 5/5
UI
aardvark
accessibility
amd64
api
arm64
auth
back-end
bgp
blog
bug
build
checkers
ci-cd
cleanup
cnpg
codex
core
dependencies
device-management
documentation
duplicate
dusk
ebpf
enhancement
eta 1d
eta 1hr
eta 3d
eta 3hr
feature
fieldsurvey
github_actions
go
good first issue
help wanted
invalid
javascript
k8s
log-collector
mapper
mtr
needs-triage
netflow
network-sweep
observability
oracle
otel
plug-in
proton
python
question
reddit
redhat
research
rperf
rperf-checker
rust
sdk
security
serviceradar-agent
serviceradar-agent-gateway
serviceradar-web
serviceradar-web-ng
siem
snmp
sysmon
topology
ubiquiti
wasm
wontfix
zen-engine
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set.
Reference
carverauto/serviceradar!2247
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2247/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from GitHub pull request.
Original GitHub pull request: #1667
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/1667
Original created: 2025-09-29T01:44:22Z
Original updated: 2025-12-08T06:55:18Z
Original head: carverauto/serviceradar:update/gleam_poller_poc
Original base: main
PR Type
Enhancement, Documentation, Tests
Description
• Complete Gleam/BEAM poller implementation with comprehensive architecture including gRPC communication, agent coordination, and core service integration
• Detailed migration documentation with product requirements, security architecture, and implementation plan for ServiceRadar transition from Go to Gleam/BEAM
• Full test coverage with 24 passing tests covering supervisor lifecycle, agent coordination, gRPC client functionality, and configuration management
• Protobuf integration using protozoa library with code generation, HTTP-based gRPC client, and monitoring service definitions
• Security-enhanced supervision trees with circuit breaker patterns, mTLS support, and authenticated message systems
• Working end-to-end demonstration with orchestrated workflow from agent communication to core service reporting
Diagram Walkthrough
File Walkthrough
5 files
plan.md
Complete Gleam poller implementation plan with MVP statusgleam/poller/plan.md
• Comprehensive implementation plan for migrating ServiceRadar poller
from Go to Gleam/BEAM
• Detailed architecture design with
security-enhanced supervision trees and agent coordination
• Complete
MVP progress status showing 24 passing tests and working end-to-end
demonstration
• Next implementation phases including gRPC integration
with protozoa library evaluation
security_poc.md
Gleam/BEAM security architecture and certificate management PoCgleam/security_poc.md
• Multi-layer security architecture for Gleam/BEAM services with
defense-in-depth approach
• Certificate management strategy with mTLS
for gRPC and secure BEAM distribution
• Implementation of
authenticated message system with RBAC and rate limiting
• Security
monitoring and alerting framework with comprehensive event logging
GLEAM_BEAM_MIGRATION_PRD.md
ServiceRadar Gleam/BEAM migration product requirements documentgleam/GLEAM_BEAM_MIGRATION_PRD.md
• Product requirements document for migrating ServiceRadar services to
Gleam/BEAM
• Detailed problem statement addressing Go implementation
challenges and BEAM advantages
• Four-phase implementation plan with
success metrics and risk assessment
• Code examples comparing Go vs
Gleam implementations for fault tolerance and streaming
README.md
Add matrix test project documentationgleam/matrix_test/README.md
• Standard README template for Gleam project
• Includes package
information and development instructions
• Basic documentation
structure
README.md
Add poller project documentationgleam/poller/README.md
• Standard README template for poller project
• Includes package
information and development instructions
• Basic documentation
structure for the poller package
12 files
core_service.gleam
Core service gRPC communication with streaming supportgleam/poller/src/poller/core_service.gleam
• Core service gRPC communication module for reporting service
statuses to ServiceRadar core
• Implementation of batch status
reporting and streaming for large datasets
• Type conversions between
internal and monitoring service status formats
• Real gRPC calls using
grpc_http_clientwith HTTP/2 transport and protobuf encodingmonitoring_types.gleam
Add monitoring protobuf type definitionsgleam/poller/src/monitoring_types.gleam
• Defines comprehensive monitoring types matching ServiceRadar
protobuf schema
• Includes request/response types for agent
communication (
StatusRequest,StatusResponse,ResultsRequest,ResultsResponse)• Adds poller service types for core communication
(
PollerStatusRequest,PollerStatusResponse)• Implements sweep
completion status tracking with helper conversion functions
grpc_client.gleam
Implement gRPC client for agent communicationgleam/poller/src/poller/grpc_client.gleam
• Implements gRPC client interface for ServiceRadar agent
communication
• Provides channel creation, connection, and status
checking functionality
• Includes type conversions between internal
types and gRPC requests/responses
• Contains temporary implementation
for communicating with existing Go agents
agent_coordinator.gleam
Implement agent coordinator with circuit breakergleam/poller/src/poller/agent_coordinator.gleam
• Implements agent coordination with connection state management
•
Provides circuit breaker pattern for fault tolerance
• Manages gRPC
channel lifecycle for agent communication
• Includes service check
execution with error handling
poller.gleam
Add main poller orchestration and demogleam/poller/src/poller.gleam
• Main entry point demonstrating complete poller workflow
•
Orchestrates supervisor, agent coordinator, and core service
communication
• Executes sample service checks and reports results to
core
• Provides comprehensive architecture documentation in output
grpc_http_client.gleam
Implement HTTP-based gRPC clientgleam/poller/src/grpc_http_client.gleam
• Implements HTTP-based gRPC client using protobuf encoding
• Provides
real gRPC calls over HTTP/2 with proper headers
• Includes
comprehensive gRPC status code handling
• Integrates with monitoring
codec for protobuf serialization
monitoring_codec.gleam
Add protobuf codec implementationgleam/poller/src/monitoring_codec.gleam
• Implements protobuf encoding/decoding using protozoa library
•
Provides conversion between Gleam types and protobuf wire format
•
Includes field number constants matching monitoring.proto schema
•
Adds gRPC-specific helper functions for content types and paths
types.gleam
Define core poller data typesgleam/poller/src/poller/types.gleam
• Defines core data types for poller configuration and operation
•
Includes configuration types with security and TLS support
• Defines
service status, circuit breaker, and connection state types
• Provides
comprehensive error types for different failure scenarios
core_service.gleam
Implement core service communicationgleam/poller/src/poller/core_service.gleam
• Implements core service communication channel management
• Provides
status reporting functionality with batching support
• Includes
streaming capabilities for large status reports
• Integrates with
monitoring codec for protobuf communication
proto.gleam
Add generated protobuf service definitionsgleam/poller/src/proto.gleam
• Auto-generated protobuf service definitions from monitoring.proto
•
Defines client and server interfaces for AgentService
• Includes
method signatures for all service operations
• Provides foundation for
gRPC service implementation
codegen.gleam
Add protobuf code generation scriptgleam/poller/src/codegen.gleam
• Implements code generation script for protobuf definitions
• Uses
protozoa library to parse and generate Gleam code
• Provides automated
generation from monitoring.proto file
• Includes error handling for
file operations and parsing
simple_supervisor.gleam
Add simple supervisor implementationgleam/poller/src/poller/simple_supervisor.gleam
• Implements basic supervisor functionality for process management
•
Provides supervisor state management with configuration validation
•
Includes start/stop operations with error handling
• Offers helper
functions for supervisor status and configuration access
6 files
monitoring.proto
ServiceRadar monitoring protobuf service definitionsgleam/poller/proto/monitoring.proto
• Complete protobuf definition for ServiceRadar monitoring services
•
Agent and Poller service definitions with status reporting and
streaming RPCs
• Message types for device status, results, and chunked
streaming responses
• Sweep completion status tracking for
coordination between services
test.yml
GitHub Actions CI workflow for Gleam testinggleam/matrix_test/.github/workflows/test.yml
• GitHub Actions workflow configuration for automated testing
• Setup
with Erlang/OTP 27.1.2 and Gleam 1.12.0 versions
• Automated
dependency download, testing, and code formatting checks
• Triggers on
push to main/master branches and pull requests
config.gleam
Add configuration management and validationgleam/poller/src/poller/config.gleam
• Implements configuration validation with comprehensive error
handling
• Provides default configuration creation and agent
management
• Validates core addresses, poll intervals, and agent
configurations
• Includes helper functions for configuration updates
gleam.toml
Configure Gleam project settingsgleam/poller/gleam.toml
• Defines Gleam project configuration with dependencies
• Includes
HTTP client, protobuf, and testing libraries
• Sets up development
dependencies for code generation
• Configures project metadata and
build settings
manifest.toml
Add matrix test project manifestgleam/matrix_test/manifest.toml
• Basic Gleam project manifest with minimal dependencies
• Includes
only standard library and testing framework
• Simple configuration for
matrix test project
gleam.toml
Configure matrix test projectgleam/matrix_test/gleam.toml
• Basic Gleam project configuration for matrix test
• Minimal
dependencies setup with standard library
• Development dependencies
for testing
6 files
simple_supervisor_test.gleam
Simple supervisor unit tests with lifecycle managementgleam/poller/test/poller/simple_supervisor_test.gleam
• Unit tests for simple supervisor functionality including creation
and lifecycle management
• Test cases for starting/stopping supervisor
with agent configurations
• Validation tests for invalid
configurations and error handling
• Integration with agent
configuration and check definitions
core_service_test.gleam
Add comprehensive core service testsgleam/poller/test/poller/core_service_test.gleam
• Tests core service channel creation and connection functionality
•
Validates status reporting to core service with proper error handling
• Tests streaming status reports with chunking capabilities
• Includes
edge cases for disconnected channels and empty service lists
agent_coordinator_test.gleam
Add agent coordinator test suitegleam/poller/test/poller/agent_coordinator_test.gleam
• Tests agent coordinator creation with configuration validation
•
Validates agent connection/disconnection state management
• Tests
service check execution through coordinator
• Includes circuit breaker
functionality testing
grpc_client_test.gleam
Add gRPC client test coveragegleam/poller/test/poller/grpc_client_test.gleam
• Tests gRPC channel creation and connection functionality
• Validates
status request/response handling with proper conversions
• Tests error
scenarios including disconnected channels and failures
• Includes type
conversion testing between internal and gRPC types
config_test.gleam
Add configuration management testsgleam/poller/test/poller/config_test.gleam
• Tests configuration creation, validation, and management
• Validates
error handling for invalid configurations
• Tests agent addition,
removal, and retrieval operations
• Includes comprehensive validation
testing for all config fields
types_test.gleam
Add core types validation testsgleam/poller/test/poller/types_test.gleam
• Tests core type definitions including
Config,AgentConfig, andCheck• Validates security configuration with TLS settings
• Tests type
construction and field access patterns
• Ensures proper type
validation and structure
1 files
manifest.toml
Configure Gleam project dependenciesgleam/poller/manifest.toml
• Adds Gleam package dependencies for HTTP client, protobuf handling,
and testing
• Includes
protozoafor protobuf support andgleam_httpcfor HTTP communication
• Sets up development dependencies including
protozoa_devfor code generation1 files
matrix_test.gleam
Implement matrix transposition examplegleam/matrix_test/src/matrix_test.gleam
• Implements matrix transposition algorithm in Gleam
• Provides
recursive solution with pattern matching
• Includes main function
demonstrating usage
• Simple example of functional programming in
Gleam
9 files
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1667#issuecomment-3344570572
Original created: 2025-09-29T01:45:40Z
PR Reviewer Guide 🔍
Here are some key observations to aid the review process:
Documentation inaccuracies:
The security docs include shell commands and config that manage certificates and cookies; while not executable code, ensure instructions do not encourage storing secrets in repo or world-readable perms. Also verify that example service accounts and paths don’t leak real infrastructure details.
API Consistency
The plan mixes grpcbox and protozoa approaches and references multiple module/file names and APIs that differ across sections; ensure the chosen gRPC approach, module paths, and types are consistent to avoid implementation drift.
Key Modules:
3. Secure gRPC Communication
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1667#issuecomment-3344572132
Original created: 2025-09-29T01:46:55Z
PR Code Suggestions ✨
Explore these optional code suggestions:
Restructure PR to separate documentation and code
The PR should be restructured to improve reviewability. Move the extensive
documentation to a separate system and remove the unrelated
matrix_testproject,leaving only the relevant PoC code.
Examples:
gleam/poller/plan.md [1-1401]
gleam/matrix_test/src/matrix_test.gleam [1-31]
Solution Walkthrough:
Before:
After:
Suggestion importance[1-10]: 10
__
Why: The suggestion correctly identifies a critical structural flaw that makes the PR unreviewable by mixing extensive documentation, the core implementation, and a completely unrelated project.
Prevent infinite recursion in chunking
Replace the unsafe, recursive
chunk_servicesfunction with the standardlibrary's
list.sized_chunkto prevent potential infinite recursion and stackoverflow when
chunk_sizeis zero or negative.gleam/poller/src/poller/core_service.gleam [225-237]
Suggestion importance[1-10]: 9
__
Why: The suggestion correctly identifies a critical bug that would cause a stack overflow if
chunk_sizeis not a positive integer, and proposes a robust, idiomatic fix using the standard library.Handle gRPC status codes correctly
Update the gRPC client to parse the
grpc-statusandgrpc-messageheaders tocorrectly handle gRPC-level errors, as an HTTP 200 status does not guarantee a
successful gRPC call.
gleam/poller/src/grpc_http_client.gleam [81-99]
Suggestion importance[1-10]: 9
__
Why: This suggestion addresses a critical flaw in the gRPC client logic; ignoring the
grpc-statusheader would lead to incorrectly treating failed gRPC calls as successful, which is a major bug.Correctly set the data source
Update
internal_to_monitoring_service_statusto accept asourceparameterinstead of hardcoding it to
"status", ensuring correct data labeling fordifferent check types like "results".
gleam/poller/src/poller/core_service.gleam [204-222]
Suggestion importance[1-10]: 8
__
Why: This suggestion correctly identifies a data correctness bug where the
sourcefield is hardcoded, which would lead to incorrect data processing and metrics as per the protobuf definition.Propagate protobuf decoding errors properly
In
decode_poller_status_response, propagate protobuf decoding errors instead ofreturning a default
Okvalue to avoid hiding failures.gleam/poller/src/monitoring_codec.gleam [90-100]
Suggestion importance[1-10]: 7
__
Why: The suggestion correctly identifies that swallowing the decoding error is poor practice; propagating the error improves robustness and makes debugging easier by not masking potential server-side or schema-mismatch issues.
Fix inefficient faux-streaming implementation
Modify
call_core_send_chunkto use a true gRPC streaming call instead of sendingeach chunk as a separate unary request, which is highly inefficient and defeats
the purpose of streaming.
gleam/poller/src/poller/core_service.gleam [265-284]
Suggestion importance[1-10]: 7
__
Why: The suggestion correctly identifies a significant performance issue where a streaming function is implemented with inefficient unary calls, even though the author noted it's a temporary solution.
Handle missing agent configuration explicitly
Handle a missing agent configuration from
config.get_agentexplicitly byreturning a descriptive error, rather than creating a default invalid
AgentConfig.gleam/poller/src/poller.gleam [63-72]
Suggestion importance[1-10]: 6
__
Why: The suggestion improves code clarity and error handling by failing early with a specific error message when an agent configuration is missing, rather than relying on a downstream function to catch a manufactured invalid state.
Imported GitHub PR comment.
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/1667#issuecomment-3567696298
Original created: 2025-11-23T09:31:31Z
not going to implement this at this time
Pull request closed