# [[Range vectors in LogQL]] ![[Range vectors in LogQL.svg]] [[Range vectors]] in [[Grafana Loki|Loki]] [[LogQL]] are numeric values derived from logs within a specified time interval that have a set of [[Labels]]. For example, in the sample LogQL query: ```logql rate({job="api"} |= "error" [5m]) ``` the `rate()` function is being applied to a range vector, which is everything inside the parentheses. The query as a whole will return an [[Instant vectors in LogQL|instant vector]] because of `rate()`. Here's an example of what might be returned by that query, as a matrix of two range vectors (one per stream): ```json { "status": "success", "data": { "resultType": "matrix", "result": [ { "metric": { "job": "api", "instance": "api-1:9090" }, "values": [ [1721230200, "0.033"], [1721230260, "0.050"], [1721230320, "0.067"], [1721230380, "0.050"], [1721230440, "0.040"] ] }, { "metric": { "job": "api", "instance": "api-2:9090" }, "values": [ [1721230200, "0.003"], [1721230260, "0.010"], [1721230320, "0.007"], [1721230380, "0.013"], [1721230440, "0.010"] ] } ] } } ``` The result above is the [[JSON]]-formatted response that Loki might return if the query were sent via the [[Loki API]]. %% # Excalidraw Data ## Text Elements ## Drawing ```json { "type": "excalidraw", "version": 2, "source": "https://github.com/zsviczian/obsidian-excalidraw-plugin/releases/tag/2.1.4", "elements": [ { "id": "4y8R7iOA", "type": "text", "x": 118.49495565891266, "y": -333.44393157958984, "width": 3.8599853515625, "height": 24, "angle": 0, "strokeColor": "#1e1e1e", "backgroundColor": "transparent", "fillStyle": "solid", "strokeWidth": 2, "strokeStyle": "solid", "roughness": 1, "opacity": 100, "groupIds": [], "frameId": null, "roundness": null, "seed": 967149026, "version": 2, "versionNonce": 939059582, "isDeleted": true, "boundElements": null, "updated": 1713723615080, "link": null, "locked": false, "text": "", "rawText": "", "fontSize": 20, "fontFamily": 4, "textAlign": "left", "verticalAlign": "top", "containerId": null, "originalText": "", "lineHeight": 1.2 } ], "appState": { "theme": "dark", "viewBackgroundColor": "#ffffff", "currentItemStrokeColor": "#1e1e1e", "currentItemBackgroundColor": "transparent", "currentItemFillStyle": "solid", "currentItemStrokeWidth": 2, "currentItemStrokeStyle": "solid", "currentItemRoughness": 1, "currentItemOpacity": 100, "currentItemFontFamily": 4, "currentItemFontSize": 20, "currentItemTextAlign": "left", "currentItemStartArrowhead": null, "currentItemEndArrowhead": "arrow", "scrollX": 583.2388916015625, "scrollY": 573.6323852539062, "zoom": { "value": 1 }, "currentItemRoundness": "round", "gridSize": null, "gridColor": { "Bold": "#C9C9C9FF", "Regular": "#EDEDEDFF" }, "currentStrokeOptions": null, "previousGridSize": null, "frameRendering": { "enabled": true, "clip": true, "name": true, "outline": true } }, "files": {} } ``` %%