Class GetMetricsV2Request.Builder
java.lang.Object
com.langfuse.client.resources.metricsv2.requests.GetMetricsV2Request.Builder
- All Implemented Interfaces:
GetMetricsV2Request._FinalStage,GetMetricsV2Request.QueryStage
- Enclosing class:
GetMetricsV2Request
public static final class GetMetricsV2Request.Builder
extends Object
implements GetMetricsV2Request.QueryStage, GetMetricsV2Request._FinalStage
-
Method Summary
Modifier and TypeMethodDescriptionadditionalProperties(Map<String, Object> additionalProperties) additionalProperty(String key, Object value) build()from(GetMetricsV2Request other) JSON string containing the query parameters with the following structure:
-
Method Details
-
from
- Specified by:
fromin interfaceGetMetricsV2Request.QueryStage
-
query
JSON string containing the query parameters with the following structure:
{ "view": string, // Required. One of "observations", "scores-numeric", "scores-categorical" "dimensions": [ // Optional. Default: [] { "field": string // Field to group by (see available dimensions above) } ], "metrics": [ // Required. At least one metric must be provided { "measure": string, // What to measure (see available measures above) "aggregation": string // How to aggregate: "sum", "avg", "count", "max", "min", "p50", "p75", "p90", "p95", "p99", "histogram" } ], "filters": [ // Optional. Default: [] { "column": string, // Column to filter on (any dimension field) "operator": string, // Operator based on type: // - datetime: ">", "<", ">=", "<=" // - string: "=", "contains", "does not contain", "starts with", "ends with" // - stringOptions: "any of", "none of" // - arrayOptions: "any of", "none of", "all of" // - number: "=", ">", "<", ">=", "<=" // - stringObject/numberObject: same as string/number with required "key" // - boolean: "=", "<>" // - null: "is null", "is not null" "value": any, // Value to compare against "type": string, // Data type: "datetime", "string", "number", "stringOptions", "categoryOptions", "arrayOptions", "stringObject", "numberObject", "boolean", "null" "key": string // Required only for stringObject/numberObject types (e.g., metadata filtering) } ], "timeDimension": { // Optional. Default: null. If provided, results will be grouped by time "granularity": string // One of "auto", "minute", "hour", "day", "week", "month" }, "fromTimestamp": string, // Required. ISO datetime string for start of time range "toTimestamp": string, // Required. ISO datetime string for end of time range (must be after fromTimestamp) "orderBy": [ // Optional. Default: null { "field": string, // Field to order by (dimension or metric alias) "direction": string // "asc" or "desc" } ], "config": { // Optional. Query-specific configuration "bins": number, // Optional. Number of bins for histogram aggregation (1-100), default: 10 "row_limit": number // Optional. Maximum number of rows to return (1-1000), default: 100 } }JSON string containing the query parameters with the following structure:
{ "view": string, // Required. One of "observations", "scores-numeric", "scores-categorical" "dimensions": [ // Optional. Default: [] { "field": string // Field to group by (see available dimensions above) } ], "metrics": [ // Required. At least one metric must be provided { "measure": string, // What to measure (see available measures above) "aggregation": string // How to aggregate: "sum", "avg", "count", "max", "min", "p50", "p75", "p90", "p95", "p99", "histogram" } ], "filters": [ // Optional. Default: [] { "column": string, // Column to filter on (any dimension field) "operator": string, // Operator based on type: // - datetime: ">", "<", ">=", "<=" // - string: "=", "contains", "does not contain", "starts with", "ends with" // - stringOptions: "any of", "none of" // - arrayOptions: "any of", "none of", "all of" // - number: "=", ">", "<", ">=", "<=" // - stringObject/numberObject: same as string/number with required "key" // - boolean: "=", "<>" // - null: "is null", "is not null" "value": any, // Value to compare against "type": string, // Data type: "datetime", "string", "number", "stringOptions", "categoryOptions", "arrayOptions", "stringObject", "numberObject", "boolean", "null" "key": string // Required only for stringObject/numberObject types (e.g., metadata filtering) } ], "timeDimension": { // Optional. Default: null. If provided, results will be grouped by time "granularity": string // One of "auto", "minute", "hour", "day", "week", "month" }, "fromTimestamp": string, // Required. ISO datetime string for start of time range "toTimestamp": string, // Required. ISO datetime string for end of time range (must be after fromTimestamp) "orderBy": [ // Optional. Default: null { "field": string, // Field to order by (dimension or metric alias) "direction": string // "asc" or "desc" } ], "config": { // Optional. Query-specific configuration "bins": number, // Optional. Number of bins for histogram aggregation (1-100), default: 10 "row_limit": number // Optional. Maximum number of rows to return (1-1000), default: 100 } }- Specified by:
queryin interfaceGetMetricsV2Request.QueryStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
build
- Specified by:
buildin interfaceGetMetricsV2Request._FinalStage
-
additionalProperty
- Specified by:
additionalPropertyin interfaceGetMetricsV2Request._FinalStage
-
additionalProperties
- Specified by:
additionalPropertiesin interfaceGetMetricsV2Request._FinalStage
-