def get_tsdb_settings()

in utils/tsdb.py [0:0]


def get_tsdb_settings(mappings: {}, settings: {}):
    """
    Modify the settings, so they fit the TSDB enabled mode.
    Get all time series metrics using the mappings.
    :param mappings: mappings.
    :param settings: settings.
    :return: modified settings for the TSDB index.
    """
    # Some settings cause an error on the ES client. This function removes them.
    discard_unknown_settings(settings)
    # Add the time_series mode
    settings["index"] |= {"mode": "time_series"}

    # Get all time series fields
    get_time_series_fields(mappings)

    # Set a new window to avoid time series end / start time errors
    time_series = {
        "time_series": {
            "end_time": "2100-06-08T14:41:54.000Z",
            "start_time": "1900-06-08T09:54:18.000Z"
        }
    }
    settings["index"] |= time_series
    settings["index"] |= {"routing_path": time_series_fields["routing_path"]}

    return settings