Skip to main content
Doku can automatically send LLM usage data from Doku to Dynatrace using the Ingest Metrics API and Ingest Logs API Make the following curl request to Doku to add a connection for Dynatrace. See more on the Connections API
curl --request POST \
  --url https://<YOUR_DOKU_INGESTER_URL>/api/connections \
  --header 'Authorization: <DOKU_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '{
  "Platform": "dynatrace",
  "MetricsUrl": "<YOUR_DYNATRACE_METRICS_URL>",
  "LogsUrl": "<YOUR_DYNATRACE_LOGS_URL>",
  "ApiKey": "<YOUR_DYNATRACE_API_KEY>"
}'

Dynatrace Resources

{
"version": 13,
"variables": [],
"tiles": {
    "1": {
    "type": "data",
    "title": "",
    "query": "fetch logs\n| filter type == \"prompt\"\n| limit 20",
    "queryConfig": {
        "limit": 20,
        "additionalFilters": {
        "type": [
            {
            "criteria": "equals",
            "expression": "prompt"
            }
        ]
        },
        "version": "4.0.1",
        "datatype": "logs",
        "log.source": [
        {
            "criteria": "contains",
            "expression": ""
        }
        ],
        "content": [
        {
            "criteria": "contains",
            "expression": ""
        }
        ]
    },
    "subType": "dql-builder-logs",
    "visualization": "table",
    "visualizationSettings": {
        "thresholds": [],
        "chartSettings": {
        "gapPolicy": "connect",
        "circleChartSettings": {
            "groupingThresholdType": "relative",
            "groupingThresholdValue": 0,
            "valueType": "relative"
        },
        "categoryOverrides": {},
        "categoricalBarChartSettings": {}
        },
        "singleValue": {
        "showLabel": true,
        "label": "",
        "prefixIcon": "",
        "recordField": "timestamp",
        "autoscale": true,
        "alignment": "center",
        "colorThresholdTarget": "value"
        },
        "table": {
        "rowDensity": "default",
        "enableSparklines": false,
        "hiddenColumns": [
            [
            "event.type"
            ],
            [
            "loglevel"
            ],
            [
            "status"
            ],
            [
            "dt.auth.origin"
            ],
            [
            "custom.attribute"
            ],
            [
            "type"
            ],
            [
            "endpoint"
            ],
            [
            "environment"
            ],
            [
            "generation"
            ],
            [
            "job"
            ],
            [
            "platform"
            ],
            [
            "source"
            ],
            [
            "cost"
            ],
            [
            "application"
            ]
        ],
        "lineWrapIds": [
            [
            "timestamp"
            ],
            [
            "content"
            ],
            [
            "event.type"
            ],
            [
            "loglevel"
            ],
            [
            "status"
            ],
            [
            "application"
            ],
            [
            "cost"
            ],
            [
            "dt.auth.origin"
            ],
            [
            "endpoint"
            ],
            [
            "environment"
            ],
            [
            "generation"
            ],
            [
            "job"
            ],
            [
            "model"
            ],
            [
            "platform"
            ],
            [
            "source"
            ],
            [
            "type"
            ]
        ],
        "columnWidths": {
            "[\"timestamp\"]": 105,
            "[\"application\"]": 113,
            "[\"cost\"]": 75,
            "[\"content\"]": 383
        },
        "colorThresholdTarget": "background",
        "sortBy": {
            "columnId": "[\"timestamp\"]",
            "direction": "descending"
        }
        }
    }
    },
    "2": {
    "type": "data",
    "title": "",
    "query": "fetch logs\n| filter type != \"prompt\"\n| limit 20",
    "queryConfig": {
        "limit": 20,
        "additionalFilters": {
        "type": [
            {
            "criteria": "not-equals",
            "expression": "prompt"
            }
        ]
        },
        "version": "4.0.1",
        "datatype": "logs",
        "log.source": [
        {
            "criteria": "contains",
            "expression": ""
        }
        ],
        "content": [
        {
            "criteria": "contains",
            "expression": ""
        }
        ]
    },
    "subType": "dql-builder-logs",
    "visualization": "table",
    "visualizationSettings": {
        "thresholds": [],
        "chartSettings": {
        "gapPolicy": "connect",
        "circleChartSettings": {
            "groupingThresholdType": "relative",
            "groupingThresholdValue": 0,
            "valueType": "relative"
        },
        "categoryOverrides": {},
        "categoricalBarChartSettings": {}
        },
        "singleValue": {
        "showLabel": true,
        "label": "",
        "prefixIcon": "",
        "recordField": "timestamp",
        "autoscale": true,
        "alignment": "center",
        "colorThresholdTarget": "value"
        },
        "table": {
        "rowDensity": "default",
        "enableSparklines": false,
        "hiddenColumns": [
            [
            "event.type"
            ],
            [
            "loglevel"
            ],
            [
            "status"
            ],
            [
            "dt.auth.origin"
            ],
            [
            "custom.attribute"
            ],
            [
            "type"
            ],
            [
            "endpoint"
            ],
            [
            "environment"
            ],
            [
            "generation"
            ],
            [
            "job"
            ],
            [
            "platform"
            ],
            [
            "source"
            ],
            [
            "cost"
            ],
            [
            "application"
            ]
        ],
        "lineWrapIds": [
            [
            "timestamp"
            ],
            [
            "content"
            ],
            [
            "event.type"
            ],
            [
            "loglevel"
            ],
            [
            "status"
            ],
            [
            "application"
            ],
            [
            "cost"
            ],
            [
            "dt.auth.origin"
            ],
            [
            "endpoint"
            ],
            [
            "environment"
            ],
            [
            "generation"
            ],
            [
            "job"
            ],
            [
            "model"
            ],
            [
            "platform"
            ],
            [
            "source"
            ],
            [
            "type"
            ]
        ],
        "columnWidths": {
            "[\"timestamp\"]": 104,
            "[\"application\"]": 113,
            "[\"cost\"]": 75,
            "[\"content\"]": 413
        },
        "colorThresholdTarget": "background",
        "sortBy": {
            "columnId": "[\"timestamp\"]",
            "direction": "descending"
        }
        }
    }
    },
    "7": {
    "type": "data",
    "title": "",
    "query": "timeseries duration=avg(doku.llm.request.duration, rollup: count)\n| sort arrayAvg(duration) desc\n| limit 20\n| fieldsAdd duration.single_value=arraySum(duration)",
    "davis": {
        "enabled": false,
        "davisVisualization": {
        "isAvailable": true
        }
    },
    "visualization": "singleValue",
    "visualizationSettings": {
        "thresholds": [
        {
            "id": "0",
            "title": "",
            "field": "",
            "rules": [
            {
                "id": "0",
                "label": "",
                "comparator": "≥",
                "color": "#7dc540"
            },
            {
                "id": "1",
                "label": "",
                "comparator": "≥",
                "color": "#f5d30f"
            },
            {
                "id": "2",
                "label": "",
                "comparator": "≥",
                "color": "#dc172a"
            }
            ],
            "isEnabled": true
        }
        ],
        "chartSettings": {
        "gapPolicy": "connect",
        "circleChartSettings": {
            "groupingThresholdType": "relative",
            "groupingThresholdValue": 0,
            "valueType": "relative"
        },
        "categoryOverrides": {},
        "fieldMapping": {
            "timestamp": "timeframe",
            "leftAxisValues": [
            "duration"
            ],
            "leftAxisDimensions": [
            "duration.single_value"
            ],
            "fields": [],
            "values": []
        }
        },
        "singleValue": {
        "showLabel": true,
        "recordField": "duration.single_value",
        "autoscale": true,
        "sparklineSettings": {
            "showTicks": true,
            "variant": "area",
            "record": "duration",
            "visible": true,
            "isVisible": true,
            "color": {
            "Default": "var(--dt-colors-charts-categorical-color-01-default, #134fc9)"
            }
        },
        "trend": {
            "visible": true,
            "relative": true,
            "isVisible": false
        },
        "label": "Total Requests",
        "colorThresholdTarget": "value",
        "alignment": "center"
        },
        "table": {
        "rowDensity": "condensed",
        "enableSparklines": false,
        "hiddenColumns": [],
        "lineWrapIds": [],
        "columnWidths": {}
        }
    }
    },
    "14": {
    "type": "data",
    "title": "",
    "query": "timeseries duration=avg(doku.llm.request.duration)\n| fieldsAdd duration.single_value=arrayAvg(duration)",
    "davis": {
        "enabled": false,
        "davisVisualization": {
        "isAvailable": true
        }
    },
    "visualization": "singleValue",
    "visualizationSettings": {
        "thresholds": [
        {
            "id": "0",
            "title": "",
            "field": "",
            "rules": [
            {
                "id": "0",
                "label": "",
                "comparator": "≥",
                "color": "#7dc540"
            },
            {
                "id": "1",
                "label": "",
                "comparator": "≥",
                "color": "#f5d30f"
            },
            {
                "id": "2",
                "label": "",
                "comparator": "≥",
                "color": "#dc172a"
            }
            ],
            "isEnabled": true
        }
        ],
        "chartSettings": {
        "gapPolicy": "connect",
        "circleChartSettings": {
            "groupingThresholdType": "relative",
            "groupingThresholdValue": 0,
            "valueType": "relative"
        },
        "categoryOverrides": {},
        "fieldMapping": {
            "timestamp": "timeframe",
            "leftAxisValues": [
            "duration"
            ],
            "leftAxisDimensions": [
            "duration.single_value"
            ],
            "fields": [],
            "values": []
        },
        "categoricalBarChartSettings": {}
        },
        "singleValue": {
        "showLabel": true,
        "recordField": "duration.single_value",
        "autoscale": true,
        "sparklineSettings": {
            "showTicks": false,
            "variant": "area",
            "record": "duration",
            "visible": true
        },
        "trend": {
            "visible": true,
            "relative": true,
            "isVisible": false
        },
        "label": "Avg Request Duration"
        },
        "table": {
        "rowDensity": "condensed",
        "enableSparklines": false,
        "hiddenColumns": [],
        "lineWrapIds": [],
        "columnWidths": {}
        },
        "unitsOverrides": [
        {
            "identifier": "duration.single_value",
            "unitCategory": "time",
            "baseUnit": "second",
            "displayUnit": null,
            "decimals": 3,
            "suffix": "",
            "delimiter": false,
            "added": 1707910354866
        }
        ]
    }
    },
    "15": {
    "type": "data",
    "title": "",
    "query": "timeseries duration=avg(doku.llm.total.tokens)\n| fieldsAdd duration.single_value=arrayAvg(duration)",
    "davis": {
        "enabled": false,
        "davisVisualization": {
        "isAvailable": true
        }
    },
    "visualization": "singleValue",
    "visualizationSettings": {
        "thresholds": [
        {
            "id": "0",
            "title": "",
            "field": "",
            "rules": [
            {
                "id": "0",
                "label": "",
                "comparator": "≥",
                "color": "#7dc540"
            },
            {
                "id": "1",
                "label": "",
                "comparator": "≥",
                "color": "#f5d30f"
            },
            {
                "id": "2",
                "label": "",
                "comparator": "≥",
                "color": "#dc172a"
            }
            ],
            "isEnabled": true
        }
        ],
        "chartSettings": {
        "gapPolicy": "connect",
        "circleChartSettings": {
            "groupingThresholdType": "relative",
            "groupingThresholdValue": 0,
            "valueType": "relative"
        },
        "categoryOverrides": {},
        "fieldMapping": {
            "timestamp": "timeframe",
            "leftAxisValues": [
            "duration"
            ],
            "leftAxisDimensions": [
            "duration.single_value"
            ],
            "fields": [],
            "values": []
        },
        "categoricalBarChartSettings": {}
        },
        "singleValue": {
        "showLabel": true,
        "recordField": "duration.single_value",
        "autoscale": true,
        "sparklineSettings": {
            "showTicks": false,
            "variant": "area",
            "record": "duration",
            "visible": true
        },
        "trend": {
            "visible": true,
            "relative": true,
            "isVisible": false
        },
        "label": "Avg Tokens / Request"
        },
        "table": {
        "rowDensity": "condensed",
        "enableSparklines": false,
        "hiddenColumns": [],
        "lineWrapIds": [],
        "columnWidths": {}
        }
    }
    },
    "17": {
    "type": "data",
    "title": "",
    "query": "timeseries cost=sum(doku.llm.usage.cost)\n| sort arraySum(cost) desc\n| limit 20\n| fieldsAdd cost.single_value=arraySum(cost)",
    "davis": {
        "enabled": false,
        "davisVisualization": {
        "isAvailable": true
        }
    },
    "visualization": "singleValue",
    "visualizationSettings": {
        "thresholds": [
        {
            "id": "0",
            "title": "",
            "field": "",
            "rules": [
            {
                "id": "0",
                "label": "",
                "comparator": "≥",
                "color": "#7dc540",
                "value": 0
            },
            {
                "id": "1",
                "label": "",
                "comparator": "≥",
                "color": "#f5d30f",
                "value": 5
            },
            {
                "id": "2",
                "label": "",
                "comparator": "≥",
                "color": "#dc172a",
                "value": 10
            }
            ],
            "isEnabled": true
        }
        ],
        "chartSettings": {
        "gapPolicy": "connect",
        "circleChartSettings": {
            "groupingThresholdType": "relative",
            "groupingThresholdValue": 0,
            "valueType": "relative"
        },
        "categoryOverrides": {},
        "fieldMapping": {
            "timestamp": "timeframe",
            "leftAxisValues": [
            "cost"
            ],
            "leftAxisDimensions": [
            "cost.single_value"
            ],
            "fields": [],
            "values": []
        }
        },
        "singleValue": {
        "showLabel": true,
        "recordField": "cost.single_value",
        "autoscale": true,
        "sparklineSettings": {
            "showTicks": false,
            "variant": "area",
            "record": "cost",
            "visible": true,
            "isVisible": true
        },
        "trend": {
            "visible": true,
            "relative": true,
            "isVisible": false,
            "isRelative": true,
            "isInverseTrend": false
        },
        "colorThresholdTarget": "value",
        "alignment": "center",
        "label": "Total Cost"
        },
        "table": {
        "rowDensity": "condensed",
        "enableSparklines": false,
        "hiddenColumns": [],
        "lineWrapIds": [],
        "columnWidths": {}
        },
        "unitsOverrides": [
        {
            "identifier": "cost.single_value",
            "unitCategory": "currency",
            "baseUnit": "usd",
            "displayUnit": "usd",
            "decimals": 3,
            "suffix": "",
            "delimiter": true,
            "added": 1707910304797
        }
        ]
    }
    },
    "19": {
    "type": "data",
    "title": "",
    "query": "timeseries duration=avg(doku.llm.request.duration, rollup: count)\n| sort arrayAvg(duration) desc\n| limit 20",
    "davis": {
        "enabled": false,
        "davisVisualization": {
        "isAvailable": true
        }
    },
    "visualization": "areaChart",
    "visualizationSettings": {
        "thresholds": [
        {
            "id": "0",
            "title": "",
            "field": "",
            "rules": [
            {
                "id": "0",
                "label": "",
                "comparator": "≥",
                "color": "#7dc540",
                "value": 0
            },
            {
                "id": "1",
                "label": "",
                "comparator": "≥",
                "color": "#f5d30f",
                "value": 5
            },
            {
                "id": "2",
                "label": "",
                "comparator": "≥",
                "color": "#dc172a",
                "value": 10
            }
            ],
            "isEnabled": true
        }
        ],
        "chartSettings": {
        "legend": {
            "hidden": true
        },
        "leftYAxisSettings": {
            "min": "auto",
            "max": "data-max",
            "label": "Requests"
        },
        "categoricalBarChartSettings": {
            "layout": "horizontal"
        },
        "fieldMapping": {
            "timestamp": "timeframe",
            "leftAxisValues": [
            "duration"
            ],
            "leftAxisDimensions": [],
            "fields": [],
            "values": []
        },
        "seriesOverrides": []
        },
        "singleValue": {
        "showLabel": true,
        "label": "",
        "prefixIcon": "",
        "autoscale": true,
        "alignment": "center",
        "colorThresholdTarget": "value"
        },
        "table": {
        "rowDensity": "condensed",
        "enableSparklines": false,
        "hiddenColumns": [],
        "lineWrapIds": [],
        "columnWidths": {}
        },
        "unitsOverrides": []
    }
    },
    "21": {
    "type": "data",
    "title": "Usage Cost by Category",
    "query": "timeseries cost=avg(doku.llm.usage.cost), by: { generation, endpoint, environment, finish_reason, application, model, source, job, platform }\n| fieldsAdd cost=arrayAvg(cost)\n| summarize { cost=avg(cost) } , by: { generation, interval, timeframe }\n| sort cost desc\n| limit 20",
    "davis": {
        "enabled": false,
        "davisVisualization": {
        "isAvailable": true
        }
    },
    "visualization": "pieChart",
    "visualizationSettings": {
        "thresholds": [
        {
            "id": "0",
            "title": "",
            "field": "",
            "rules": [
            {
                "id": "0",
                "label": "",
                "comparator": "≥",
                "color": "#7dc540",
                "value": 0
            },
            {
                "id": "1",
                "label": "",
                "comparator": "≥",
                "color": "#f5d30f",
                "value": 5
            },
            {
                "id": "2",
                "label": "",
                "comparator": "≥",
                "color": "#dc172a",
                "value": 10
            }
            ],
            "isEnabled": true
        }
        ],
        "chartSettings": {
        "gapPolicy": "connect",
        "circleChartSettings": {
            "groupingThresholdType": "absolute",
            "groupingThresholdValue": 0,
            "valueType": "absolute",
            "hideLabels": true,
            "groupingName": null
        },
        "categoryOverrides": {},
        "categoricalBarChartSettings": {
            "categoryAxis": "generation",
            "categoryAxisLabel": "generation",
            "valueAxis": "cost",
            "valueAxisLabel": "cost"
        },
        "legend": {
            "position": "bottom",
            "hidden": false
        }
        },
        "singleValue": {
        "showLabel": true,
        "label": "",
        "prefixIcon": "",
        "recordField": "generation",
        "autoscale": true,
        "alignment": "center",
        "colorThresholdTarget": "value"
        },
        "table": {
        "rowDensity": "condensed",
        "enableSparklines": false,
        "hiddenColumns": [],
        "lineWrapIds": [],
        "columnWidths": {}
        },
        "unitsOverrides": [
        {
            "identifier": "cost",
            "unitCategory": "currency",
            "baseUnit": "usd",
            "displayUnit": "usd",
            "decimals": 4,
            "suffix": "",
            "delimiter": true,
            "added": 1707908592897
        }
        ]
    }
    },
    "22": {
    "type": "data",
    "title": "Usage Cost by Platform",
    "query": "timeseries cost=avg(doku.llm.usage.cost), by: { generation, endpoint, environment, finish_reason, application, model, source, job, platform }\n| fieldsAdd cost=arrayAvg(cost)\n| summarize { cost=avg(cost) } , by: { platform, interval, timeframe }\n| sort cost desc\n| limit 20",
    "davis": {
        "enabled": false,
        "davisVisualization": {
        "isAvailable": true
        }
    },
    "visualization": "pieChart",
    "visualizationSettings": {
        "thresholds": [
        {
            "id": "0",
            "title": "",
            "field": "",
            "rules": [
            {
                "id": "0",
                "label": "",
                "comparator": "≥",
                "color": "#7dc540",
                "value": 0
            },
            {
                "id": "1",
                "label": "",
                "comparator": "≥",
                "color": "#f5d30f",
                "value": 5
            },
            {
                "id": "2",
                "label": "",
                "comparator": "≥",
                "color": "#dc172a",
                "value": 10
            }
            ],
            "isEnabled": true
        }
        ],
        "chartSettings": {
        "gapPolicy": "connect",
        "circleChartSettings": {
            "groupingThresholdType": "absolute",
            "groupingThresholdValue": 0,
            "valueType": "relative",
            "hideLabels": false
        },
        "categoryOverrides": {},
        "categoricalBarChartSettings": {
            "categoryAxis": "platform",
            "categoryAxisLabel": "platform",
            "valueAxis": "cost",
            "valueAxisLabel": "cost"
        },
        "legend": {
            "position": "bottom",
            "hidden": false
        }
        },
        "singleValue": {
        "showLabel": true,
        "label": "",
        "prefixIcon": "",
        "recordField": "generation",
        "autoscale": true,
        "alignment": "center",
        "colorThresholdTarget": "value"
        },
        "table": {
        "rowDensity": "condensed",
        "enableSparklines": false,
        "hiddenColumns": [],
        "lineWrapIds": [],
        "columnWidths": {}
        },
        "unitsOverrides": [
        {
            "identifier": "interval",
            "unitCategory": "time",
            "baseUnit": "nanosecond",
            "displayUnit": "usd",
            "decimals": 4,
            "suffix": "",
            "delimiter": true,
            "added": 1707908592897
        }
        ]
    }
    },
    "23": {
    "type": "data",
    "title": "Usage Cost by Application",
    "query": "timeseries cost=avg(doku.llm.usage.cost), by: { generation, endpoint, environment, finish_reason, application, model, source, job, platform }\n| fieldsAdd cost=arrayAvg(cost)\n| summarize { cost=avg(cost) } , by: { application, interval, timeframe }\n| sort cost desc\n| limit 20",
    "davis": {
        "enabled": false,
        "davisVisualization": {
        "isAvailable": true
        }
    },
    "visualization": "pieChart",
    "visualizationSettings": {
        "thresholds": [
        {
            "id": "0",
            "title": "",
            "field": "",
            "rules": [
            {
                "id": "0",
                "label": "",
                "comparator": "≥",
                "color": "#7dc540",
                "value": 0
            },
            {
                "id": "1",
                "label": "",
                "comparator": "≥",
                "color": "#f5d30f",
                "value": 5
            },
            {
                "id": "2",
                "label": "",
                "comparator": "≥",
                "color": "#dc172a",
                "value": 10
            }
            ],
            "isEnabled": true
        }
        ],
        "chartSettings": {
        "gapPolicy": "connect",
        "circleChartSettings": {
            "groupingThresholdType": "absolute",
            "groupingThresholdValue": 0,
            "valueType": "relative",
            "hideLabels": false
        },
        "categoryOverrides": {},
        "categoricalBarChartSettings": {
            "categoryAxis": "application",
            "categoryAxisLabel": "application",
            "valueAxis": "cost",
            "valueAxisLabel": "cost"
        },
        "legend": {
            "position": "bottom",
            "hidden": false
        }
        },
        "singleValue": {
        "showLabel": true,
        "label": "",
        "prefixIcon": "",
        "recordField": "generation",
        "autoscale": true,
        "alignment": "center",
        "colorThresholdTarget": "value"
        },
        "table": {
        "rowDensity": "condensed",
        "enableSparklines": false,
        "hiddenColumns": [],
        "lineWrapIds": [],
        "columnWidths": {}
        },
        "unitsOverrides": [
        {
            "identifier": "cost",
            "unitCategory": "currency",
            "baseUnit": "usd",
            "displayUnit": "usd",
            "decimals": 4,
            "suffix": "",
            "delimiter": true,
            "added": 1707908592897
        }
        ]
    }
    },
    "24": {
    "type": "data",
    "title": "Usage Cost by Environment",
    "query": "timeseries cost=avg(doku.llm.usage.cost), by: { generation, endpoint, environment, finish_reason, application, model, source, job, platform }\n| fieldsAdd cost=arrayAvg(cost)\n| summarize { cost=avg(cost) } , by: { environment, interval, timeframe }\n| sort cost desc\n| limit 20",
    "davis": {
        "enabled": false,
        "davisVisualization": {
        "isAvailable": true
        }
    },
    "visualization": "pieChart",
    "visualizationSettings": {
        "thresholds": [
        {
            "id": "0",
            "title": "",
            "field": "",
            "rules": [
            {
                "id": "0",
                "label": "",
                "comparator": "≥",
                "color": "#7dc540",
                "value": 0
            },
            {
                "id": "1",
                "label": "",
                "comparator": "≥",
                "color": "#f5d30f",
                "value": 5
            },
            {
                "id": "2",
                "label": "",
                "comparator": "≥",
                "color": "#dc172a",
                "value": 10
            }
            ],
            "isEnabled": true
        }
        ],
        "chartSettings": {
        "gapPolicy": "connect",
        "circleChartSettings": {
            "groupingThresholdType": "absolute",
            "groupingThresholdValue": 0,
            "valueType": "relative",
            "hideLabels": false
        },
        "categoryOverrides": {},
        "categoricalBarChartSettings": {
            "categoryAxis": "environment",
            "categoryAxisLabel": "environment",
            "valueAxis": "cost",
            "valueAxisLabel": "cost"
        },
        "legend": {
            "position": "bottom",
            "hidden": false
        }
        },
        "singleValue": {
        "showLabel": true,
        "label": "",
        "prefixIcon": "",
        "recordField": "generation",
        "autoscale": true,
        "alignment": "center",
        "colorThresholdTarget": "value"
        },
        "table": {
        "rowDensity": "condensed",
        "enableSparklines": false,
        "hiddenColumns": [],
        "lineWrapIds": [],
        "columnWidths": {}
        },
        "unitsOverrides": [
        {
            "identifier": "cost",
            "unitCategory": "currency",
            "baseUnit": "usd",
            "displayUnit": "usd",
            "decimals": 4,
            "suffix": "",
            "delimiter": true,
            "added": 1707908592897
        }
        ]
    }
    },
    "25": {
    "type": "data",
    "title": "",
    "query": "timeseries completionTokens=avg(doku.llm.completion.tokens)\n| sort arrayAvg(completionTokens)\n| append [timeseries promptTokens=avg(doku.llm.prompt.tokens)\n  | sort arrayAvg(promptTokens)]",
    "davis": {
        "enabled": false,
        "davisVisualization": {
        "isAvailable": true
        }
    },
    "visualization": "areaChart",
    "visualizationSettings": {
        "thresholds": [
        {
            "id": "0",
            "title": "",
            "field": "",
            "rules": [
            {
                "id": "0",
                "label": "",
                "comparator": "≥",
                "color": "#7dc540",
                "value": 0
            },
            {
                "id": "1",
                "label": "",
                "comparator": "≥",
                "color": "#f5d30f",
                "value": 5
            },
            {
                "id": "2",
                "label": "",
                "comparator": "≥",
                "color": "#dc172a",
                "value": 10
            }
            ],
            "isEnabled": true
        }
        ],
        "chartSettings": {
        "legend": {
            "hidden": false,
            "position": "bottom"
        },
        "leftYAxisSettings": {
            "label": ""
        },
        "categoricalBarChartSettings": {
            "layout": "horizontal"
        },
        "fieldMapping": {
            "timestamp": "timeframe",
            "leftAxisValues": [
            "completionTokens",
            "promptTokens"
            ],
            "leftAxisDimensions": [],
            "fields": [],
            "values": []
        }
        },
        "singleValue": {
        "showLabel": true,
        "label": "",
        "prefixIcon": "",
        "recordField": "error",
        "autoscale": true,
        "alignment": "center",
        "colorThresholdTarget": "value"
        },
        "table": {
        "rowDensity": "condensed",
        "enableSparklines": false,
        "hiddenColumns": [],
        "lineWrapIds": [],
        "columnWidths": {}
        }
    }
    },
    "26": {
    "type": "data",
    "title": "",
    "query": "timeseries duration=avg(doku.llm.prompt.tokens)\n| fieldsAdd duration.single_value=arrayAvg(duration)",
    "davis": {
        "enabled": false,
        "davisVisualization": {
        "isAvailable": true
        }
    },
    "visualization": "singleValue",
    "visualizationSettings": {
        "thresholds": [
        {
            "id": "0",
            "title": "",
            "field": "",
            "rules": [
            {
                "id": "0",
                "label": "",
                "comparator": "≥",
                "color": "#7dc540"
            },
            {
                "id": "1",
                "label": "",
                "comparator": "≥",
                "color": "#f5d30f"
            },
            {
                "id": "2",
                "label": "",
                "comparator": "≥",
                "color": "#dc172a"
            }
            ],
            "isEnabled": true
        }
        ],
        "chartSettings": {
        "gapPolicy": "connect",
        "circleChartSettings": {
            "groupingThresholdType": "relative",
            "groupingThresholdValue": 0,
            "valueType": "relative"
        },
        "categoryOverrides": {},
        "fieldMapping": {
            "timestamp": "timeframe",
            "leftAxisValues": [
            "duration"
            ],
            "leftAxisDimensions": [
            "duration.single_value"
            ],
            "fields": [],
            "values": []
        },
        "categoricalBarChartSettings": {}
        },
        "singleValue": {
        "showLabel": true,
        "recordField": "duration.single_value",
        "autoscale": true,
        "sparklineSettings": {
            "showTicks": false,
            "variant": "area",
            "record": "duration",
            "visible": true
        },
        "trend": {
            "visible": true,
            "relative": true,
            "isVisible": false
        },
        "label": "Avg Prompt Tokens / Request"
        },
        "table": {
        "rowDensity": "condensed",
        "enableSparklines": false,
        "hiddenColumns": [],
        "lineWrapIds": [],
        "columnWidths": {}
        }
    }
    },
    "27": {
    "type": "data",
    "title": "",
    "query": "timeseries duration=avg(doku.llm.completion.tokens)\n| fieldsAdd duration.single_value=arrayAvg(duration)",
    "davis": {
        "enabled": false,
        "davisVisualization": {
        "isAvailable": true
        }
    },
    "visualization": "singleValue",
    "visualizationSettings": {
        "thresholds": [
        {
            "id": "0",
            "title": "",
            "field": "",
            "rules": [
            {
                "id": "0",
                "label": "",
                "comparator": "≥",
                "color": "#7dc540"
            },
            {
                "id": "1",
                "label": "",
                "comparator": "≥",
                "color": "#f5d30f"
            },
            {
                "id": "2",
                "label": "",
                "comparator": "≥",
                "color": "#dc172a"
            }
            ],
            "isEnabled": true
        }
        ],
        "chartSettings": {
        "gapPolicy": "connect",
        "circleChartSettings": {
            "groupingThresholdType": "relative",
            "groupingThresholdValue": 0,
            "valueType": "relative"
        },
        "categoryOverrides": {},
        "fieldMapping": {
            "timestamp": "timeframe",
            "leftAxisValues": [
            "duration"
            ],
            "leftAxisDimensions": [
            "duration.single_value"
            ],
            "fields": [],
            "values": []
        },
        "categoricalBarChartSettings": {}
        },
        "singleValue": {
        "showLabel": true,
        "recordField": "duration.single_value",
        "autoscale": true,
        "sparklineSettings": {
            "showTicks": false,
            "variant": "area",
            "record": "duration",
            "visible": true
        },
        "trend": {
            "visible": true,
            "relative": true,
            "isVisible": false
        },
        "label": "Avg Completion Tokens / Request"
        },
        "table": {
        "rowDensity": "condensed",
        "enableSparklines": false,
        "hiddenColumns": [],
        "lineWrapIds": [],
        "columnWidths": {}
        }
    }
    },
    "28": {
    "type": "data",
    "title": "Top Models by Cost",
    "query": "timeseries cost=sum(doku.llm.usage.cost), by: { generation, endpoint, environment, finish_reason, application, model, source, job, platform }\n| fieldsAdd cost=arrayAvg(cost)\n| summarize { cost=avg(cost) } , by: { model, interval, timeframe }\n| sort cost desc\n| limit 20",
    "davis": {
        "enabled": false,
        "davisVisualization": {
        "isAvailable": true
        }
    },
    "visualization": "categoricalBarChart",
    "visualizationSettings": {
        "thresholds": [
        {
            "id": "0",
            "title": "",
            "field": "",
            "rules": [
            {
                "id": "0",
                "label": "",
                "comparator": "≥",
                "color": "#7dc540",
                "value": 0
            },
            {
                "id": "1",
                "label": "",
                "comparator": "≥",
                "color": "#f5d30f",
                "value": 5
            },
            {
                "id": "2",
                "label": "",
                "comparator": "≥",
                "color": "#dc172a",
                "value": 10
            }
            ],
            "isEnabled": true
        }
        ],
        "chartSettings": {
        "gapPolicy": "connect",
        "circleChartSettings": {
            "groupingThresholdType": "absolute",
            "groupingThresholdValue": 0,
            "valueType": "relative",
            "hideLabels": false
        },
        "categoryOverrides": {},
        "categoricalBarChartSettings": {
            "categoryAxis": "model",
            "categoryAxisLabel": "model",
            "valueAxis": [
            "cost"
            ],
            "valueAxisLabel": "cost",
            "layout": "horizontal",
            "categoryAxisTickLayout": "horizontal",
            "colorPaletteMode": "multi-color"
        },
        "legend": {
            "hidden": true
        }
        },
        "singleValue": {
        "showLabel": true,
        "label": "",
        "prefixIcon": "",
        "recordField": "generation",
        "autoscale": true,
        "alignment": "center",
        "colorThresholdTarget": "value"
        },
        "table": {
        "rowDensity": "condensed",
        "enableSparklines": false,
        "hiddenColumns": [],
        "lineWrapIds": [],
        "columnWidths": {}
        },
        "unitsOverrides": [
        {
            "identifier": "cost",
            "unitCategory": "currency",
            "baseUnit": "usd",
            "displayUnit": null,
            "decimals": 3,
            "suffix": "",
            "delimiter": false,
            "added": 1707910273820
        }
        ]
    }
    },
    "29": {
    "type": "data",
    "title": "Usage Cost by Platform",
    "query": "timeseries cost=avg(doku.llm.usage.cost), by: { generation, endpoint, environment, finish_reason, application, model, source, job, platform }\n| fieldsAdd cost=arrayAvg(cost)\n| summarize { cost=avg(cost) } , by: { model, interval, timeframe }\n| sort cost desc\n| limit 20",
    "davis": {
        "enabled": false,
        "davisVisualization": {
        "isAvailable": true
        }
    },
    "visualization": "areaChart",
    "visualizationSettings": {
        "thresholds": [
        {
            "id": "0",
            "title": "",
            "field": "",
            "rules": [
            {
                "id": "0",
                "label": "",
                "comparator": "≥",
                "color": "#7dc540",
                "value": 0
            },
            {
                "id": "1",
                "label": "",
                "comparator": "≥",
                "color": "#f5d30f",
                "value": 5
            },
            {
                "id": "2",
                "label": "",
                "comparator": "≥",
                "color": "#dc172a",
                "value": 10
            }
            ],
            "isEnabled": true
        }
        ],
        "chartSettings": {
        "gapPolicy": "connect",
        "circleChartSettings": {
            "groupingThresholdType": "absolute",
            "groupingThresholdValue": 0,
            "valueType": "relative",
            "hideLabels": false
        },
        "categoryOverrides": {},
        "categoricalBarChartSettings": {
            "categoryAxis": "model",
            "categoryAxisLabel": "model",
            "valueAxis": "cost",
            "valueAxisLabel": "cost",
            "layout": "horizontal",
            "categoryAxisTickLayout": "horizontal"
        },
        "legend": {
            "hidden": true
        },
        "fieldMapping": {
            "leftAxisValues": [
            "cost"
            ],
            "rightAxisValues": [],
            "leftAxisDimensions": [
            "model"
            ]
        }
        },
        "singleValue": {
        "showLabel": true,
        "label": "",
        "prefixIcon": "",
        "recordField": "generation",
        "autoscale": true,
        "alignment": "center",
        "colorThresholdTarget": "value"
        },
        "table": {
        "rowDensity": "condensed",
        "enableSparklines": false,
        "hiddenColumns": [],
        "lineWrapIds": [],
        "columnWidths": {}
        },
        "unitsOverrides": [
        {
            "identifier": "cost",
            "unitCategory": "currency",
            "baseUnit": "usd",
            "displayUnit": null,
            "decimals": 3,
            "suffix": "",
            "delimiter": false,
            "added": 1707910273820
        }
        ]
    }
    }
},
"layouts": {
    "1": {
    "x": 0,
    "y": 24,
    "w": 12,
    "h": 8
    },
    "2": {
    "x": 12,
    "y": 24,
    "w": 12,
    "h": 8
    },
    "7": {
    "x": 0,
    "y": 0,
    "w": 6,
    "h": 3
    },
    "14": {
    "x": 6,
    "y": 0,
    "w": 6,
    "h": 3
    },
    "15": {
    "x": 12,
    "y": 0,
    "w": 6,
    "h": 3
    },
    "17": {
    "x": 18,
    "y": 0,
    "w": 6,
    "h": 3
    },
    "19": {
    "x": 0,
    "y": 3,
    "w": 24,
    "h": 5
    },
    "21": {
    "x": 0,
    "y": 8,
    "w": 6,
    "h": 5
    },
    "22": {
    "x": 6,
    "y": 8,
    "w": 6,
    "h": 5
    },
    "23": {
    "x": 18,
    "y": 8,
    "w": 6,
    "h": 5
    },
    "24": {
    "x": 12,
    "y": 8,
    "w": 6,
    "h": 5
    },
    "25": {
    "x": 7,
    "y": 13,
    "w": 17,
    "h": 6
    },
    "26": {
    "x": 0,
    "y": 13,
    "w": 7,
    "h": 3
    },
    "27": {
    "x": 0,
    "y": 16,
    "w": 7,
    "h": 3
    },
    "28": {
    "x": 0,
    "y": 19,
    "w": 11,
    "h": 5
    },
    "29": {
    "x": 11,
    "y": 19,
    "w": 13,
    "h": 5
    }
}
}

Integrations

Integrate your LLM Provider with Doku

API Reference

OpenAPI specification for API Endpoints in Doku