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

Refactor snapshots collector #789

Merged
merged 2 commits into from
Oct 12, 2023

Conversation

sysadmind
Copy link
Contributor

  • Move metric Desc to vars to aid in unused linter checks
  • Use new Collector interface
  • Add a util getURL func. Similar funcs are in most of the collectors. The only difference is typically what struct to unmarshal the JSON into. This func just returns []byte so that the caller can handle the unique data structure.

This does not adjust the labels on the metrics. I want that to be handled separately to make sure the refactor itself matches existing behavior.

- Move metric Desc to vars to aid in unused linter checks
- Use new Collector interface
- Add a util getURL func. Similar funcs are in most of the collectors. The only difference is typically what struct to unmarshal the JSON into. This func just returns []byte so that the caller can handle the unique data structure.

This does not adjust the labels on the metrics. I want that to be handled separately to make sure the refactor itself matches existing behavior.

Signed-off-by: Joe Adams <[email protected]>
@sysadmind sysadmind requested a review from SuperQ October 12, 2023 02:56
Signed-off-by: Joe Adams <[email protected]>
Copy link
Contributor

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

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

Nice

@sysadmind sysadmind merged commit 5c142bf into prometheus-community:master Oct 12, 2023
2 checks passed
@sysadmind sysadmind deleted the snapshot-refactor branch October 15, 2023 18:36
@sysadmind sysadmind added this to the Refactor Collectors milestone Oct 15, 2023
@sysadmind sysadmind self-assigned this Oct 15, 2023
jaimeyh pushed a commit to sysdiglabs/elasticsearch_exporter that referenced this pull request Jun 14, 2024
- Move metric Desc to vars to aid in unused linter checks
- Use new Collector interface
- Add a util getURL func. Similar funcs are in most of the collectors. The only difference is typically what struct to unmarshal the JSON into. This func just returns []byte so that the caller can handle the unique data structure.

This does not adjust the labels on the metrics. I want that to be handled separately to make sure the refactor itself matches existing behavior.

Signed-off-by: Joe Adams <[email protected]>
jaimeyh added a commit to sysdiglabs/elasticsearch_exporter that referenced this pull request Jun 14, 2024
jaimeyh added a commit to sysdiglabs/elasticsearch_exporter that referenced this pull request Jun 14, 2024
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