Closed sempex closed 4 months ago
I haven't had the time to properly implement Matrix support yet (right now we mostly use Stream). I would like to implement a Unified API, but it's challenging to satisfy TypeScript with the types.
const { logs } = await api.Loki.queryRangeMatrix(
`count_over_time({env="production", app="auth"} |= "request an authentication on"[5m])`,
{
limit: 400
}
);
console.log(logs);
Which should provide you with what you want (at least, I hope). Here is an example from my own Grafana setup:
I will soon release a new major version with queryRangeMatrix.
@fraxken Thank you so much for the new Version! We are currently building shiper a PaaS platform to deploy stuff and are using your library to display analytics. So if you ever feel the need to deploy something hit me up on discord and I will provide you with a free subscription. Thanks a lot again!
Hi everyone,
I want to display how many users per httpUserAgent visit a distinct URL based on Kubernetes ingress nginx logs. This would work with the following query:
Here is the query in Grafana:
When I execute the query above with the myunisoft/loki library I get the following response:
which indeed would be correct. But I found no way to get the field/label names that belong to those values, so I won't be able to display them properly. Is there a way to get those values?