VictoriaMetrics / victorialogs-datasource

Grafana datasource for VictoriaLogs
Apache License 2.0
82 stars 2 forks source link

Grafana not support multi-tenant for Victorialogs #85

Open nulldoot2k opened 1 week ago

nulldoot2k commented 1 week ago

Hi, Team! I am currently deploying Victorialogs based on single version with replicas=2

image

Previously my vmauth defined the noauth route via 2 tenant=1:1000 and tenant=1:1001

tenant=1:1000 image tenant=1:1000 2 image

Basically I see everything is healthy. But there is a problem as follows

As I see Victorialogs already supports multiple tenants with closed article: https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3792 But checking shows that on Grafana it is not possible to add that, because the outgoing route does not support that yet Look at the path: http://vmauth:8247/select/vmui with Tenant: "1:1000"

I think we need change path from /select/vmui/ to /select/1:1000/vmui/ Like that

image

Outside solution using vmauth for users - tenant Is there any solution for using auth in prefix_path ?

Thanks a lot!!!

dmitryk-dk commented 3 days ago

Hi @nulldoot2k ! The issue you mentioned in the description was implemented for the VictoriaMetrics. If you want to get logs via tenant you should use headers as described in the documentation

By default the (AccountID=0, ProjectID=0) tenant is queried. If you need querying other tenant, then specify it via AccountID and ProjectID http request headers. For example, the following query searches for log messages at (AccountID=12, ProjectID=34) tenant:

curl http://localhost:9428/select/logsql/query -H 'AccountID: 12' -H 'ProjectID: 34' -d 'query=error'

So my question is, do you need a selector where you can select the tenant from which you want to query data?