How newrelic/infrastructure-agent works
New Relic Infrastructure Agent collects host metrics and inventory, runs integrations, and sends telemetry to the New Relic platform. The principal workflow is agent startup and configuration, host and integration data collection, then backend delivery; identity connection and remote command handling are supporting runtime stages. The README documents the product workflow and capabilities; sampled excerpts and the SOURCE INDEX support only some internal links, so unverified runtime relationships are dashed rather than asserted.
Main entry points: agent.go Agent services · newrelic-infra.go Agent entry · manager.go Integration manager · plugins.go Host inventory plugins
Components 20
Agent runtime
- Agent entry
cmd/newrelic-infra/newrelic-infra.go - Configuration
pkg/config/config.go - Agent services
internal/agent/agent.go - Local HTTP API
internal/httpapi/httpapi.go - Command channel
internal/agent/cmdchannel/cmdchannel.go
Host collection
- Host metrics
pkg/metrics/system_sampler.go - Storage metrics
pkg/metrics/storage/storage_sampler.go - Process metrics
pkg/metrics/process/process.go - Host inventory plugins
pkg/plugins/plugins.go - Windows services
internal/plugins/windows/services.go - Inventory handler
internal/agent/inventory/handler.go
Integrations
- Integration manager
pkg/integrations/v4/manager.go - Integration runner
internal/integrations/v4/runner/runner.go - Config requests
pkg/integrations/configrequest/handler.go
Backend communication
- Identity connect
internal/agent/connect_service.go - Identity client
pkg/backend/identityapi/connect_client.go - Telemetry API
pkg/backend/telemetryapi/harvester.go - Inventory ingest
pkg/backend/inventoryapi/ingestapi.go
Other components
- Operator
- New Relic platform
Connections 21
- Operator → Agent entry: starts agent
- Agent entry → Configuration: loads settings
- Agent entry → Agent services: starts runtime
- Agent entry → Integration manager: starts integrations
- Agent entry → Local HTTP API: exposes API
- Agent services → Identity connect: connects identity
- Identity connect → Identity client: requests identity
internal/agent/connect_service.go - Identity client → New Relic platform: exchanges identity
- Agent services → Host metrics: collects metrics
- Agent services → Storage metrics: samples storage
- Agent services → Process metrics: samples processes
- Agent services → Host inventory plugins: collects inventory
- Host inventory plugins → Windows services: includes services
- Agent services → Inventory handler: handles inventory
- Inventory handler → Inventory ingest: posts deltas
internal/agent/inventory/handler.go - Integration manager → Integration runner: runs definitions
pkg/integrations/v4/manager.go - Config requests → Integration manager: updates definitions
- Integration manager → Config requests: handles requests
- Agent services → Command channel: handles commands
- Telemetry API → New Relic platform: sends telemetry
- Inventory ingest → New Relic platform: sends inventory