Skip to content

Conversation

@tschaefer
Copy link
Owner

No description provided.

@tschaefer tschaefer force-pushed the feature/metrics-sources branch from 49686e7 to d70d158 Compare November 6, 2025 19:22
@tschaefer tschaefer requested a review from Copilot November 6, 2025 19:33
Copy link

Copilot AI left a 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 PR adds support for custom metrics targets to the agent registration system. Agents can now specify additional metrics scraping endpoints beyond the default node exporter.

Key changes:

  • Added MetricsTargets field to the Agent model and controller struct to support custom metrics scraping endpoints
  • Refactored RegisterAgent API to accept a single Agent struct parameter instead of multiple individual parameters
  • Updated the Alloy configuration template to generate Prometheus scrape configurations for custom metrics targets

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
internal/model/agent.go Added MetricsTargets field to the Agent struct with JSON serialization support
internal/handler/openapi.yaml Added metrics_targets array field to the API schema
internal/handler/agent_test.go Updated mock controller signature to accept Agent struct parameter
internal/handler/agent.go Refactored to use controller.Agent struct instead of inline payload struct
internal/controller/agent_test.go Updated all test cases to use new Agent struct parameter with MetricsTargets field
internal/controller/agent.go Added Agent struct, updated RegisterAgent signature, added metrics targets parsing and template generation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants