Skip to content

improvement(go.d): add bearer_token_file to request cfg #20476

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

Merged
merged 5 commits into from
Jun 13, 2025

Conversation

ilyam8
Copy link
Member

@ilyam8 ilyam8 commented Jun 13, 2025

Summary

And read it during request creation.

Test Plan
Additional Information
For users: How does this change affect me?

@ilyam8 ilyam8 requested a review from Copilot June 13, 2025 10:13
@github-actions github-actions bot added area/collectors Everything related to data collection collectors/go.d area/go labels Jun 13, 2025
Copilot

This comment was marked as outdated.

@ilyam8 ilyam8 requested a review from Copilot June 13, 2025 11:06
Copy link
Contributor

@Copilot 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

The PR adds support for a bearer_token_file configuration option across multiple collectors’ test fixtures and improves HTTP request error handling in ClickHouse collectors.

  • Introduces bearer_token_file in YAML/JSON test configs for CockroachDB, ClickHouse, Ceph, Cassandra, Bind, Apache, and ActiveMQ.
  • Changes ClickHouse collector methods to handle errors from web.NewHTTPRequest and properly propagate errors from c.doHTTP.

Reviewed Changes

Copilot reviewed 128 out of 128 changed files in this pull request and generated 1 comment.

File Description
src/go/plugin/go.d/collector/*/testdata/config.yaml/.json Added bearer_token_file entry to each collector’s config tests.
src/go/plugin/go.d/collector/clickhouse/collect_system_*.go Updated web.NewHTTPRequest calls to check and return errors.
Comments suppressed due to low confidence (1)

src/go/plugin/go.d/collector/cockroachdb/testdata/config.yaml:11

  • There are no tests verifying that bearer_token_file is read and applied to outgoing requests. Consider adding unit tests in the web.NewHTTPRequest suite to confirm the file is loaded and the Authorization header is correctly set.
bearer_token_file: "ok"

@ilyam8 ilyam8 merged commit 1d5385d into netdata:master Jun 13, 2025
105 of 106 checks passed
@ilyam8 ilyam8 deleted the go.d-web-bearer-token-file branch June 13, 2025 11:32
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