Database with multiple retention policies ...without using retention policies

I have an InfluxDB database that is ingesting metrics from Telegraf.

These metrics come from both production and non-production systems, and vary from system metrics to application metrics. The data has different retention requirements, and we’ve avoided setting a policy up.

The problem I run into is moving staging systems to point to a non-default retention policy would require our Grafana dashboards to switch between specifying a retention policy and not when querying to display data, depending on whether the system is a staging system or production.

To start, I want to delete all staging data older than approximately 6 months. I’m thinking of setting this up as a cron job and calling it a day.

USE metrics;
DELETE WHERE "service_class" =~ /^[staging|testing]/ AND time > now() - 26w;

Is this a bad idea? The limitation of non-default retention policies that you have to specify the policy name in SELECT queries makes it undesirable to us.

I posted this right before a holiday weekend. Polite bump.

I haven’t had much exposure to graphana or 1.x Chronograf, but in 2.x there is a concept of dashboard variable names - your scenario sounds like it would be useful to be able to clone a prod dashboard template to staging, modify 1 variable and then test away…

From there, you could separate entirely the different needs for data collection and retention under the default rp