- https://newrelic.com/docs/general/what-is-metric-explosion - logging every sql query is bad for new_relic, also there could be sensitive data leakage - i could not find a better identifier that would always be there or that wouldn't possibly throw an exception, so I resorted to bucketing them into "Dataset"
- first_source isn't always available - Models are dataset and have a #model and #first_source but a dataset isn't necessarily a model, so it will not always respond to those method calls.
- not all datasets respond to .model, datasets based on model classes do but if you make a raw SQL query the dataset object does not - check if the object responds to model before calling it, and if it does not then call first_source - also make it explicit calling self.model
This should disable_serialization if any issue is encountered in save_or_transmit_data
…res the cookie in 1 second
This was causing NewRelic::Control to be instantiated (in the depends_on block) before Rails had initialized. DependencyDetection.detect! is called in the Rails#init_config method anyway so no need to call it here.