Query
Run instant LogQL query in Loki
Query
Run instant LogQL query in Loki
yaml
type: io.kestra.plugin.grafana.loki.QueryExamples
yaml
id: query_loki_instant
namespace: company.team
tasks:
- id: fetch_error_rate
type: io.kestra.plugin.grafana.loki.Query
url: http://localhost:3100
query: 'sum(rate({job="api"} |= "error" [5m]))'
limit: 100
yaml
id: query_historical_metrics
type: io.kestra.plugin.grafana.loki.Query
url: https://loki.example.com
token: "{{ secret('LOKI_TOKEN') }}"
tenantId: team-a
query: 'sum(rate({namespace="production"}[10m])) by (level)'
time: "2024-01-01T12:00:00Z"
yaml
id: query_metrics
type: io.kestra.plugin.grafana.loki.Query
url: https://loki.example.com
token: "{{ secret('LOKI_TOKEN') }}"
query: 'count_over_time({environment="staging"}[1h])'
direction: FORWARD
Properties
query *Requiredstring
url *Requiredstring
authToken string
connectTimeout integerstring
Default
30direction string
Default
BACKWARDPossible Values
FORWARDBACKWARDlimit integerstring
Default
100readTimeout integerstring
Default
60tenantId string
time string
Outputs
logs array
SubTypeobject