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

Add support for scraping tags in radarr #174

Merged
merged 6 commits into from
May 28, 2023
Merged

Add support for scraping tags in radarr #174

merged 6 commits into from
May 28, 2023

Conversation

aneurinprice
Copy link
Contributor

@aneurinprice aneurinprice commented May 27, 2023

This change adds a new metric, the number of movies in a tag
No known limitations

Proof of functionality:

radarr_movie_tag_total{tag="backed_up",url="http://<server>:7878"} 437

Description of the change

Add a new metric which scrapes radarr tags and the movies inside them

Benefits

Additional metrics are always nice?

Possible drawbacks

Any drawbacks that come from adding a new metric.

Aneurin Price added 2 commits May 27, 2023 23:39
@aneurinprice aneurinprice requested a review from onedr0p as a code owner May 27, 2023 22:50
@aneurinprice aneurinprice marked this pull request as draft May 27, 2023 22:51
@aneurinprice aneurinprice marked this pull request as ready for review May 28, 2023 00:10
Copy link
Collaborator

@rtrox rtrox left a comment

Choose a reason for hiding this comment

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

A few nits on to keep naming/labeling consistent, but the core logic lgtm! Glad to approve and merge once resolved.

Thanks for the PR!

@@ -72,6 +73,12 @@ func NewRadarrCollector(c *config.ArrConfig) *radarrCollector {
[]string{"quality"},
prometheus.Labels{"url": c.URL},
),
movieTags: prometheus.NewDesc(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we match the naming convention of the other metrics?

Something like movieTagsMetric?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

@@ -16,3 +16,9 @@ type Movie []struct {
} `json:"movieFile"`
QualityProfileID int `json:"qualityProfileId"`
}

type TagObjects []struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is specific to radarr, let's call this TagMovies

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

@@ -72,6 +73,12 @@ func NewRadarrCollector(c *config.ArrConfig) *radarrCollector {
[]string{"quality"},
prometheus.Labels{"url": c.URL},
),
movieTags: prometheus.NewDesc(
"radarr_movie_tag_total",
"Tags by total",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here, can we match the other metrics?

"Total number of downloaded movies by tag"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

Copy link
Owner

@onedr0p onedr0p left a comment

Choose a reason for hiding this comment

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

Looks good from here, @rtrox I'll wait for your sign off too.

Copy link
Collaborator

@rtrox rtrox left a comment

Choose a reason for hiding this comment

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

Lgtm too! Thanks for the quick follow-up.

@onedr0p onedr0p merged commit 69e16b5 into onedr0p:master May 28, 2023
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.

None yet

3 participants