206.3.1 INGEST_METRICS Function

This function enables users in a workspace to ingest data as a single metric sample into Oracle AI Database Telemetry Streaming.

The INGEST_METRICS function does a single sample ingest with metric_name, metric_tags (JSON as VARCHAR), metric_value, and metric_time (epoch secs).

Syntax

function ingest_metrics(
         metric_name        IN VARCHAR2, 
         metric_tags        IN VARCHAR2,
         metric_value       IN NUMBER,
         metric_time_epoch  IN NUMBER)
return clob;

Parameters

Table 206-2 INGEST_METRICS Function Parameters

Parameter Description
metric_name

metric_name should be a valid VARCHAR2 with length less than or equal to 512.

metric_name should follow semantics similar to the Prometheus metrics.

See Also:

Data Formats and Naming Conventions in Oracle AI Database Telemetry Streaming Developer's Guide for more information about metric_name.
metric_tags

The metric tags should be a valid VARCHAR2 with a length less than 4000. It is stored as JSON in the database with an IS JSON check constraint and the (STRICT) qualifier added to ensure valid JSON. Thus, respective formatting should be applied to tags input.

See Also:

JSON in Oracle Database in JSON Developer's Guide for more information about using JSON in Oracle Database.
metric_value

The point-in-time (PIT) value of the time series

metric_time_epoch

The time in seconds since epoch