Open rishabhkailey opened 10 months ago
proxied data sources are also using the same endpoint for the query. test setup look like the following
docker-compose service
socks5:
image: tlstun
entrypoint: ["/tlstun"]
volumes:
- ./certs:/certs
command: ["server", "-addr=:1080", "-ca=/certs/ca.pem", "-cert=/certs/server-cert.pem", "-key=/certs/server-key.pem"]
GF_SECURE_SOCKS_DATASOURCE_PROXY_ENABLED=true
GF_SECURE_SOCKS_DATASOURCE_PROXY_SERVER_NAME=socks5
GF_SECURE_SOCKS_DATASOURCE_PROXY_PROXY_ADDRESS=socks5:1080
GF_SECURE_SOCKS_DATASOURCE_PROXY_ROOT_CA_CERT=/certs/ca.pem
GF_SECURE_SOCKS_DATASOURCE_PROXY_CLIENT_KEY=/certs/client-key.pem
GF_SECURE_SOCKS_DATASOURCE_PROXY_CLIENT_CERT=/certs/client-cert.pem
name: prometheus-proxied
type: prometheus
access: proxy
orgId: 1
url: http://prometheus:9090
basicAuth: false
isDefault: false
version: 1
editable: true
uid: prometheus-proxied
jsonData:
enableSecureSocksProxy: true
secureSocksProxyUsername: $PROXY_USER
secureJsonData:
secureSocksProxyPassword: $PROXY_PASSWORD
setting incorrect socks proxy leads to an error that means grafana is using socks proxy. but still the query endpoint is same as normal data sources query request.
/api/ds/query?ds_type=prometheus&requestId=Q104
{
"queries": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus-proxied"
},
"editorMode": "code",
"expr": "irate(prometheus_http_request_duration_seconds_sum[1m]) / prometheus_http_request_duration_seconds_count",
"instant": false,
"legendFormat": "{{ handler }}",
"range": true,
"refId": "A",
"exemplar": false,
"requestId": "3A",
"utcOffsetSec": 19800,
"interval": "",
"datasourceId": 1,
"intervalMs": 20000,
"maxDataPoints": 1001
}
],
"from": "1705126273740",
"to": "1705147873740"
}
I'm not sure when Grafana uses data source proxy API.
this Grafana dashboard uses graphite and proxy data source API.
moving this issue out of POC & Essential Features milestone.
Description
Current Limitation: The project's caching mechanism handles queries to standard data sources via the
/api/ds/query
endpoint. However, it doesn't extend to proxied data sources, which utilize distinct URLs.Goal: Expand caching capabilities to encompass proxied data source queries, boosting performance and efficiency for these sources.