Class GetMetricsRequest.Builder
java.lang.Object
com.langfuse.client.resources.metrics.requests.GetMetricsRequest.Builder
- All Implemented Interfaces:
GetMetricsRequest._FinalStage,GetMetricsRequest.QueryStage
- Enclosing class:
GetMetricsRequest
public static final class GetMetricsRequest.Builder
extends Object
implements GetMetricsRequest.QueryStage, GetMetricsRequest._FinalStage
-
Method Summary
Modifier and TypeMethodDescriptionadditionalProperties(Map<String, Object> additionalProperties) additionalProperty(String key, Object value) build()from(GetMetricsRequest other) JSON string containing the query parameters with the following structure:
-
Method Details
-
from
- Specified by:
fromin interfaceGetMetricsRequest.QueryStage
-
query
JSON string containing the query parameters with the following structure:
{ "view": string, // Required. One of "traces", "observations", "scores-numeric", "scores-categorical" "dimensions": [ // Optional. Default: [] { "field": string // Field to group by, e.g. "name", "userId", "sessionId" } ], "metrics": [ // Required. At least one metric must be provided { "measure": string, // What to measure, e.g. "count", "latency", "value" "aggregation": string // How to aggregate, e.g. "count", "sum", "avg", "p95", "histogram" } ], "filters": [ // Optional. Default: [] { "column": string, // Column to filter on "operator": string, // Operator, e.g. "=", ">", "<", "contains" "value": any, // Value to compare against "type": string, // Data type, e.g. "string", "number", "stringObject" "key": string // Required only when filtering on metadata } ], "timeDimension": { // Optional. Default: null. If provided, results will be grouped by time "granularity": string // One of "minute", "hour", "day", "week", "month", "auto" }, "fromTimestamp": string, // Required. ISO datetime string for start of time range "toTimestamp": string, // Required. ISO datetime string for end of time range "orderBy": [ // Optional. Default: null { "field": string, // Field to order by "direction": string // "asc" or "desc" } ], "config": { // Optional. Query-specific configuration "bins": number, // Optional. Number of bins for histogram (1-100), default: 10 "row_limit": number // Optional. Row limit for results (1-1000) } }JSON string containing the query parameters with the following structure:
{ "view": string, // Required. One of "traces", "observations", "scores-numeric", "scores-categorical" "dimensions": [ // Optional. Default: [] { "field": string // Field to group by, e.g. "name", "userId", "sessionId" } ], "metrics": [ // Required. At least one metric must be provided { "measure": string, // What to measure, e.g. "count", "latency", "value" "aggregation": string // How to aggregate, e.g. "count", "sum", "avg", "p95", "histogram" } ], "filters": [ // Optional. Default: [] { "column": string, // Column to filter on "operator": string, // Operator, e.g. "=", ">", "<", "contains" "value": any, // Value to compare against "type": string, // Data type, e.g. "string", "number", "stringObject" "key": string // Required only when filtering on metadata } ], "timeDimension": { // Optional. Default: null. If provided, results will be grouped by time "granularity": string // One of "minute", "hour", "day", "week", "month", "auto" }, "fromTimestamp": string, // Required. ISO datetime string for start of time range "toTimestamp": string, // Required. ISO datetime string for end of time range "orderBy": [ // Optional. Default: null { "field": string, // Field to order by "direction": string // "asc" or "desc" } ], "config": { // Optional. Query-specific configuration "bins": number, // Optional. Number of bins for histogram (1-100), default: 10 "row_limit": number // Optional. Row limit for results (1-1000) } }- Specified by:
queryin interfaceGetMetricsRequest.QueryStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
build
- Specified by:
buildin interfaceGetMetricsRequest._FinalStage
-
additionalProperty
- Specified by:
additionalPropertyin interfaceGetMetricsRequest._FinalStage
-
additionalProperties
- Specified by:
additionalPropertiesin interfaceGetMetricsRequest._FinalStage
-