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

Enable census collection #12337

Closed
jeremystretch opened this issue Apr 24, 2023 · 7 comments
Closed

Enable census collection #12337

jeremystretch opened this issue Apr 24, 2023 · 7 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application

Comments

@jeremystretch
Copy link
Member

jeremystretch commented Apr 24, 2023

NetBox version

v3.4.8

Feature type

New functionality

Proposed functionality

On startup, log the following metrics to census.netbox.dev using an HTTP POST request. (This collector is operated and maintained by the NetBox maintainers team.)

  • NetBox version
  • Python version
  • Random unique ID

This anonymized data will be collected and aggregated for analysis purposes (described below). This is very similar in nature to how many other open source applications track their user base. Only one log message will be sent per NetBox worker instance.

Additionally, introduce a CENSUS_REPORTING_ENABLED configuration parameter, which defaults to True. Setting this to False will disable all census reporting.

Use case

Ever since its initial open source release, we've struggled to ascertain just how many NetBox deployments exist in the world. (The closest analog we have is GitHub stars, which is of very limited utility.) Having NetBox automatically report this anonymized data will allow us to:

  • Form a rough idea about how many NetBox deployments exist
  • Measure the average intervals between version upgrades
  • Determine how long an old release remains in use (eventually)
  • Gauge resistance to the adoption of newer Python releases

Database changes

None

External dependencies

None; it should be feasible to implement a lightweight logging function natively.

@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 Apr 24, 2023
@abhi1693
Copy link
Member

Would this not cause issues in containerized deployments where people are running multiple replicas? Or, what if an instance came online due to restarts or downtime.

There has to be a very deterministic way to generate the UUID to avoid duplicate data to be posted to the endpoint.

@jeremystretch
Copy link
Member Author

There has to be a very deterministic way to generate the UUID to avoid duplicate data to be posted to the endpoint.

The implication of using a UUID was an error on my part when drafting the implementation. I had been using UUIDs for testing, but in practice we can use the unique DEPLOYMENT_ID already generated by NetBox to support Sentry integration.

Ultimately though, it's not a problem if this changes over time, as we're primarily concerned with counting the number of total NetBox deployments at each version at any point in time, and identifying macro trends over long timelines.

@jeremystretch jeremystretch self-assigned this Apr 26, 2023
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed status: under review Further discussion is needed to determine this issue's scope and/or implementation labels Apr 26, 2023
@decoupca
Copy link
Contributor

In the spirit of transparency I think it would be appropriate to add CENSUS_REPORTING_ENABLED to configuration_example.py as well.

@davekempe
Copy link

Hey @jeremystretch what's the plan with the use of IP address data used in the request to census.netbox? I support this feature, just wondering what the plan is for transparency. I suppose you can get a breakdown of cloud vs on prem.

@davekempe
Copy link

Oh another thought I had, lots of our on prem deployments need a proxy to get out to the internet. So netbox would need to know how to use that proxy if you want this to work.

@decoupca
Copy link
Contributor

Oh another thought I had, lots of our on prem deployments need a proxy to get out to the internet. So netbox would need to know how to use that proxy if you want this to work.

the call uses HTTP_PROXIES from configuration.py

@jeremystretch
Copy link
Member Author

Hey @jeremystretch what's the plan with the use of IP address data used in the request to census.netbox?

No plan; we're just counting unique deployments (identified by deployment ID) per NetBox release. I plan to share some stats after a few months.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

4 participants