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

Maintain history of daily object counts #6601

Closed
jeremystretch opened this issue Jun 14, 2021 · 5 comments
Closed

Maintain history of daily object counts #6601

jeremystretch opened this issue Jun 14, 2021 · 5 comments
Labels
pending closure Requires immediate attention to avoid being closed for inactivity status: under review Further discussion is needed to determine this issue's scope and/or implementation type: feature Introduction of new functionality to the application

Comments

@jeremystretch
Copy link
Member

NetBox version

v2.11.6

Feature type

New functionality

Proposed functionality

Start recording the total count of each type of object in NetBox daily, and make these metrics available within the UI.

Use case

With #6590 implemented for the upcoming v3.0 release, we can easily record a daily count of all objects, to be displayed as a graph within the UI. For example, a graph showing the 90-day running history for sites, devices, prefixes, etc. on the main view could be very useful. We might also provide a more generalized view where users could select the object types in which they're interested and view a longer period.

Database changes

This will likely require a new model to store the daily counts. I imagine something simple, such as:

class ObjectsCount(models.Model):
    date = models.DateField(unique=True)
    counts = models.JSONField()

counts would be a JSON field mapping each model name (e.g. dcim.site) to an integer. Only one instance may be created per day. (An existing instance may be updated with new counts through the day if needed.)

External dependencies

No response

@jeremystretch jeremystretch added type: feature Introduction of new functionality to the application status: under review Further discussion is needed to determine this issue's scope and/or implementation labels Jun 14, 2021
@ziggekatten
Copy link

ziggekatten commented Jun 14, 2021

In my view, this is outside the scope for netbox.

We achive this today already using apache Superset, giving us a daily/weekly/monthly metric based on created date, wich is a brilliant open source solution for all kind of reporting/analytics

Focus on core features, like support for SDN would in my view be more important.

There are tons of reports/dashboards that one would like, but using an external tool to do so would be my suggestion

@tyler-8
Copy link
Contributor

tyler-8 commented Jun 16, 2021

I agree with @ziggekatten actually. This kind of functionality is useful for sure, but I'm not looking to my SoT to generate, track, and display historical metric reports. Today I'm using this great plugin https://github.com/networktocode/ntc-netbox-plugin-metrics-ext to get exactly this kind of data.

If anything, I think building that plugin's functionality in to NetBox would be a better direction and would use the existing tooling for exposing the metrics. The advantage to that route is its generating metrics in a common and open metrics format that can be consumed by any number of existing tools (prometheus itself, telegraf, etc) and stored outside of NetBox in a platform designed for precisely these kinds of metrics.

@jeremystretch
Copy link
Member Author

jeremystretch commented Jun 16, 2021

Maybe I wasn't clear in my intent. The goal here is to provide some lightweight historical metrics on basic object counts in NetBox e.g. to replace the sparse object counts on the main view. This is intended as a convenience rather than full-featured reporting. Certainly there are other ways of achieving that (including NetBox's built-in support for Prometheus metrics). However, IMO it's not acceptable to require users to install and configure an entirely separate tool simply to view some quick stats about their NetBox installation.

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.

@github-actions github-actions bot added the pending closure Requires immediate attention to avoid being closed for inactivity label Aug 21, 2021
@jeremystretch
Copy link
Member Author

Gonna bail on this idea as it doesn't seem popular, and likely isn't worth the effort.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pending closure Requires immediate attention to avoid being closed for inactivity status: under review Further discussion is needed to determine this issue's scope and/or implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

3 participants