207.3.1 PROMQL_RANGE Function

This function enables users to query data from Oracle AI Database Telemetry Streaming based on a time range.

The PROMQL_RANGE function returns a CLOB for range queries, which are queries that span over a time range.

Syntax

promql_range(
   promql_query      IN VARCHAR2,
   start_time_epoch  IN NUMBER,
   end_time_epoch    IN NUMBER,
   step_size_seconds IN NUMBER DEFAULT 10,
   fetch_sql         IN NUMBER DEFAULT 0) return clob;

Parameters

Table 207-2 PROMQL_RANGE Function Parameters

Parameter Description
promql_query

The PromQL query from the user

start_time_epoch

The start time of the time range in which the query is interested

end_time_epoch

The end time of the query

step_size_seconds

Resolution size of the query. The output data points are (usually) step_size apart (by time).

fetch_sql

Result desired by the client. (set it to 1 if you want SQL, 2 for JSON)