-
Notifications
You must be signed in to change notification settings - Fork 12
feat: send diode data over MQTT #222
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
Conversation
|
Go test coverage
Total coverage: 57.1% |
7c48cf0 to
a9f7b53
Compare
leoparente
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request introduces support for a new Fleet MQTT telemetry topic and enhances the OTLP bridge to route telemetry data separately from ingest data. The changes include automatic OTLP gRPC endpoint configuration for fleet-managed agents and updates the bridge to use JSON encoding while binding to both ingest and telemetry topics.
- Added telemetry topic support to Fleet MQTT topics structure for separate routing of telemetry data
- Implemented routing logic in OTLP bridge to distinguish between ingest and telemetry requests based on policy name attributes
- Auto-configured OTLP gRPC endpoint for fleet-managed agents with fallback creation of missing configuration sections
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| agent/otlpbridge/server.go | Added getter/setter methods for telemetry topic management |
| agent/otlpbridge/handlers.go | Implemented request routing logic to distinguish ingest vs telemetry and route to appropriate topics |
| agent/otlpbridge/handlers_test.go | Updated test to use telemetry topic instead of ingest topic for logs handler |
| agent/configmgr/fleet.go | Updated bridge initialization to bind to both ingest and telemetry topics with JSON encoding |
| agent/configmgr/fleet_test.go | Updated tests to verify telemetry topic binding and configuration |
| agent/configmgr/fleet/topics.go | Added telemetry topic template and field to TokenResponseTopics struct |
| agent/configmgr/fleet/topics_test.go | Added test to verify telemetry topic generation |
| agent/configmgr/fleet/jwt_claims_test.go | Updated test fixtures to include ingest and telemetry topics |
| agent/configmgr/fleet/connection_hooks_test.go | Updated test data to include telemetry topic |
| agent/agent.go | Added auto-configuration logic for OTLP gRPC endpoint when fleet config manager is active |
| agent/agent_test.go | Added comprehensive tests for OTLP auto-configuration scenarios |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request introduces support for a new Fleet MQTT telemetry topic and enhances the Fleet config manager's OTLP bridge integration. The changes ensure that when the Fleet config manager is active, the agent auto-configures the OTLP gRPC endpoint, and the bridge now uses JSON encoding and is bound to both ingest and telemetry topics. Comprehensive tests have been added to verify these behaviors and the new topic handling.
Fleet MQTT topic and bridge integration:
telemetrytopic to the Fleet MQTT topic templates andTokenResponseTopicsstruct, ensuring telemetry data can be routed separately from ingest data. [1] [2] [3]OTLP bridge configuration and encoding:
grpc://localhost:4317when the Fleet config manager is active, overriding any existing configuration, and falls back to creating missing config sections as needed.protobuftojsonfor improved compatibility.Testing improvements:
Miscellaneous:
requireimport for improved test assertions and introduced mock managers for policy and secrets to support new tests. [1] [2]Internal constants:
diodePolicyNameAttributeKeyin the OTLP bridge handlers for future policy metadata handling.