Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ilyam8
Copy link
Member

@ilyam8 ilyam8 commented Nov 6, 2025

This PR introduces a new, simplified configuration format for the service discovery pipeline — the services block — which unifies the existing classify and compose steps into a single, declarative phase.

Example:

services:
  - id: activemq
    match: '{{ and (eq .Port "8161") (eq .Comm "activemq") }}'
    config_template: |
      module: activemq
      name: local
      url: http://{{.Address}}
      webadmin: admin

This replaces:

classify:
  - name: "Applications"
    selector: "unknown"
    tags: "-unknown app"
    match:
      - tags: "activemq"
        expr: '{{ and (eq .Port "8161") (eq .Comm "activemq") }}'

compose:
  - name: "Applications"
    selector: "app"
    config:
      - selector: "activemq"
        template: |
          module: activemq
          name: local
          url: http://{{.Address}}
          webadmin: admin
Summary
Test Plan
Additional Information
For users: How does this change affect me?

@ilyam8 ilyam8 requested a review from Copilot November 6, 2025 11:19
@github-actions github-actions bot added area/collectors Everything related to data collection collectors/go.d area/go labels Nov 6, 2025
Copy link
Contributor

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 introduces a new single-step "services" configuration format that simplifies service discovery by combining the legacy two-step "classify" and "compose" mechanisms into one. The services engine directly matches targets and generates configurations without an intermediate classification step.

Key changes:

  • Added ServiceRuleConfig and serviceEngine supporting direct target-to-config transformation
  • Refactored pipeline to conditionally use either services or legacy path based on configuration
  • Included conversion utility (ConvertOldToServices) to migrate from old format to new

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
config.go Adds ServiceRuleConfig struct, validation, and conversion function from legacy format
services.go New service engine implementation with template-based matching and config generation
services_test.go Unit tests for service engine covering match rules, config templates, and edge cases
pipeline.go Updated to support both services and legacy paths with conditional initialization
sim_test.go Test helper updated to support services-only mode with flag and path branching
pipeline_test.go Integration tests for services mode and conversion function
compose.go Extracted parseConfigTemplateData to be shared between composer and service engine

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

@ilyam8 ilyam8 requested a review from Copilot November 6, 2025 12:06
Copy link
Contributor

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

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.


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

@ilyam8 ilyam8 marked this pull request as ready for review November 6, 2025 12:12
@ilyam8 ilyam8 merged commit 9e72950 into netdata:master Nov 6, 2025
120 of 121 checks passed
@ilyam8 ilyam8 deleted the go.d-pipeline-services branch November 6, 2025 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/collectors Everything related to data collection area/go collectors/go.d

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants