metering-operator
metering-operator copied to clipboard
Need to set import_Start_time for prometheusMetricsImporter
Hi.
Can I set a start time for PromehtuesMetircsImporter? Currently, if there is existing table in the hive, importing starts from the current time. In the old version(v0.12) , it seems that you started importing based on the last partitions.
For example, it is good to read past metrics by setting the start time for promehteusMetricImporter.
Thank you.
The code always uses the last timestamp in the table to determine where to start, not the importStartTime. That's only to allow other resources (like reports) to know what data exists in a ReportDataSource.
Today we don't support setting a relative import start time on a per-reportDataSource level, but do support configuring the default max backfill duration and also the import start time for all reportDataSources.
The option is meteringconfig.spec.reporting-operator.spec.config.prometheus.metricsImporter.config.maxImportBackfillDuration
to configure a duration from the current time to start importing at (defaults to 2h
) or meteringconfig.spec.reporting-operator.spec.config.prometheus.metricsImporter.config.importFrom
which is an RFC3339 timestamp indicating what time to start importing metrics from.
In both cases, these options are only used when no metrics exist in the reportDataSource.
I think it would be useful to be able to configure this on a ReportDataSource level too, but need to consider how to best design it.