def METHOD_NAME(self, query, user):
    """
    Query Syntax, actually it is the URL query string.
    Check the Prometheus HTTP API for the details of the supported query string.
    https://prometheus.io/docs/prometheus/latest/querying/api/
    example: instant query
        query=http_requests_total
    example: range query
        query=http_requests_total&start=2018-01-20T00:00:00.000Z&end=2018-01-25T00:00:00.000Z&step=60s
    example: until now range query
        query=http_requests_total&start=2018-01-20T00:00:00.000Z&step=60s
        query=http_requests_total&start=2018-01-20T00:00:00.000Z&end=now&step=60s
    """
    base_url = self.configuration["url"]
    columns = [
        {"friendly_name": "timestamp", "type": TYPE_DATETIME, "name": "timestamp"},
        {"friendly_name": "value", "type": TYPE_STRING, "name": "value"},
    ]
    try:
        error = None
        query = query.strip()
        # for backward compatibility
        query = "query={}".format(query) if not query.startswith("query=") else query
        payload = parse_qs(query)
        query_type = "query_range" if "step" in payload.keys() else "query"
        # for the range of until now
        if query_type == "query_range" and ("end" not in payload.keys() or "now" in payload["end"]):
            date_now = datetime.now()
            payload.update({"end": [date_now]})
        convert_query_range(payload)
        api_endpoint = base_url + "/api/v1/{}".format(query_type)
        response = requests.get(api_endpoint, params=payload)
        response.raise_for_status()
        metrics = response.json()["data"]["result"]
        if len(metrics) == 0:
            return None, "query result is empty."
        metric_labels = metrics[0]["metric"].keys()
        for label_name in metric_labels:
            columns.append(
                {
                    "friendly_name": label_name,
                    "type": TYPE_STRING,
                    "name": label_name,
                }
            )
        if query_type == "query_range":
            rows = get_range_rows(metrics)
        else:
            rows = get_instant_rows(metrics)
        json_data = json_dumps({"rows": rows, "columns": columns})
    except requests.RequestException as e:
        return None, str(e)
    return json_data, error