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

chore(deps): Bump github.com/gwos/tcg/sdk from v8.7.2 to v8.8.0 #15947

Merged
merged 8 commits into from
Oct 8, 2024

Conversation

ymkins
Copy link
Contributor

@ymkins ymkins commented Sep 27, 2024

Summary

[outputs.groundwork] update SDK

TCG SDK that provides client used for sending data to Groundwork Monitoring has updated.
Modern version got fixes and features. Internal logger was changed to slog for simplify integrations.

PR provides telegraf.Logger adapter for slog.Logger used in SDK. It allows to output SDK messages with Telegraf logger.

Also PR provides improvement to filter out non-UTF symbols in payloads.

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #15945

@telegraf-tiger telegraf-tiger bot added the chore label Sep 27, 2024
@ymkins
Copy link
Contributor Author

ymkins commented Sep 27, 2024

$ make lint plugins/outputs/groundwork/
golangci-lint run
plugins/outputs/groundwork/slog/slog.go:6:2  depguard  import 'log/slog' is not allowed from list 'main': Use injected telegraf.Logger instead
1 issues:
* depguard: 1
make: *** [Makefile:191: lint] Error 1

This package implements telegraf.Logger adapter for slog.Logger used in library. It's used to output library messages with Telegraf logger.

@ymkins ymkins force-pushed the feat/groundwork-output branch from 5058565 to f94db3c Compare September 27, 2024 19:35
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Thanks a lot for you work @ymkins! I think you should tailor the implementation of the adapter to the concrete use-case here. Furthermore, I'm not convinced that logging library-internal messages with their log-level is the right approach. I would log all library-internal messages as level Trace to allow used to silence them as usually those should not be interesting for anyone...

plugins/outputs/groundwork/groundwork_test.go Outdated Show resolved Hide resolved
plugins/outputs/groundwork/groundwork.go Outdated Show resolved Hide resolved
plugins/outputs/groundwork/groundwork.go Outdated Show resolved Hide resolved
plugins/outputs/groundwork/groundwork_test.go Outdated Show resolved Hide resolved
plugins/outputs/groundwork/slog/slog.go Outdated Show resolved Hide resolved
plugins/outputs/groundwork/slog/slog.go Outdated Show resolved Hide resolved
plugins/outputs/groundwork/slog/slog.go Outdated Show resolved Hide resolved
plugins/outputs/groundwork/slog/slog.go Outdated Show resolved Hide resolved
@srebhan srebhan self-assigned this Sep 30, 2024
Update the implementation of the adapter for address review comments
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Thanks for the update @ymkins! Some more comments, with the most sever being the request to not work-around logging in tests.

plugins/outputs/groundwork/groundwork_test.go Outdated Show resolved Hide resolved
plugins/outputs/groundwork/log_adapter.go Outdated Show resolved Hide resolved
plugins/outputs/groundwork/log_adapter.go Outdated Show resolved Hide resolved
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

@ymkins thanks for clarifying my questions, just two small requests and a suggestion to silence the linter warning...

plugins/outputs/groundwork/groundwork_test.go Outdated Show resolved Hide resolved
plugins/outputs/groundwork/log_adapter.go Outdated Show resolved Hide resolved
plugins/outputs/groundwork/log_adapter.go Outdated Show resolved Hide resolved
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

@ymkins the code looks good, but I really urge you to just Init() the plugin instead of manually injecting stuff as this will not test for any errors when setting up logging in Init()!

plugins/outputs/groundwork/groundwork_test.go Outdated Show resolved Hide resolved
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Awesome @ymkins! Thanks for all your effort and patience!

@telegraf-tiger
Copy link
Contributor

telegraf-tiger bot commented Oct 8, 2024

@srebhan srebhan added dependencies Pull requests that update a dependency file ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. labels Oct 8, 2024
@srebhan srebhan changed the title chore(deps): Update github.com/gwos/tcg/sdk from v8.7.2 to v8.8.0 chore(deps): Bump github.com/gwos/tcg/sdk from v8.7.2 to v8.8.0 Oct 8, 2024
@srebhan srebhan assigned DStrand1 and unassigned srebhan Oct 8, 2024
@DStrand1 DStrand1 merged commit ed6d8ae into influxdata:master Oct 8, 2024
28 of 29 checks passed
@github-actions github-actions bot added this to the v1.32.2 milestone Oct 8, 2024
@ymkins ymkins deleted the feat/groundwork-output branch October 10, 2024 14:25
asaharn pushed a commit to asaharn/telegraf that referenced this pull request Oct 16, 2024
srebhan pushed a commit that referenced this pull request Oct 28, 2024
Co-authored-by: Pavlo Sumkin <[email protected]>
Co-authored-by: VladislavSenkevich <[email protected]>
(cherry picked from commit ed6d8ae)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore dependencies Pull requests that update a dependency file ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[outputs.groundwork] update SDK
4 participants