Skip to content
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

[pull] master from netdata:master #378

Merged
merged 4 commits into from
Feb 21, 2025
Merged

Conversation

pull[bot]
Copy link

@pull pull bot commented Feb 21, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

Summary by Sourcery

This pull request introduces several enhancements and bug fixes. It adds the ability to iterate over IPs in a given range, enhances the MySQL collector to support innodb_os_log_written in MariaDB 10.8, and enables libunwind by default. It also includes associated tests and ensures health configuration defaults are loaded only once.

New Features:

  • Adds the ability to iterate over the IPs within an iprange.

Enhancements:

  • The collector for MySQL now supports the innodb_os_log_written status variable in MariaDB 10.8, which preserves the InnoDB OS log information.
  • The health configuration now loads defaults only once.

Build:

  • Enables libunwind by default.

Tests:

  • Adds tests for iterating over IPv4 and IPv6 ranges.

@pull pull bot added the ⤵️ pull label Feb 21, 2025
@pull pull bot merged commit d44562c into webfutureiorepo:master Feb 21, 2025
Copy link

sourcery-ai bot commented Feb 21, 2025

Reviewer's Guide by Sourcery

This pull request includes several enhancements and fixes. It adds an iterator for IP ranges, improves MariaDB compatibility by adapting to changes in InnoDB OS log variables, initializes health monitoring configuration defaults, enables libunwind by default, and corrects a conditional statement related to health monitoring.

Sequence diagram for IP Range Iteration

sequenceDiagram
    participant Client
    participant IPRange
    participant Iterator

    Client->>IPRange: Iterate()
    activate IPRange
    IPRange->>Iterator: Create Iterator
    deactivate IPRange
    loop For each IP in range
        Client->>Iterator: Get Next IP
        activate Iterator
        Iterator-->>Client: IP Address
        deactivate Iterator
    end
Loading

Sequence diagram for collecting MySQL metrics with InnoDB OS Log

sequenceDiagram
    participant Collector
    participant MySQL

    Collector->>MySQL: Collect metrics
    activate MySQL
    MySQL-->>Collector: innodb_os_log_written
    deactivate MySQL
    Collector->>Collector: hasInnodbOSLogIO(metrics)
    Collector->>Collector: addInnoDBOSLogIOChart()
    Collector->>Charts: Add chart
Loading

Updated class diagram for IPRange

classDiagram
    class Range {
        <<interface>>
        Family() Family
        Contains(ip net.IP) bool
        Size() *big.Int
        Iterate() iter.Seq[net.IP]
        String() string
        getStart() net.IP
        getEnd() net.IP
    }
    class v4Range {
        start net.IP
        end net.IP
        getStart() net.IP
        getEnd() net.IP
        Iterate() iter.Seq[net.IP]
    }
    class v6Range {
        start net.IP
        end net.IP
        getStart() net.IP
        getEnd() net.IP
        Iterate() iter.Seq[net.IP]
    }

    Range <|-- v4Range
    Range <|-- v6Range
Loading

Updated class diagram for RRDHost

classDiagram
    class RRDHost {
        rrd_history_entries
        health.enabled
    }

    note for RRDHost "rrd_history_entries is now aligned to pagesize\nhealth.enabled is now a boolean"
Loading

File-Level Changes

Change Details Files
Added Iterate method to the Range interface and implementations for v4Range and v6Range.
  • Added Iterate() method to the Range interface.
  • Added getStart() and getEnd() methods to the Range interface.
  • Implemented getStart() and getEnd() methods for v4Range and v6Range.
  • Implemented Iterate() method for v4Range and v6Range using the iterate function.
  • Added iterate function to generate a sequence of IPs within a range.
  • Added nextIP function to increment an IP address.
src/go/plugin/go.d/pkg/iprange/range_test.go
src/go/plugin/go.d/pkg/iprange/range.go
src/go/plugin/go.d/pkg/iprange/README.md
src/go/plugin/go.d/pkg/iprange/iterator.go
Enabled libunwind and added cmake option.
  • Enabled libunwind by default.
  • Added cmake option to control libunwind enabling.
  • Linked libnetdata with libunwind based on the system processor architecture.
packaging/build-package.sh
CMakeLists.txt
packaging/docker/Dockerfile
Added logic to handle different versions of MariaDB regarding InnoDB OS log variables.
  • Added hasInnodbOSLogIO function to check for the presence of innodb_os_log_written variable.
  • Added addInnoDBOSLogIOChart function to add the InnoDB OS Log IO chart.
  • Modified collect function to call addInnoDBOSLogIOChart when appropriate.
src/go/plugin/go.d/collector/mysql/collect.go
src/go/plugin/go.d/collector/mysql/charts.go
Initialized health monitoring configuration defaults.
  • Call health_load_config_defaults() during rrd_init() to initialize health monitoring configuration defaults.
src/database/rrd.c
src/health/health.c
src/health/health.h
Corrected a conditional statement to properly disable health monitoring.
  • Modified the conditional statement in rrdhost_create() to correctly determine if health monitoring should be enabled based on the memory mode.
src/database/rrdhost.c

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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

Successfully merging this pull request may close these issues.

4 participants