Skip to content

Conversation

@aphralG
Copy link
Contributor

@aphralG aphralG commented Nov 20, 2025

Proposed changes

  • Instead of sending a message on the bus to inform the plugins of changes to the agent config, added a Reconfigure function to the plugins. This allows the message bus before it processes a message to check if its a config update, if it is it validates and updates the new changes, then call reconfigure on each of the plugins and handles the data plane response.
  • Add ability to modify labels when a change is made to the labels the otel collector if one exists is also updated and restarted with the new changes

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING document
  • I have run make install-tools and have attached any dependency changes to this pull request
  • If applicable, I have added tests that prove my fix is effective or that my feature works
  • If applicable, I have checked that any relevant tests pass after adding my changes
  • If applicable, I have updated any relevant documentation (README.md)
  • If applicable, I have tested my cross-platform changes on Ubuntu 22, Redhat 8, SUSE 15 and FreeBSD 13

@aphralG aphralG self-assigned this Nov 20, 2025
@aphralG aphralG requested a review from a team as a code owner November 20, 2025 15:14
@github-actions github-actions bot added the chore Pull requests for routine tasks label Nov 20, 2025
@codecov
Copy link

codecov bot commented Nov 20, 2025

Codecov Report

❌ Patch coverage is 31.38298% with 129 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.22%. Comparing base (db87469) to head (e5e1ffa).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/bus/message_pipe.go 30.92% 66 Missing and 1 partial ⚠️
internal/collector/otel_collector_plugin.go 20.00% 20 Missing ⚠️
internal/config/mapper.go 0.00% 9 Missing ⚠️
internal/command/command_plugin.go 53.84% 6 Missing ⚠️
internal/command/command_service.go 0.00% 6 Missing ⚠️
internal/file/file_plugin.go 0.00% 6 Missing ⚠️
internal/resource/resource_plugin.go 0.00% 6 Missing ⚠️
internal/watcher/watcher_plugin.go 0.00% 6 Missing ⚠️
api/grpc/mpi/v1/helpers.go 86.66% 2 Missing ⚠️
internal/app.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1402      +/-   ##
==========================================
- Coverage   86.00%   85.22%   -0.78%     
==========================================
  Files         102      102              
  Lines       12825    12928     +103     
==========================================
- Hits        11030    11018      -12     
- Misses       1307     1424     +117     
+ Partials      488      486       -2     
Files with missing lines Coverage Δ
internal/config/config.go 87.37% <100.00%> (ø)
internal/app.go 40.74% <0.00%> (ø)
api/grpc/mpi/v1/helpers.go 92.00% <86.66%> (-8.00%) ⬇️
internal/command/command_plugin.go 73.79% <53.84%> (+0.78%) ⬆️
internal/command/command_service.go 79.26% <0.00%> (-2.77%) ⬇️
internal/file/file_plugin.go 75.08% <0.00%> (-1.57%) ⬇️
internal/resource/resource_plugin.go 73.18% <0.00%> (-2.54%) ⬇️
internal/watcher/watcher_plugin.go 72.91% <0.00%> (-2.36%) ⬇️
internal/config/mapper.go 56.70% <0.00%> (-13.96%) ⬇️
internal/collector/otel_collector_plugin.go 79.62% <20.00%> (-1.26%) ⬇️
... and 1 more

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update db87469...e5e1ffa. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Base automatically changed from remote-configuration-log to main November 27, 2025 15:10
input []*structpb.Struct
}{
{
name: "Test 1: Valid input with simple key-value pairs",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing cases for slices, and structs

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be a test for invalid values? Empty values, blank "" values and special characters.

For valid scenario, should we include "config-sync-group" key?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests for this function should be pretty generic, the exact strings we place in the tests shouldn't really matter

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is only to covert to a map validation will be done elsewhere

@Akshay2191 Akshay2191 self-requested a review December 2, 2025 13:53
case *structpb.Value_BoolValue:
convertedMap[key] = field.GetBoolValue()
default:
slog.Warn("unknown type for map conversion", "value", kind)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
slog.Warn("unknown type for map conversion", "value", kind)
slog.Warn("Unknown type for map conversion", "key", key, "value", kind)

oc.restartCollector(ctx)
}
} else {
oc.config = agentConfig
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add an info log here saying that new headers have being added and the collector is bing restarted

@aphralG aphralG merged commit bc5043f into main Dec 3, 2025
39 checks passed
@aphralG aphralG deleted the remote-configuration-labels branch December 3, 2025 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Pull requests for routine tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants