Resource: OnlineEvaluator
An OnlineEvaluator contains the configuration for an Online Evaluation.
namestring
Identifier. The resource name of the OnlineEvaluator. Format: projects/{project}/locations/{location}/onlineEvaluators/{id}.
agentResourcestring
Required. Immutable. The name of the agent that the OnlineEvaluator evaluates periodically. This value is used to filter the traces with a matching cloud.resource_id and link the evaluation results with relevant dashboards/UIs.
This field is immutable. Once set, it cannot be changed.
Required. A list of metric sources to be used for evaluating samples. At least one MetricSource must be provided. Right now, only predefined metrics and registered metrics are supported.
Every registered metric must have displayName (or title) and scoreRange defined. Otherwise, the evaluations will fail.
The maximum number of metricSources is 25.
Required. Configuration for the OnlineEvaluator.
Output only. The state of the OnlineEvaluator.
Output only. Contains additional information about the state of the OnlineEvaluator. This is used to provide more details in the event of a failure.
Output only. timestamp when the OnlineEvaluator was created.
Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".
Output only. timestamp when the OnlineEvaluator was last updated.
Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".
displayNamestring
Optional. Human-readable name for the OnlineEvaluator.
The name doesn't have to be unique.
The name can consist of any UTF-8 characters. The maximum length is 63 characters. If the display name exceeds max characters, an INVALID_ARGUMENT error is returned.
data_sourceUnion type
Required. The data source used to query samples for evaluations. More data sources will be supported in the future.
This field is immutable. Once set, it cannot be changed. data_source can be only one of the following:
data source for the OnlineEvaluator, based on GCP Observability stack (Cloud Trace & Cloud Logging).
| JSON representation |
|---|
{ "name": string, "agentResource": string, "metricSources": [ { object ( |
CloudObservability
data source for the OnlineEvaluator, based on GCP Observability stack (Cloud Trace & Cloud Logging).
logViewstring
Optional. Optional log view that will be used to query logs. If empty, the _Default view will be used.
traceViewstring
Optional. Optional trace view that will be used to query traces. If empty, the _Default view will be used.
NOTE: This field is not supported yet and will be ignored if set.
eval_scopeUnion type
eval_scope can be only one of the following:scope online evaluation to single traces.
conventionUnion type
convention can be only one of the following:data source follows OpenTelemetry convention.
| JSON representation |
|---|
{ "logView": string, "traceView": string, // eval_scope "traceScope": { object ( |
TraceScope
If chosen, the online evaluator will evaluate single traces matching specified filter.
Optional. A list of predicates to filter traces. Multiple predicates are combined using AND.
The maximum number of predicates is 10.
| JSON representation |
|---|
{
"filter": [
{
object ( |
Predicate
Defines a single filter predicate.
predicateUnion type
predicate can be only one of the following:Filter on the duration of a trace.
Filter on the total token usage within a trace.
| JSON representation |
|---|
{ // predicate "duration": { object ( |
NumericPredicate
Defines a predicate for filtering based on a numeric value.
Required. The comparison operator to apply.
valuenumber
Required. The value to compare against.
| JSON representation |
|---|
{
"comparisonOperator": enum ( |
ComparisonOperator
Comparison operators for numeric predicates.
| Enums | |
|---|---|
COMPARISON_OPERATOR_UNSPECIFIED |
Unspecified comparison operator. This value should not be used. |
LESS |
Less than. |
LESS_OR_EQUAL |
Less than or equal to. |
EQUAL |
Equal to. |
NOT_EQUAL |
Not equal to. |
GREATER_OR_EQUAL |
Greater than or equal to. |
GREATER |
Greater than. |
OpenTelemetry
Configuration for data source following OpenTelemetry.
semconvVersionstring
Required. Defines which version OTel Semantic Convention the data follows. Can be "1.39.0" or newer.
| JSON representation |
|---|
{ "semconvVersion": string } |
MetricSource
The metric source used for evaluation.
metric_sourceUnion type
metric_source can be only one of the following:Inline metric config.
metricResourceNamestring
Optional. Resource name for registered metric.
| JSON representation |
|---|
{
// metric_source
"metric": {
object ( |
Config
Configuration for sampling behavior of the OnlineEvaluator. The OnlineEvaluator runs at a fixed interval of 10 minutes.
Optional. The maximum number of evaluations to perform per run. If set to 0, the number is unbounded.
sampling_methodUnion type
sampling_method can be only one of the following:Random sampling method.
| JSON representation |
|---|
{
"maxEvaluatedSamplesPerRun": string,
// sampling_method
"randomSampling": {
object ( |
RandomSampling
Configuration for random sampling.
percentageinteger
Required. The percentage of traces to sample for evaluation. Must be an integer between 1 and 100.
| JSON representation |
|---|
{ "percentage": integer } |
State
The state of the OnlineEvaluator.
| Enums | |
|---|---|
STATE_UNSPECIFIED |
Default value. |
ACTIVE |
Indicates that the OnlineEvaluator is active. |
SUSPENDED |
Indicates that the OnlineEvaluator is suspended. In this state, the OnlineEvaluator will not evaluate any samples. |
FAILED |
Indicates that the OnlineEvaluator is in a failed state. This can happen if, for example, the |
WARNING |
Indicates that the OnlineEvaluator is in a warning state. This can happen if, for example, some of the metrics in the metricSources are invalid. Evaluation will still run with the remaining valid metrics. |
StateDetails
Contains additional information about the state of the OnlineEvaluator.
messagestring
Output only. Human-readable message describing the state of the OnlineEvaluator.
| JSON representation |
|---|
{ "message": string } |
Methods |
|
|---|---|
|
Activates an OnlineEvaluator. |
|
Creates an OnlineEvaluator in the given project and location. |
|
Deletes an OnlineEvaluator. |
|
Gets details of an OnlineEvaluator. |
|
Lists the OnlineEvaluators for the given project and location. |
|
Updates the fields of an OnlineEvaluator. |
|
Suspends an OnlineEvaluator. |