diff --git a/CHANGELOG.md b/CHANGELOG.md index d039f8f14..cf1b2e623 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,27 @@ # Change Log +## 2.9.1 + +🚀 **Chore**: Upgrade grafana-plugin-sdk-go to `v0.240.0` from `v0.239.0` + +## 2.9.0 + +🚀 **UQL**: Updated uql library to [0.0.23](https://github.com/yesoreyeram/uql/blob/main/CHANGELOG.md#0023) + +🚀 **Chore** Replaced backend framer libraries from [yesoreyeram/grafana-plugins](https://github.com/yesoreyeram/grafana-plugins) to [grafana/infinity-libs](https://github.com/grafana/infinity-libs) + +⚙️ **Chore**: Add error source to error responses + +⚙️ **Chore**: Upgrade grafana-plugin-sdk-go to `v0.239.0` from `v0.231.0` + +🐛 **Bug fix**: Fix showing of correct URL when using query history + ## 2.8.0 ⚙️ **Chore**: backend datasource.serve method migrated to datasource.manage method 🐛 **Bug fix**: Fixed a bug where filters not working in variables editor - ## 2.7.1 🚀 **Time macros**: Added custom time macros `${__timeFrom}` and `${__timeTo}`. Read more about this [here](https://grafana.com/docs/plugins/yesoreyeram-infinity-datasource/latest/query/macros). diff --git a/cspell.config.json b/cspell.config.json index 74f99f076..fc6100d9b 100644 --- a/cspell.config.json +++ b/cspell.config.json @@ -51,6 +51,7 @@ "dropZone", "endregion", "endswith", + "errorsource", "Evaluable", "fontawesome", "fortawesome", @@ -66,6 +67,7 @@ "GROQ", "gserviceaccount", "gtime", + "healthcheck", "httpadapter", "httpbin", "httpclient", @@ -76,7 +78,6 @@ "jsonframer", "jsonpath", "jsonplaceholder", - "healthcheck", "kennethreitz", "Knetic", "kusto", diff --git a/go.mod b/go.mod index f805bbe17..f81951c2d 100644 --- a/go.mod +++ b/go.mod @@ -1,21 +1,21 @@ module github.com/grafana/grafana-infinity-datasource -go 1.22 +go 1.22.1 require ( github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.3.1 github.com/grafana/grafana-aws-sdk v0.24.0 - github.com/grafana/grafana-plugin-sdk-go v0.231.0 + github.com/grafana/grafana-plugin-sdk-go v0.240.0 + github.com/grafana/infinity-libs/lib/go/csvframer v1.0.0 + github.com/grafana/infinity-libs/lib/go/gframer v1.0.0 + github.com/grafana/infinity-libs/lib/go/jsonframer v1.1.0 + github.com/grafana/infinity-libs/lib/go/macros v1.0.0 + github.com/grafana/infinity-libs/lib/go/transformations v1.0.0 + github.com/grafana/infinity-libs/lib/go/xmlframer v1.0.0 github.com/icholy/digest v0.1.22 github.com/stretchr/testify v1.9.0 - github.com/yesoreyeram/grafana-plugins/lib/go/csvframer v0.0.2 - github.com/yesoreyeram/grafana-plugins/lib/go/gframer v0.1.0 - github.com/yesoreyeram/grafana-plugins/lib/go/jsonframer v0.0.5 - github.com/yesoreyeram/grafana-plugins/lib/go/macros v0.3.0 - github.com/yesoreyeram/grafana-plugins/lib/go/transformations v0.0.3 - github.com/yesoreyeram/grafana-plugins/lib/go/xmlframer v0.0.6 - go.opentelemetry.io/otel v1.26.0 - go.opentelemetry.io/otel/trace v1.26.0 + go.opentelemetry.io/otel v1.28.0 + go.opentelemetry.io/otel/trace v1.28.0 golang.org/x/oauth2 v0.20.0 moul.io/http2curl v1.0.0 ) @@ -35,17 +35,14 @@ require ( github.com/chromedp/cdproto v0.0.0-20240519224452-66462be74baa // indirect github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/dustin/go-humanize v1.0.1 // indirect github.com/elazarl/goproxy v0.0.0-20231117061959-7cc037d33fb5 // indirect github.com/fatih/color v1.17.0 // indirect github.com/getkin/kin-openapi v0.124.0 // indirect - github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect github.com/go-openapi/swag v0.23.0 // indirect - github.com/go-sql-driver/mysql v1.7.1 // indirect github.com/goccy/go-json v0.10.3 // indirect - github.com/goccy/go-yaml v1.11.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/flatbuffers v24.3.25+incompatible // indirect @@ -53,6 +50,10 @@ require ( github.com/google/uuid v1.6.0 // indirect github.com/gorilla/mux v1.8.1 // indirect github.com/grafana/dataplane/sdata v0.0.7 // indirect + github.com/grafana/infinity-libs/lib/go/framesql v1.0.0 // indirect + github.com/grafana/infinity-libs/lib/go/utils v1.0.0 // indirect + github.com/grafana/otel-profiling-go v0.5.1 // indirect + github.com/grafana/pyroscope-go/godeltaprof v0.1.7 // indirect github.com/grafana/sqlds/v3 v3.2.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 // indirect github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 // indirect @@ -60,26 +61,19 @@ require ( github.com/hashicorp/go-hclog v1.6.3 // indirect github.com/hashicorp/go-plugin v1.6.1 // indirect github.com/hashicorp/yamux v0.1.1 // indirect - github.com/iancoleman/orderedmap v0.3.0 // indirect github.com/invopop/yaml v0.3.1 // indirect - github.com/itchyny/gojq v0.12.13 // indirect - github.com/itchyny/timefmt-go v0.1.5 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/jwalton/gchalk v1.3.0 // indirect - github.com/jwalton/go-supportscolor v1.2.0 // indirect - github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect + github.com/jszwedko/go-datemath v0.1.1-0.20230526204004-640a500621d6 // indirect github.com/klauspost/compress v1.17.8 // indirect github.com/klauspost/cpuid/v2 v2.2.7 // indirect - github.com/lib/pq v1.10.9 // indirect github.com/magefile/mage v1.15.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattetti/filebuffer v1.0.1 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect - github.com/mattn/go-sqlite3 v1.14.18 // indirect github.com/mitchellh/go-homedir v1.0.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mithrandie/csvq v1.17.10 // indirect @@ -90,21 +84,15 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect - github.com/multiprocessio/go-sqlite3-stdlib v0.0.0-20220822170115-9f6825a1cd25 // indirect - github.com/noborus/guesswidth v0.3.4 // indirect - github.com/noborus/tbln v0.0.2 // indirect - github.com/noborus/trdsql v0.13.0 // indirect github.com/oklog/run v1.1.0 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/perimeterx/marshmallow v1.1.5 // indirect - github.com/pierrec/lz4 v2.6.1+incompatible // indirect github.com/pierrec/lz4/v4 v4.1.21 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.19.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.53.0 // indirect + github.com/prometheus/common v0.54.0 // indirect github.com/prometheus/procfs v0.15.0 // indirect - github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/shopspring/decimal v1.3.1 // indirect @@ -112,50 +100,36 @@ require ( github.com/tidwall/gjson v1.17.0 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.1 // indirect - github.com/ulikunitz/xz v0.5.11 // indirect github.com/unknwon/bra v0.0.0-20200517080246-1e3013ecaff8 // indirect github.com/unknwon/com v1.0.1 // indirect github.com/unknwon/log v0.0.0-20200308114134-929b1006e34a // indirect github.com/urfave/cli v1.22.15 // indirect github.com/xiatechs/jsonata-go v1.8.0 // indirect - github.com/yesoreyeram/grafana-plugins/lib/go/framesql v0.0.1 // indirect - github.com/yesoreyeram/grafana-plugins/lib/go/utils v0.0.1 // indirect github.com/zeebo/xxh3 v1.0.2 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.51.0 // indirect - go.opentelemetry.io/contrib/propagators/jaeger v1.26.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.53.0 // indirect + go.opentelemetry.io/contrib/propagators/jaeger v1.28.0 // indirect go.opentelemetry.io/contrib/samplers/jaegerremote v0.20.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.26.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.26.0 // indirect - go.opentelemetry.io/otel/metric v1.26.0 // indirect - go.opentelemetry.io/otel/sdk v1.26.0 // indirect - go.opentelemetry.io/proto/otlp v1.2.0 // indirect - golang.org/x/crypto v0.23.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 // indirect + go.opentelemetry.io/otel/metric v1.28.0 // indirect + go.opentelemetry.io/otel/sdk v1.28.0 // indirect + go.opentelemetry.io/proto/otlp v1.3.1 // indirect + golang.org/x/crypto v0.24.0 // indirect golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect golang.org/x/mod v0.17.0 // indirect - golang.org/x/net v0.25.0 // indirect + golang.org/x/net v0.26.0 // indirect golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/term v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect - golang.org/x/tools v0.21.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/term v0.21.0 // indirect + golang.org/x/text v0.16.0 // indirect + golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect - gonum.org/v1/gonum v0.14.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect - google.golang.org/grpc v1.64.0 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect + google.golang.org/grpc v1.64.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/Knetic/govaluate.v3 v3.0.0 // indirect gopkg.in/fsnotify/fsnotify.v1 v1.4.7 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - lukechampine.com/uint128 v1.3.0 // indirect - modernc.org/cc/v3 v3.41.0 // indirect - modernc.org/ccgo/v3 v3.16.15 // indirect - modernc.org/libc v1.34.11 // indirect - modernc.org/mathutil v1.6.0 // indirect - modernc.org/memory v1.7.2 // indirect - modernc.org/opt v0.1.3 // indirect - modernc.org/sqlite v1.27.0 // indirect - modernc.org/strutil v1.2.0 // indirect - modernc.org/token v1.1.0 // indirect ) diff --git a/go.sum b/go.sum index 563dfef1a..e89f97f5b 100644 --- a/go.sum +++ b/go.sum @@ -43,8 +43,6 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= -github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= -github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/elazarl/goproxy v0.0.0-20231117061959-7cc037d33fb5 h1:m62nsMU279qRD9PQSWD1l66kmkXzuYcnVJqL4XLeV2M= github.com/elazarl/goproxy v0.0.0-20231117061959-7cc037d33fb5/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8= @@ -55,36 +53,27 @@ github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/frankban/quicktest v1.7.2 h1:2QxQoC1TS09S7fhCPsrvqYdvP1H5M1P1ih5ABm3BTYk= -github.com/frankban/quicktest v1.7.2/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/getkin/kin-openapi v0.124.0 h1:VSFNMB9C9rTKBnQ/fpyDU8ytMTr4dWI9QovSKj9kz/M= github.com/getkin/kin-openapi v0.124.0/go.mod h1:wb1aSZA/iWmorQP9KTAS/phLj/t17B5jT7+fS8ed9NM= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= -github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= -github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= -github.com/goccy/go-yaml v1.11.2 h1:joq77SxuyIs9zzxEjgyLBugMQ9NEgTWxXfz2wVqwAaQ= -github.com/goccy/go-yaml v1.11.2/go.mod h1:wKnAMd44+9JAAnGQpWVEgBzGt3YuTaQ4uXoHvE4m7WU= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw= @@ -97,8 +86,6 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ= -github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -110,8 +97,30 @@ github.com/grafana/dataplane/sdata v0.0.7 h1:CImITypIyS1jxijCR6xqKx71JnYAxcwpH9C github.com/grafana/dataplane/sdata v0.0.7/go.mod h1:Jvs5ddpGmn6vcxT7tCTWAZ1mgi4sbcdFt9utQx5uMAU= github.com/grafana/grafana-aws-sdk v0.24.0 h1:0RKCJTeIkpEUvLCTjGOK1+jYZpaE2nJaGghGLvtUsFs= github.com/grafana/grafana-aws-sdk v0.24.0/go.mod h1:3zghFF6edrxn0d6k6X9HpGZXDH+VfA+MwD2Pc/9X0ec= -github.com/grafana/grafana-plugin-sdk-go v0.231.0 h1:Qt4PBDR8b4MTUxL48EaZw1fHI1rXUNNhvTU/Nf0Ex2g= -github.com/grafana/grafana-plugin-sdk-go v0.231.0/go.mod h1:8fJk+5J1hMkpqY/7vrXHKgAsqELWNkQvLQ5A5xCVZHk= +github.com/grafana/grafana-plugin-sdk-go v0.239.0 h1:q/AWw+3HlgoXRnXkZuHxxSP7ujyCRRl8YIfWDW3KOAg= +github.com/grafana/grafana-plugin-sdk-go v0.239.0/go.mod h1:GTw4Fgs9rFe0bR8zmqaTqnVEcQx+Rk5fJvWULyzigCM= +github.com/grafana/grafana-plugin-sdk-go v0.240.0 h1:jhv2TqfBWoi5ZTksg/fdY5Mi8FDsaE8XGxjS1Rgi6nk= +github.com/grafana/grafana-plugin-sdk-go v0.240.0/go.mod h1:GTw4Fgs9rFe0bR8zmqaTqnVEcQx+Rk5fJvWULyzigCM= +github.com/grafana/infinity-libs/lib/go/csvframer v1.0.0 h1:PGM6BkwU1You9zFShVTtNvQcnQDabJ4jg9TLhqAdC/k= +github.com/grafana/infinity-libs/lib/go/csvframer v1.0.0/go.mod h1:aIYewhI82TGS5x4JcvU9qLfmzEtpwoPI7k0fiZv1Wgk= +github.com/grafana/infinity-libs/lib/go/framesql v1.0.0 h1:NqmTfpAsp1dQnJy4fbRHZuJUfxqT4tsKNbq+O5LMgEQ= +github.com/grafana/infinity-libs/lib/go/framesql v1.0.0/go.mod h1:uoU0LlBoP5oWiZRtdn06JR2bsaoAF8UJKwlgk5+2ZVo= +github.com/grafana/infinity-libs/lib/go/gframer v1.0.0 h1:TYKumCoWlf9KlXa6M9pi3s6H9bjl0V5XF8f73aitNWE= +github.com/grafana/infinity-libs/lib/go/gframer v1.0.0/go.mod h1:tCjLSNFQnuYiNeBIAyb51jNV8ad0eI/M69P1rxm77Fc= +github.com/grafana/infinity-libs/lib/go/jsonframer v1.1.0 h1:BzeOl9g8UxliupkNj3b4MGJ8BJ51XzzxjMPP9JFxowg= +github.com/grafana/infinity-libs/lib/go/jsonframer v1.1.0/go.mod h1:nehKujVcucYDgXRciMdxn/RhBCOKXJShh/0ZwWgk2O8= +github.com/grafana/infinity-libs/lib/go/macros v1.0.0 h1:5IaWKGvY0zhli0MKfjKvS1Y+bzY758Yw8HELU4cqs6E= +github.com/grafana/infinity-libs/lib/go/macros v1.0.0/go.mod h1:6EE8D9bV9J9nC9gQSD1HirqCKHhWKaEaZYJsajM6PGk= +github.com/grafana/infinity-libs/lib/go/transformations v1.0.0 h1:1TAl+pGNcuNGLCneyXt95/rd96mz+GsVMimapyjZl/8= +github.com/grafana/infinity-libs/lib/go/transformations v1.0.0/go.mod h1:Z1kghCrSCOrY0kuRRt+8VxW4JopHJc1cDGLOkG8Ji94= +github.com/grafana/infinity-libs/lib/go/utils v1.0.0 h1:jXlKDSay/S2tdaWghc0E7DzKugMQhEUcKtlVPmb69oc= +github.com/grafana/infinity-libs/lib/go/utils v1.0.0/go.mod h1:86US+G1Ujk61fibdPSEHWl+atBjXGGeibuEOMfMU2v4= +github.com/grafana/infinity-libs/lib/go/xmlframer v1.0.0 h1:I8aMygkFiaBQUktugOIOjaigO0p/DgS94/ikr5G+WRw= +github.com/grafana/infinity-libs/lib/go/xmlframer v1.0.0/go.mod h1:BoGuchOLtzfGGC4WGjKaV1ObgtZSCYqs2cv4+77dVEE= +github.com/grafana/otel-profiling-go v0.5.1 h1:stVPKAFZSa7eGiqbYuG25VcqYksR6iWvF3YH66t4qL8= +github.com/grafana/otel-profiling-go v0.5.1/go.mod h1:ftN/t5A/4gQI19/8MoWurBEtC6gFw8Dns1sJZ9W4Tls= +github.com/grafana/pyroscope-go/godeltaprof v0.1.7 h1:C11j63y7gymiW8VugJ9ZW0pWfxTZugdSJyC48olk5KY= +github.com/grafana/pyroscope-go/godeltaprof v0.1.7/go.mod h1:Tk376Nbldo4Cha9RgiU7ik8WKFkNpfds98aUzS8omLE= github.com/grafana/sqlds/v3 v3.2.0 h1:WXuYEaFfiCvgm8kK2ixx44/zAEjFzCylA2+RF3GBqZA= github.com/grafana/sqlds/v3 v3.2.0/go.mod h1:kH0WuHUR3j0Q7IEymbm2JiaPckUhRCbqjV9ajaBAnmM= github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 h1:qnpSQwGEnkcRpTqNOIR6bJbR0gAorgP9CSALpRcKoAA= @@ -126,16 +135,10 @@ github.com/hashicorp/go-plugin v1.6.1 h1:P7MR2UP6gNKGPp+y7EZw2kOiq4IR9WiqLvp0XOs github.com/hashicorp/go-plugin v1.6.1/go.mod h1:XPHFku2tFo3o3QKFgSYo+cghcUhw1NA1hZyMK0PWAw0= github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= -github.com/iancoleman/orderedmap v0.3.0 h1:5cbR2grmZR/DiVt+VJopEhtVs9YGInGIxAoMJn+Ichc= -github.com/iancoleman/orderedmap v0.3.0/go.mod h1:XuLcCUkdL5owUCQeF2Ue9uuw1EptkJDkXXS7VoV7XGE= github.com/icholy/digest v0.1.22 h1:dRIwCjtAcXch57ei+F0HSb5hmprL873+q7PoVojdMzM= github.com/icholy/digest v0.1.22/go.mod h1:uLAeDdWKIWNFMH0wqbwchbTQOmJWhzSnL7zmqSPqEEc= github.com/invopop/yaml v0.3.1 h1:f0+ZpmhfBSS4MhG+4HYseMdJhoeeopbSKbq5Rpeelso= github.com/invopop/yaml v0.3.1/go.mod h1:PMOp3nn4/12yEZUFfmOuNHJsZToEEOwoWsT+D81KkeA= -github.com/itchyny/gojq v0.12.13 h1:IxyYlHYIlspQHHTE0f3cJF0NKDMfajxViuhBLnHd/QU= -github.com/itchyny/gojq v0.12.13/go.mod h1:JzwzAqenfhrPUuwbmEz3nu3JQmFLlQTQMUcOdnu/Sf4= -github.com/itchyny/timefmt-go v0.1.5 h1:G0INE2la8S6ru/ZI5JecgyzbbJNs5lG1RcBqa7Jm6GE= -github.com/itchyny/timefmt-go v0.1.5/go.mod h1:nEP7L+2YmAbT2kZ2HfSs1d8Xtw9LY8D2stDBckWakZ8= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= @@ -146,18 +149,14 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jszwedko/go-datemath v0.1.1-0.20230526204004-640a500621d6 h1:SwcnSwBR7X/5EHJQlXBockkJVIMRVt5yKaesBPMtyZQ= +github.com/jszwedko/go-datemath v0.1.1-0.20230526204004-640a500621d6/go.mod h1:WrYiIuiXUMIvTDAQw97C+9l0CnBmCcvosPjN3XDqS/o= github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/jwalton/gchalk v1.3.0 h1:uTfAaNexN8r0I9bioRTksuT8VGjrPs9YIXR1PQbtX/Q= -github.com/jwalton/gchalk v1.3.0/go.mod h1:ytRlj60R9f7r53IAElbpq4lVuPOPNg2J4tJcCxtFqr8= -github.com/jwalton/go-supportscolor v1.1.0/go.mod h1:hFVUAZV2cWg+WFFC4v8pT2X/S2qUUBYMioBD9AINXGs= -github.com/jwalton/go-supportscolor v1.2.0 h1:g6Ha4u7Vm3LIsQ5wmeBpS4gazu0UP1DRDE8y6bre4H8= -github.com/jwalton/go-supportscolor v1.2.0/go.mod h1:hFVUAZV2cWg+WFFC4v8pT2X/S2qUUBYMioBD9AINXGs= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= @@ -168,10 +167,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= -github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg= github.com/magefile/mage v1.15.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= @@ -191,8 +186,6 @@ github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/mattn/go-sqlite3 v1.14.18 h1:JL0eqdCOq6DJVNPSvArO/bIV9/P7fbGrV00LZHc+5aI= -github.com/mattn/go-sqlite3 v1.14.18/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/mitchellh/go-homedir v1.0.0 h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnGC8aR0= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= @@ -216,22 +209,12 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= -github.com/multiprocessio/go-sqlite3-stdlib v0.0.0-20220822170115-9f6825a1cd25 h1:bnhGk2UFFPqylhxTEffs1ehDRn4bEZsEoDH53Z4HqA8= -github.com/multiprocessio/go-sqlite3-stdlib v0.0.0-20220822170115-9f6825a1cd25/go.mod h1:RrGEZqqiyEcLyTVLDSgtNZVLqJykj0F4vwuuqvMdT60= -github.com/noborus/guesswidth v0.3.4 h1:+iKmbm0iFTS3pksIOKQQvLVZVOKNZHavqJoFK2mPoTQ= -github.com/noborus/guesswidth v0.3.4/go.mod h1:2F1sqiazKIwuSRjQTweQHPFJcjV5375jYUrTik9/V5k= -github.com/noborus/tbln v0.0.2 h1:pQIv+ZO38KPz52FOuhs/W3inpgmd5qwL8XFDqI+KKyY= -github.com/noborus/tbln v0.0.2/go.mod h1:kS3WhEDRJhNwF3+aRGl9iaUzu/r3lExDagcPPENtNQ0= -github.com/noborus/trdsql v0.13.0 h1:fPHsI9wsCdebmTGFbDZ2b0fKavFWv5JXHVsoDkV97Eg= -github.com/noborus/trdsql v0.13.0/go.mod h1:aLroCcvYVYWUE8TVvP46UgEZLL2LeDlH9yIbgfdTTh8= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= -github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM= -github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= @@ -245,12 +228,10 @@ github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQ github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.53.0 h1:U2pL9w9nmJwJDa4qqLQ3ZaePJ6ZTwt7cMD3AG3+aLCE= -github.com/prometheus/common v0.53.0/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U= +github.com/prometheus/common v0.54.0 h1:ZlZy0BgJhTwVZUn7dLOkwCZHUkrAqd3WYtcFCWnM1D8= +github.com/prometheus/common v0.54.0/go.mod h1:/TQgMJP5CuVYveyT7n/0Ix8yLNNXy9yRSkhnLTHPDIQ= github.com/prometheus/procfs v0.15.0 h1:A82kmvXJq2jTu5YUhSGNlYoxh85zLnKgPz4bMZgI5Ek= github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4VQSw2sQJLHk= -github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= -github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= @@ -294,8 +275,6 @@ github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= -github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= -github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/unknwon/bra v0.0.0-20200517080246-1e3013ecaff8 h1:aVGB3YnaS/JNfOW3tiHIlmNmTDg618va+eT0mVomgyI= github.com/unknwon/bra v0.0.0-20200517080246-1e3013ecaff8/go.mod h1:fVle4kNr08ydeohzYafr20oZzbAkhQT39gKK/pFQ5M4= github.com/unknwon/com v1.0.1 h1:3d1LTxD+Lnf3soQiD4Cp/0BRB+Rsa/+RTvz8GMMzIXs= @@ -308,22 +287,6 @@ github.com/urfave/cli v1.22.15 h1:nuqt+pdC/KqswQKhETJjo7pvn/k4xMUxgW6liI7XpnM= github.com/urfave/cli v1.22.15/go.mod h1:wSan1hmo5zeyLGBjRJbzRTNk8gwoYa2B9n4q9dmRIc0= github.com/xiatechs/jsonata-go v1.8.0 h1:RZxM16WXwcSLvmmgG57zlpGAHuXMp8oLUjrO+wUBtSA= github.com/xiatechs/jsonata-go v1.8.0/go.mod h1:qc/5uRtTKE5mil6PncK/ogxFQyhqlI6YnxvdyAz57Xw= -github.com/yesoreyeram/grafana-plugins/lib/go/csvframer v0.0.2 h1:bRIge6sn+clMoDhZg0txsupbjNnX9huXsXqSmjuRxpI= -github.com/yesoreyeram/grafana-plugins/lib/go/csvframer v0.0.2/go.mod h1:pd4+9wxXxXF0EIPXGgHbhDKU+RyrdwQoAamnqb8xcYM= -github.com/yesoreyeram/grafana-plugins/lib/go/framesql v0.0.1 h1:tuAmHO9KlUn3JB5B6VpvvG58h7QbGGtwVUksu42n+PU= -github.com/yesoreyeram/grafana-plugins/lib/go/framesql v0.0.1/go.mod h1:lodSHctCORyw5UWMKBMHffGERTXry5lFjZDf+r/+xAw= -github.com/yesoreyeram/grafana-plugins/lib/go/gframer v0.1.0 h1:rZwV+LQgrHQWqa1ZrjzPXEKcAaljivmrXElCeBVX9e8= -github.com/yesoreyeram/grafana-plugins/lib/go/gframer v0.1.0/go.mod h1:NjAQUJYI05pIurbQmjdITjbpPfJ4YYLmP1UBJNVFB/E= -github.com/yesoreyeram/grafana-plugins/lib/go/jsonframer v0.0.5 h1:twVL+0rP5tBVUG3awRLMoPjn0FSLnJw10pguEbxvQ1M= -github.com/yesoreyeram/grafana-plugins/lib/go/jsonframer v0.0.5/go.mod h1:HXRwHBoppq1tTQIDxm/g24C4qmjhpfYR+nnDkpaclOA= -github.com/yesoreyeram/grafana-plugins/lib/go/macros v0.3.0 h1:eHcFWMOs8+GyU6B9xlRoMiXhgHjS6FaWgNB1svCpCwk= -github.com/yesoreyeram/grafana-plugins/lib/go/macros v0.3.0/go.mod h1:ZRCELfcBw2493h+T5513hSlKsDvjDIyR8/es42IDrno= -github.com/yesoreyeram/grafana-plugins/lib/go/transformations v0.0.3 h1:mpzv5dWZbKhBYqHzQh31YzoeM4WF3g/hbzVzKdvx+x4= -github.com/yesoreyeram/grafana-plugins/lib/go/transformations v0.0.3/go.mod h1:Z0Y9vcjnd//zGX90WLFy15sN3bsBMbUio1H/7EVsbK8= -github.com/yesoreyeram/grafana-plugins/lib/go/utils v0.0.1 h1:A4C+oGjvMq8sINwXqKh19OfdKmB8BD2+Yhc2SND70L8= -github.com/yesoreyeram/grafana-plugins/lib/go/utils v0.0.1/go.mod h1:4uhug7R1Gu7qDisf6y6p2lI+wdNbLyM0Og1wJJDDLr0= -github.com/yesoreyeram/grafana-plugins/lib/go/xmlframer v0.0.6 h1:ZRudrWQQuizKXMWzsVhouGsvZNLFhZW3GhuUWfde+08= -github.com/yesoreyeram/grafana-plugins/lib/go/xmlframer v0.0.6/go.mod h1:lSz0gqi4MeK3ubDlp2gAxEfAlCSRQtiZyeXndXwtOWU= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= @@ -333,37 +296,40 @@ github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0= github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0 h1:A3SayB3rNyt+1S6qpI9mHPkeHTZbD7XILEqWnYZb2l0= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0/go.mod h1:27iA5uvhuRNmalO+iEUdVn5ZMj2qy10Mm+XRIpRmyuU= -go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.51.0 h1:974XTyIwHI4nHa1+uSLxHtUnlJ2DiVtAJjk7fd07p/8= -go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.51.0/go.mod h1:ZvX/taFlN6TGaOOM6D42wrNwPKUV1nGO2FuUXkityBU= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0 h1:Xs2Ncz0gNihqu9iosIZ5SkBbWo5T8JhhLJFMQL1qmLI= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0/go.mod h1:vy+2G/6NvVMpwGX/NyLqcC41fxepnuKHk16E6IZUcJc= -go.opentelemetry.io/contrib/propagators/jaeger v1.26.0 h1:RH76Cl2pfOLLoCtxAPax9c7oYzuL1tiI7/ZPJEmEmOw= -go.opentelemetry.io/contrib/propagators/jaeger v1.26.0/go.mod h1:W/cylm0ZtJK1uxsuTqoYGYPnqpZ8CeVGgW7TwfXPsGw= +go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.53.0 h1:IVtyPth4Rs5P8wIf0mP2KVKFNTJ4paX9qQ4Hkh5gFdc= +go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.53.0/go.mod h1:ImRBLMJv177/pwiLZ7tU7HDGNdBv7rS0HQ99eN/zBl8= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 h1:4K4tsIXefpVJtvA/8srF4V4y0akAoPHkIslgAkjixJA= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0/go.mod h1:jjdQuTGVsXV4vSs+CJ2qYDeDPf9yIJV23qlIzBm73Vg= +go.opentelemetry.io/contrib/propagators/jaeger v1.28.0 h1:xQ3ktSVS128JWIaN1DiPGIjcH+GsvkibIAVRWFjS9eM= +go.opentelemetry.io/contrib/propagators/jaeger v1.28.0/go.mod h1:O9HIyI2kVBrFoEwQZ0IN6PHXykGoit4mZV2aEjkTRH4= go.opentelemetry.io/contrib/samplers/jaegerremote v0.20.0 h1:ja+d7Aea/9PgGxB63+E0jtRFpma717wubS0KFkZpmYw= go.opentelemetry.io/contrib/samplers/jaegerremote v0.20.0/go.mod h1:Yc1eg51SJy7xZdOTyg1xyFcwE+ghcWh3/0hKeLo6Wlo= -go.opentelemetry.io/otel v1.26.0 h1:LQwgL5s/1W7YiiRwxf03QGnWLb2HW4pLiAhaA5cZXBs= -go.opentelemetry.io/otel v1.26.0/go.mod h1:UmLkJHUAidDval2EICqBMbnAd0/m2vmpf/dAM+fvFs4= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.26.0 h1:1u/AyyOqAWzy+SkPxDpahCNZParHV8Vid1RnI2clyDE= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.26.0/go.mod h1:z46paqbJ9l7c9fIPCXTqTGwhQZ5XoTIsfeFYWboizjs= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.26.0 h1:Waw9Wfpo/IXzOI8bCB7DIk+0JZcqqsyn1JFnAc+iam8= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.26.0/go.mod h1:wnJIG4fOqyynOnnQF/eQb4/16VlX2EJAHhHgqIqWfAo= -go.opentelemetry.io/otel/metric v1.26.0 h1:7S39CLuY5Jgg9CrnA9HHiEjGMF/X2VHvoXGgSllRz30= -go.opentelemetry.io/otel/metric v1.26.0/go.mod h1:SY+rHOI4cEawI9a7N1A4nIg/nTQXe1ccCNWYOJUrpX4= -go.opentelemetry.io/otel/sdk v1.26.0 h1:Y7bumHf5tAiDlRYFmGqetNcLaVUZmh4iYfmGxtmz7F8= -go.opentelemetry.io/otel/sdk v1.26.0/go.mod h1:0p8MXpqLeJ0pzcszQQN4F0S5FVjBLgypeGSngLsmirs= -go.opentelemetry.io/otel/trace v1.26.0 h1:1ieeAUb4y0TE26jUFrCIXKpTuVK7uJGN9/Z/2LP5sQA= -go.opentelemetry.io/otel/trace v1.26.0/go.mod h1:4iDxvGDQuUkHve82hJJ8UqrwswHYsZuWCBllGV2U2y0= -go.opentelemetry.io/proto/otlp v1.2.0 h1:pVeZGk7nXDC9O2hncA6nHldxEjm6LByfA2aN8IOkz94= -go.opentelemetry.io/proto/otlp v1.2.0/go.mod h1:gGpR8txAl5M03pDhMC79G6SdqNV26naRm/KDsgaHD8A= +go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= +go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= +go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 h1:3Q/xZUyC1BBkualc9ROb4G8qkH90LXEIICcs5zv1OYY= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0/go.mod h1:s75jGIWA9OfCMzF0xr+ZgfrB5FEbbV7UuYo32ahUiFI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 h1:R3X6ZXmNPRR8ul6i3WgFURCHzaXjHdm0karRG/+dj3s= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0/go.mod h1:QWFXnDavXWwMx2EEcZsf3yxgEKAqsxQ+Syjp+seyInw= +go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= +go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q= +go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s= +go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= +go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE= +go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg= +go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= +go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g= +go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI= +go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= +go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= -golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= +golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -377,11 +343,10 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -397,12 +362,9 @@ golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211004093028-2c5d950f24ef/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -410,21 +372,20 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= -golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= +golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= +golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= @@ -432,8 +393,8 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw= -golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -442,14 +403,14 @@ golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSm golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= gonum.org/v1/gonum v0.14.0 h1:2NiG67LD1tEH0D7kM+ps2V+fXmsAnpUeec7n8tcr4S0= gonum.org/v1/gonum v0.14.0/go.mod h1:AoWeoz0becf9QMWtE8iWXNXc27fK4fNeHNf/oMejGfU= -google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 h1:P8OJ/WCl/Xo4E4zoe4/bifHpSmmKwARqyqE4nW6J2GQ= -google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:RGnPtTG7r4i8sPlNyDeikXF99hMM+hN6QMm4ooG9g2g= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 h1:Q2RxlXqh1cgzzUgV261vBO2jI5R/3DD1J2pM0nI4NhU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= -google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= -google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 h1:0+ozOGcrp+Y8Aq8TLNN2Aliibms5LEzsq99ZZmAGYm0= +google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094/go.mod h1:fJ/e3If/Q67Mj99hin0hMhiNyCRmt6BQ2aWIJshUSJw= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 h1:BwIjyKYGsK9dMCBOorzRri8MQwmi7mT9rGHsCEinZkA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= +google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA= +google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/Knetic/govaluate.v3 v3.0.0 h1:18mUyIt4ZlRlFZAAfVetz4/rzlJs9yhN+U02F4u1AOc= gopkg.in/Knetic/govaluate.v3 v3.0.0/go.mod h1:csKLBORsPbafmSCGTEh3U7Ozmsuq8ZSIlKk1bcqph0E= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -466,33 +427,5 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.0.2 h1:kG1BFyqVHuQoVQiR1bWGnfz/fmHvvuiSPIV7rvl360E= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -lukechampine.com/uint128 v1.3.0 h1:cDdUVfRwDUDovz610ABgFD17nXD4/uDgVHl2sC3+sbo= -lukechampine.com/uint128 v1.3.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= -modernc.org/cc/v3 v3.41.0 h1:QoR1Sn3YWlmA1T4vLaKZfawdVtSiGx8H+cEojbC7v1Q= -modernc.org/cc/v3 v3.41.0/go.mod h1:Ni4zjJYJ04CDOhG7dn640WGfwBzfE0ecX8TyMB0Fv0Y= -modernc.org/ccgo/v3 v3.16.15 h1:KbDR3ZAVU+wiLyMESPtbtE/Add4elztFyfsWoNTgxS0= -modernc.org/ccgo/v3 v3.16.15/go.mod h1:yT7B+/E2m43tmMOT51GMoM98/MtHIcQQSleGnddkUNI= -modernc.org/ccorpus v1.11.6 h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk= -modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= -modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM= -modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= -modernc.org/libc v1.34.11 h1:hQDcIUlSG4QAOkXCIQKkaAOV5ptXvkOx4ddbXzgW2JU= -modernc.org/libc v1.34.11/go.mod h1:YAXkAZ8ktnkCKaN9sw/UDeUVkGYJ/YquGO4FTi5nmHE= -modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= -modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo= -modernc.org/memory v1.7.2 h1:Klh90S215mmH8c9gO98QxQFsY+W451E8AnzjoE2ee1E= -modernc.org/memory v1.7.2/go.mod h1:NO4NVCQy0N7ln+T9ngWqOQfi7ley4vpwvARR+Hjw95E= -modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= -modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= -modernc.org/sqlite v1.27.0 h1:MpKAHoyYB7xqcwnUwkuD+npwEa0fojF0B5QRbN+auJ8= -modernc.org/sqlite v1.27.0/go.mod h1:Qxpazz0zH8Z1xCFyi5GSL3FzbtZ3fvbjmywNogldEW0= -modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA= -modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0= -modernc.org/tcl v1.15.2 h1:C4ybAYCGJw968e+Me18oW55kD/FexcHbqH2xak1ROSY= -modernc.org/tcl v1.15.2/go.mod h1:3+k/ZaEbKrC8ePv8zJWPtBSW0V7Gg9g8rkmhI1Kfs3c= -modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= -modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= -modernc.org/z v1.7.3 h1:zDJf6iHjrnB+WRD88stbXokugjyc0/pB91ri1gO6LZY= -modernc.org/z v1.7.3/go.mod h1:Ipv4tsdxZRbQyLq9Q1M6gdbkxYzdlrciF2Hi/lS7nWE= moul.io/http2curl v1.0.0 h1:6XwpyZOYsgZJrU8exnG87ncVkU1FVCcTRpwzOkTDUi8= moul.io/http2curl v1.0.0/go.mod h1:f6cULg+e4Md/oW1cYmwW4IWQOVl2lGbmCNGOHvzX2kE= diff --git a/package.json b/package.json index 3d0702711..d27b27bae 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "grafana-infinity-datasource", - "version": "2.8.0", + "version": "2.9.1", "description": "JSON, CSV, XML, GraphQL, HTML and REST API datasource for Grafana. Do infinite things with Grafana. Transform data with UQL/GROQ. Visualize data from many apis, RSS/ATOM feeds directly", "keywords": [ "grafana", @@ -67,8 +67,9 @@ "mathjs": "11.7.0", "react": "18.2.0", "react-dom": "18.2.0", + "react-use": "^17.5.0", "tslib": "2.5.3", - "uql": "0.0.22", + "uql": "0.0.23", "xml2js": "^0.6.2" }, "devDependencies": { diff --git a/pkg/infinity/client.go b/pkg/infinity/client.go index 18bbb8e6a..84db4b856 100644 --- a/pkg/infinity/client.go +++ b/pkg/infinity/client.go @@ -20,6 +20,7 @@ import ( "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/backend/proxy" "github.com/grafana/grafana-plugin-sdk-go/backend/tracing" + "github.com/grafana/grafana-plugin-sdk-go/experimental/errorsource" "github.com/icholy/digest" "golang.org/x/oauth2" ) @@ -57,7 +58,8 @@ func GetTLSConfigFromSettings(settings models.InfinitySettings) (*tls.Config, er return tlsConfig, nil } -func getBaseHTTPClient(_ context.Context, settings models.InfinitySettings) *http.Client { +func getBaseHTTPClient(ctx context.Context, settings models.InfinitySettings) *http.Client { + logger := backend.Logger.FromContext(ctx) tlsConfig, err := GetTLSConfigFromSettings(settings) if err != nil { return nil @@ -65,12 +67,12 @@ func getBaseHTTPClient(_ context.Context, settings models.InfinitySettings) *htt transport := &http.Transport{TLSClientConfig: tlsConfig} switch settings.ProxyType { case models.ProxyTypeNone: - backend.Logger.Debug("proxy type is set to none. Not using the proxy") + logger.Debug("proxy type is set to none. Not using the proxy") case models.ProxyTypeUrl: - backend.Logger.Debug("proxy type is set to url. Using the proxy", "proxy_url", settings.ProxyUrl) + logger.Debug("proxy type is set to url. Using the proxy", "proxy_url", settings.ProxyUrl) u, err := url.Parse(settings.ProxyUrl) if err != nil { - backend.Logger.Error("error parsing proxy url", "err", err.Error(), "proxy_url", settings.ProxyUrl) + logger.Error("error parsing proxy url", "err", err.Error(), "proxy_url", settings.ProxyUrl) return nil } transport.Proxy = http.ProxyURL(u) @@ -85,6 +87,7 @@ func getBaseHTTPClient(_ context.Context, settings models.InfinitySettings) *htt } func NewClient(ctx context.Context, settings models.InfinitySettings) (client *Client, err error) { + logger := backend.Logger.FromContext(ctx) _, span := tracing.DefaultTracer().Start(ctx, "NewClient") defer span.End() if settings.AuthenticationMethod == "" { @@ -99,7 +102,7 @@ func NewClient(ctx context.Context, settings models.InfinitySettings) (client *C httpClient := getBaseHTTPClient(ctx, settings) if httpClient == nil { span.RecordError(errors.New("invalid http client")) - backend.Logger.Error("invalid http client", "datasource uid", settings.UID, "datasource name", settings.Name) + logger.Error("invalid http client", "datasource uid", settings.UID, "datasource name", settings.Name) return client, errors.New("invalid http client") } httpClient = ApplyDigestAuth(ctx, httpClient, settings) @@ -107,9 +110,9 @@ func NewClient(ctx context.Context, settings models.InfinitySettings) (client *C httpClient = ApplyOAuthJWT(ctx, httpClient, settings) httpClient = ApplyAWSAuth(ctx, httpClient, settings) - httpClient, err = ApplySecureSocksProxyConfiguration(httpClient, settings) + httpClient, err = ApplySecureSocksProxyConfiguration(ctx, httpClient, settings) if err != nil { - backend.Logger.Error("error applying secure socks proxy", "datasource uid", settings.UID, "datasource name", settings.Name) + logger.Error("error applying secure socks proxy", "datasource uid", settings.UID, "datasource name", settings.Name) return client, err } @@ -123,7 +126,7 @@ func NewClient(ctx context.Context, settings models.InfinitySettings) (client *C if err != nil { span.RecordError(err) span.SetStatus(500, err.Error()) - backend.Logger.Error("invalid azure blob credentials", "datasource uid", settings.UID, "datasource name", settings.Name) + logger.Error("invalid azure blob credentials", "datasource uid", settings.UID, "datasource name", settings.Name) return client, errors.New("invalid azure blob credentials") } clientUrl := "https://%s.blob.core.windows.net/" @@ -137,13 +140,13 @@ func NewClient(ctx context.Context, settings models.InfinitySettings) (client *C if err != nil { span.RecordError(err) span.SetStatus(500, err.Error()) - backend.Logger.Error("error creating azure blob client", "datasource uid", settings.UID, "datasource name", settings.Name) + logger.Error("error creating azure blob client", "datasource uid", settings.UID, "datasource name", settings.Name) return client, fmt.Errorf("error creating azure blob client. %s", err) } if azClient == nil { span.RecordError(errors.New("invalid/empty azure blob client")) span.SetStatus(500, "invalid/empty azure blob client") - backend.Logger.Error("invalid/empty azure blob client", "datasource uid", settings.UID, "datasource name", settings.Name) + logger.Error("invalid/empty azure blob client", "datasource uid", settings.UID, "datasource name", settings.Name) return client, errors.New("invalid/empty azure blob client") } client.AzureBlobClient = azClient @@ -154,7 +157,8 @@ func NewClient(ctx context.Context, settings models.InfinitySettings) (client *C return client, err } -func ApplySecureSocksProxyConfiguration(httpClient *http.Client, settings models.InfinitySettings) (*http.Client, error) { +func ApplySecureSocksProxyConfiguration(ctx context.Context, httpClient *http.Client, settings models.InfinitySettings) (*http.Client, error) { + logger := backend.Logger.FromContext(ctx) if IsAwsAuthConfigured(settings) { return httpClient, nil } @@ -170,7 +174,7 @@ func ApplySecureSocksProxyConfiguration(httpClient *http.Client, settings models // secure socks proxy configuration - checks if enabled inside the function err := proxy.New(settings.ProxyOpts.ProxyOptions).ConfigureSecureSocksHTTPProxy(t.(*http.Transport)) if err != nil { - backend.Logger.Error("error configuring secure socks proxy", "err", err.Error()) + logger.Error("error configuring secure socks proxy", "err", err.Error()) return nil, fmt.Errorf("error configuring secure socks proxy. %s", err) } return httpClient, nil @@ -190,45 +194,47 @@ func replaceSect(input string, settings models.InfinitySettings, includeSect boo func (client *Client) req(ctx context.Context, url string, body io.Reader, settings models.InfinitySettings, query models.Query, requestHeaders map[string]string) (obj any, statusCode int, duration time.Duration, err error) { ctx, span := tracing.DefaultTracer().Start(ctx, "client.req") + logger := backend.Logger.FromContext(ctx) defer span.End() req, _ := GetRequest(ctx, settings, body, query, requestHeaders, true) startTime := time.Now() if !CanAllowURL(req.URL.String(), settings.AllowedHosts) { - backend.Logger.Error("url is not in the allowed list. make sure to match the base URL with the settings", "url", req.URL.String()) - return nil, http.StatusUnauthorized, 0, errors.New("requested URL is not allowed. To allow this URL, update the datasource config Security -> Allowed Hosts section") + logger.Error("url is not in the allowed list. make sure to match the base URL with the settings", "url", req.URL.String()) + return nil, http.StatusUnauthorized, 0, errorsource.DownstreamError(errors.New("requested URL is not allowed. To allow this URL, update the datasource config Security -> Allowed Hosts section"), false) } - backend.Logger.Debug("yesoreyeram-infinity-datasource plugin is now requesting URL", "url", req.URL.String()) + logger.Debug("yesoreyeram-infinity-datasource plugin is now requesting URL", "url", req.URL.String()) res, err := client.HttpClient.Do(req) duration = time.Since(startTime) if res != nil { defer res.Body.Close() } if err != nil && res != nil { - backend.Logger.Error("error getting response from server", "url", url, "method", req.Method, "error", err.Error(), "status code", res.StatusCode) - return nil, res.StatusCode, duration, fmt.Errorf("error getting response from %s", url) + logger.Error("error getting response from server", "url", url, "method", req.Method, "error", err.Error(), "status code", res.StatusCode) + return nil, res.StatusCode, duration, errorsource.SourceError(backend.ErrorSourceFromHTTPStatus(res.StatusCode), fmt.Errorf("error getting response from %s", url), false) } if err != nil && res == nil { - backend.Logger.Error("error getting response from server. no response received", "url", url, "error", err.Error()) - return nil, http.StatusInternalServerError, duration, fmt.Errorf("error getting response from url %s. no response received. Error: %s", url, err.Error()) + logger.Error("error getting response from server. no response received", "url", url, "error", err.Error()) + return nil, http.StatusInternalServerError, duration, errorsource.DownstreamError(fmt.Errorf("error getting response from url %s. no response received. Error: %w", url, err), false) } if err == nil && res == nil { - backend.Logger.Error("invalid response from server and also no error", "url", url, "method", req.Method) - return nil, http.StatusInternalServerError, duration, fmt.Errorf("invalid response received for the URL %s", url) + logger.Error("invalid response from server and also no error", "url", url, "method", req.Method) + return nil, http.StatusInternalServerError, duration, errorsource.DownstreamError(fmt.Errorf("invalid response received for the URL %s", url), false) } if res.StatusCode >= http.StatusBadRequest { - return nil, res.StatusCode, duration, errors.New(res.Status) + return nil, res.StatusCode, duration, errorsource.SourceError(backend.ErrorSourceFromHTTPStatus(res.StatusCode), errors.New(res.Status), false) } bodyBytes, err := io.ReadAll(res.Body) if err != nil { - backend.Logger.Error("error reading response body", "url", url, "error", err.Error()) - return nil, res.StatusCode, duration, err + logger.Error("error reading response body", "url", url, "error", err.Error()) + return nil, res.StatusCode, duration, errorsource.DownstreamError(err, false) } bodyBytes = removeBOMContent(bodyBytes) if CanParseAsJSON(query.Type, res.Header) { var out any err := json.Unmarshal(bodyBytes, &out) if err != nil { - backend.Logger.Error("error un-marshaling JSON response", "url", url, "error", err.Error()) + err = errorsource.PluginError(err, false) + logger.Error("error un-marshaling JSON response", "url", url, "error", err.Error()) } return out, res.StatusCode, duration, err } @@ -241,28 +247,30 @@ func removeBOMContent(input []byte) []byte { } func (client *Client) GetResults(ctx context.Context, query models.Query, requestHeaders map[string]string) (o any, statusCode int, duration time.Duration, err error) { + logger := backend.Logger.FromContext(ctx) if query.Source == "azure-blob" { if strings.TrimSpace(query.AzBlobContainerName) == "" || strings.TrimSpace(query.AzBlobName) == "" { - return nil, http.StatusBadRequest, 0, errors.New("invalid/empty container name/blob name") + return nil, http.StatusBadRequest, 0, errorsource.DownstreamError(errors.New("invalid/empty container name/blob name"), false) } if client.AzureBlobClient == nil { - return nil, http.StatusInternalServerError, 0, errors.New("invalid azure blob client") + return nil, http.StatusInternalServerError, 0, errorsource.PluginError(errors.New("invalid azure blob client"), false) } blobDownloadResponse, err := client.AzureBlobClient.DownloadStream(ctx, strings.TrimSpace(query.AzBlobContainerName), strings.TrimSpace(query.AzBlobName), nil) if err != nil { - return nil, http.StatusInternalServerError, 0, err + return nil, http.StatusInternalServerError, 0, errorsource.DownstreamError(err, false) } reader := blobDownloadResponse.Body bodyBytes, err := io.ReadAll(reader) if err != nil { - return nil, http.StatusInternalServerError, 0, fmt.Errorf("error reading blob content. %w", err) + return nil, http.StatusInternalServerError, 0, errorsource.PluginError(fmt.Errorf("error reading blob content. %w", err), false) } bodyBytes = removeBOMContent(bodyBytes) if CanParseAsJSON(query.Type, http.Header{}) { var out any err := json.Unmarshal(bodyBytes, &out) if err != nil { - backend.Logger.Error("error un-marshaling blob content", "error", err.Error()) + logger.Error("error un-marshaling blob content", "error", err.Error()) + err = errorsource.PluginError(err, false) } return out, http.StatusOK, duration, err } @@ -270,7 +278,7 @@ func (client *Client) GetResults(ctx context.Context, query models.Query, reques } switch strings.ToUpper(query.URLOptions.Method) { case http.MethodPost: - body := GetQueryBody(query, client.Settings) + body := GetQueryBody(ctx,query, client.Settings) return client.req(ctx, query.URL, body, client.Settings, query, requestHeaders) default: return client.req(ctx, query.URL, nil, client.Settings, query, requestHeaders) @@ -303,7 +311,8 @@ func CanAllowURL(url string, allowedHosts []string) bool { return allow } -func GetQueryBody(query models.Query, settings models.InfinitySettings) io.Reader { +func GetQueryBody(ctx context.Context, query models.Query, settings models.InfinitySettings) io.Reader { + logger := backend.Logger.FromContext(ctx) var body io.Reader if strings.EqualFold(query.URLOptions.Method, http.MethodPost) { switch query.URLOptions.BodyType { @@ -319,7 +328,7 @@ func GetQueryBody(query models.Query, settings models.InfinitySettings) io.Reade _ = writer.WriteField(k, v) } if err := writer.Close(); err != nil { - backend.Logger.Error("error closing the query body reader") + logger.Error("error closing the query body reader") return nil } body = payload @@ -337,7 +346,7 @@ func GetQueryBody(query models.Query, settings models.InfinitySettings) io.Reade if query.URLOptions.BodyGraphQLVariables != "" { err := json.Unmarshal([]byte(query.URLOptions.BodyGraphQLVariables), &variables) if err != nil { - backend.Logger.Error("Error parsing graphql variable json", err) + logger.Error("Error parsing graphql variable json", err) } } jsonData := map[string]interface{}{ diff --git a/pkg/infinity/csvBackend.go b/pkg/infinity/csvBackend.go index f79dc67fc..cd810d0b3 100644 --- a/pkg/infinity/csvBackend.go +++ b/pkg/infinity/csvBackend.go @@ -6,8 +6,9 @@ import ( "github.com/grafana/grafana-infinity-datasource/pkg/models" "github.com/grafana/grafana-plugin-sdk-go/backend/tracing" "github.com/grafana/grafana-plugin-sdk-go/data" - "github.com/yesoreyeram/grafana-plugins/lib/go/csvframer" - "github.com/yesoreyeram/grafana-plugins/lib/go/gframer" + "github.com/grafana/grafana-plugin-sdk-go/experimental/errorsource" + "github.com/grafana/infinity-libs/lib/go/csvframer" + "github.com/grafana/infinity-libs/lib/go/gframer" ) func GetCSVBackendResponse(ctx context.Context, responseString string, query models.Query) (*data.Frame, error) { @@ -44,5 +45,8 @@ func GetCSVBackendResponse(ctx context.Context, responseString string, query mod if newFrame != nil { frame.Fields = append(frame.Fields, newFrame.Fields...) } + if err != nil { + err = errorsource.PluginError(err, false) + } return frame, err } diff --git a/pkg/infinity/googleSheets.go b/pkg/infinity/googleSheets.go index 76519c474..22873ddfc 100644 --- a/pkg/infinity/googleSheets.go +++ b/pkg/infinity/googleSheets.go @@ -1,6 +1,7 @@ package infinity import ( + "context" "encoding/json" "errors" "fmt" @@ -9,7 +10,8 @@ import ( "github.com/grafana/grafana-infinity-datasource/pkg/models" "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/data" - "github.com/yesoreyeram/grafana-plugins/lib/go/gframer" + "github.com/grafana/grafana-plugin-sdk-go/experimental/errorsource" + "github.com/grafana/infinity-libs/lib/go/gframer" ) type Spreadsheet struct { @@ -37,25 +39,26 @@ type CellData struct { NullFields []string `json:"-"` } -func GetGoogleSheetsResponse(urlResponseObject any, query models.Query) (*data.Frame, error) { +func GetGoogleSheetsResponse(ctx context.Context, urlResponseObject any, query models.Query) (*data.Frame, error) { + logger := backend.Logger.FromContext(ctx) frame := GetDummyFrame(query) sheetsString, ok := urlResponseObject.(string) if !ok { - backend.Logger.Error("error getting response for query", "error", "invalid response received from google sheets") + logger.Error("error getting response for query", "error", "invalid response received from google sheets") frame.Meta.Custom = &CustomMeta{ Query: query, Error: "invalid response received from google sheets", } - return frame, errors.New("invalid response received from google sheets") + return frame, errorsource.DownstreamError(errors.New("invalid response received from google sheets"), false) } sheet := &Spreadsheet{} if err := json.Unmarshal([]byte(sheetsString), &sheet); err != nil { - backend.Logger.Error("error getting response for query", "error", "invalid response received from google sheets") + logger.Error("error getting response for query", "error", "invalid response received from google sheets") frame.Meta.Custom = &CustomMeta{ Query: query, Error: "invalid response received from google sheets", } - return frame, errors.New("invalid response received from google sheets") + return frame, errorsource.DownstreamError(errors.New("invalid response received from google sheets"), false) } if sheet != nil && len(sheet.Sheets) > 0 && len(sheet.Sheets[0].Data) > 0 { parsedCSV := [][]string{} @@ -109,6 +112,8 @@ func GetGoogleSheetsResponse(urlResponseObject any, query models.Query) (*data.F } out = append(out, item) } + // We are not adding error source here as errors from ToDataFrame will be considered + // plugin errors, as the issue is with the plugin's handling of the data, not the data itself. return gframer.ToDataFrame(out, framerOptions) } } diff --git a/pkg/infinity/inline.go b/pkg/infinity/inline.go index 992148caa..d1a00c6e8 100644 --- a/pkg/infinity/inline.go +++ b/pkg/infinity/inline.go @@ -6,7 +6,7 @@ import ( "github.com/grafana/grafana-infinity-datasource/pkg/models" "github.com/grafana/grafana-plugin-sdk-go/data" - "github.com/yesoreyeram/grafana-plugins/lib/go/jsonframer" + "github.com/grafana/infinity-libs/lib/go/jsonframer" ) func GetFrameForInlineSources(ctx context.Context, query models.Query) (*data.Frame, error) { diff --git a/pkg/infinity/jsonBackend.go b/pkg/infinity/jsonBackend.go index c77c34d5a..88b7a49ed 100644 --- a/pkg/infinity/jsonBackend.go +++ b/pkg/infinity/jsonBackend.go @@ -9,18 +9,20 @@ import ( "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/backend/tracing" "github.com/grafana/grafana-plugin-sdk-go/data" - "github.com/yesoreyeram/grafana-plugins/lib/go/jsonframer" + "github.com/grafana/grafana-plugin-sdk-go/experimental/errorsource" + "github.com/grafana/infinity-libs/lib/go/jsonframer" ) func GetJSONBackendResponse(ctx context.Context, urlResponseObject any, query models.Query) (*data.Frame, error) { _, span := tracing.DefaultTracer().Start(ctx, "GetJSONBackendResponse") + logger := backend.Logger.FromContext(ctx) defer span.End() frame := GetDummyFrame(query) responseString, err := json.Marshal(urlResponseObject) if err != nil { - backend.Logger.Error("error json parsing root data", "error", err.Error()) + logger.Error("error json parsing root data", "error", err.Error()) frame.Meta.Custom = &CustomMeta{Query: query, Error: err.Error()} - return frame, fmt.Errorf("error parsing json root data") + return frame, errorsource.PluginError(fmt.Errorf("error parsing json root data"), false) } columns := []jsonframer.ColumnSelector{} for _, c := range query.Columns { @@ -39,5 +41,8 @@ func GetJSONBackendResponse(ctx context.Context, urlResponseObject any, query mo if newFrame != nil { frame.Fields = append(frame.Fields, newFrame.Fields...) } + if err != nil { + err = errorsource.PluginError(fmt.Errorf("error parsing json data to frame: %w", err), false) + } return frame, err } diff --git a/pkg/infinity/meta.go b/pkg/infinity/meta.go index ccf8cf1e7..6818873d1 100644 --- a/pkg/infinity/meta.go +++ b/pkg/infinity/meta.go @@ -9,6 +9,7 @@ import ( "github.com/grafana/grafana-infinity-datasource/pkg/models" "github.com/grafana/grafana-plugin-sdk-go/backend/tracing" "github.com/grafana/grafana-plugin-sdk-go/data" + "github.com/grafana/grafana-plugin-sdk-go/experimental/errorsource" ) type CustomMeta struct { @@ -46,6 +47,7 @@ func WrapMetaForInlineQuery(ctx context.Context, frame *data.Frame, err error, q customMeta := &CustomMeta{Query: query, Data: query.Data, ResponseCodeFromServer: 0} if err != nil { customMeta.Error = err.Error() + err = errorsource.PluginError(err, false) } frame.Meta = &data.FrameMeta{ ExecutedQueryString: "This feature is not available for this type of query yet", diff --git a/pkg/infinity/postprocess.go b/pkg/infinity/postprocess.go index ed59eb288..e980565b8 100644 --- a/pkg/infinity/postprocess.go +++ b/pkg/infinity/postprocess.go @@ -9,11 +9,13 @@ import ( "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/backend/tracing" "github.com/grafana/grafana-plugin-sdk-go/data" - "github.com/yesoreyeram/grafana-plugins/lib/go/transformations" + "github.com/grafana/grafana-plugin-sdk-go/experimental/errorsource" + "github.com/grafana/infinity-libs/lib/go/transformations" ) func PostProcessFrame(ctx context.Context, frame *data.Frame, query models.Query) (*data.Frame, error) { ctx, span := tracing.DefaultTracer().Start(ctx, "PostProcessFrame") + logger := backend.Logger.FromContext(ctx) defer span.End() cc := []transformations.ComputedColumn{} for _, c := range query.ComputedColumns { @@ -21,15 +23,15 @@ func PostProcessFrame(ctx context.Context, frame *data.Frame, query models.Query } frame, err := transformations.GetFrameWithComputedColumns(frame, cc) if err != nil { - backend.Logger.Error("error getting computed column", "error", err.Error()) + logger.Error("error getting computed column", "error", err.Error()) frame.Meta.Custom = &CustomMeta{Query: query, Error: err.Error()} - return frame, err + return frame, errorsource.PluginError(err, false) } frame, err = transformations.ApplyFilter(frame, query.FilterExpression) if err != nil { - backend.Logger.Error("error applying filter", "error", err.Error()) + logger.Error("error applying filter", "error", err.Error()) frame.Meta.Custom = &CustomMeta{Query: query, Error: err.Error()} - return frame, fmt.Errorf("error applying filter. %w", err) + return frame, errorsource.PluginError(fmt.Errorf("error applying filter. %w", err), false) } if strings.TrimSpace(query.SummarizeExpression) != "" { alias := query.SummarizeAlias diff --git a/pkg/infinity/reference.go b/pkg/infinity/reference.go index d6f12658d..7dd676704 100644 --- a/pkg/infinity/reference.go +++ b/pkg/infinity/reference.go @@ -6,6 +6,7 @@ import ( "strings" "github.com/grafana/grafana-infinity-datasource/pkg/models" + "github.com/grafana/grafana-plugin-sdk-go/experimental/errorsource" ) func UpdateQueryWithReferenceData(ctx context.Context, query models.Query, settings models.InfinitySettings) (models.Query, error) { @@ -17,7 +18,7 @@ func UpdateQueryWithReferenceData(ctx context.Context, query models.Query, setti return query, nil } } - return query, errors.New("error getting reference data. Either empty or not defined") + return query, errorsource.DownstreamError(errors.New("error getting reference data. Either empty or not defined"), false) } return query, nil } diff --git a/pkg/infinity/remote.go b/pkg/infinity/remote.go index 8f958ebda..24ee28d6d 100644 --- a/pkg/infinity/remote.go +++ b/pkg/infinity/remote.go @@ -11,8 +11,9 @@ import ( "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/backend/tracing" "github.com/grafana/grafana-plugin-sdk-go/data" - "github.com/yesoreyeram/grafana-plugins/lib/go/jsonframer" - "github.com/yesoreyeram/grafana-plugins/lib/go/transformations" + "github.com/grafana/grafana-plugin-sdk-go/experimental/errorsource" + "github.com/grafana/infinity-libs/lib/go/jsonframer" + "github.com/grafana/infinity-libs/lib/go/transformations" ) func GetFrameForURLSources(ctx context.Context, query models.Query, infClient Client, requestHeaders map[string]string) (*data.Frame, error) { @@ -136,6 +137,7 @@ func ApplyPaginationItemToQuery(currentQuery models.Query, fieldType models.Pagi func GetFrameForURLSourcesWithPostProcessing(ctx context.Context, query models.Query, infClient Client, requestHeaders map[string]string, postProcessingRequired bool) (*data.Frame, string, error) { ctx, span := tracing.DefaultTracer().Start(ctx, "GetFrameForURLSourcesWithPostProcessing") + logger := backend.Logger.FromContext(ctx) defer span.End() frame := GetDummyFrame(query) cursor := "" @@ -157,7 +159,7 @@ func GetFrameForURLSourcesWithPostProcessing(ctx context.Context, query models.Q return frame, cursor, err } if query.Type == models.QueryTypeGSheets { - if frame, err = GetGoogleSheetsResponse(urlResponseObject, query); err != nil { + if frame, err = GetGoogleSheetsResponse(ctx, urlResponseObject, query); err != nil { return frame, cursor, err } } @@ -185,23 +187,6 @@ func GetFrameForURLSourcesWithPostProcessing(ctx context.Context, query models.Q frame, err = PostProcessFrame(ctx, frame, query) } } - if query.Type == models.QueryTypeJSON && query.Parser == "sqlite" { - sqliteQuery := query.SQLiteQuery - if strings.TrimSpace(sqliteQuery) == "" { - sqliteQuery = "SELECT * FROM input" - } - body, err := json.Marshal(urlResponseObject) - if err != nil { - return frame, cursor, fmt.Errorf("error while marshaling the response object. %w", err) - } - if frame, err = jsonframer.ToFrame(string(body), jsonframer.FramerOptions{ - FramerType: jsonframer.FramerTypeSQLite3, - SQLite3Query: sqliteQuery, - RootSelector: query.RootSelector, - }); err != nil { - return frame, cursor, err - } - } if frame.Meta == nil { frame.Meta = &data.FrameMeta{} } @@ -216,7 +201,7 @@ func GetFrameForURLSourcesWithPostProcessing(ctx context.Context, query models.Q Duration: duration, } if err != nil { - backend.Logger.Error("error getting response for query", "error", err.Error()) + logger.Error("error getting response for query", "error", err.Error()) frame.Meta.Custom = &CustomMeta{ Data: urlResponseObject, ResponseCodeFromServer: statusCode, @@ -229,11 +214,11 @@ func GetFrameForURLSourcesWithPostProcessing(ctx context.Context, query models.Q if query.PageMode == models.PaginationModeCursor && strings.TrimSpace(query.PageParamCursorFieldExtractionPath) != "" { body, err := json.Marshal(urlResponseObject) if err != nil { - return frame, cursor, errors.New("error while finding the cursor value") + return frame, cursor, errorsource.PluginError(errors.New("error while finding the cursor value"), false) } cursor, err = jsonframer.GetRootData(string(body), query.PageParamCursorFieldExtractionPath) if err != nil { - return frame, cursor, errors.New("error while extracting the cursor value") + return frame, cursor, errorsource.PluginError(errors.New("error while extracting the cursor value"), false) } } return frame, cursor, nil diff --git a/pkg/infinity/transformations.go b/pkg/infinity/transformations.go index 05f4bbc92..fdc3e174e 100644 --- a/pkg/infinity/transformations.go +++ b/pkg/infinity/transformations.go @@ -6,7 +6,8 @@ import ( "github.com/grafana/grafana-infinity-datasource/pkg/models" "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/data" - "github.com/yesoreyeram/grafana-plugins/lib/go/transformations" + "github.com/grafana/grafana-plugin-sdk-go/experimental/errorsource" + "github.com/grafana/infinity-libs/lib/go/transformations" ) func ApplyTransformations(query models.Query, input *backend.QueryDataResponse) (*backend.QueryDataResponse, error) { @@ -27,7 +28,7 @@ func ApplyTransformations(query models.Query, input *backend.QueryDataResponse) } response, err = ApplyTransformation(query, t, response) if err != nil { - return response, err + return response, errorsource.PluginError(err, false) } } for k := range response.Responses { @@ -46,12 +47,12 @@ func ApplyTransformation(query models.Query, transformation models.Transformatio case models.LimitTransformation: for pk, pr := range input.Responses { frames, err := transformations.Limit(pr.Frames, transformations.LimitOptions{LimitField: transformation.Limit.LimitField}) - response.Responses[pk] = backend.DataResponse{Frames: frames, Error: err} + response.Responses[pk] = backend.DataResponse{Frames: frames, Error: err, ErrorSource: backend.ErrorSourcePlugin} } case models.FilterExpressionTransformation: for pk, pr := range input.Responses { frames, err := transformations.FilterExpression(pr.Frames, transformations.FilterExpressionOptions{Expression: transformation.FilterExpression.Expression}) - response.Responses[pk] = backend.DataResponse{Frames: frames, Error: err} + response.Responses[pk] = backend.DataResponse{Frames: frames, Error: err, ErrorSource: backend.ErrorSourcePlugin} } case models.ComputedColumnTransformation: var err error @@ -66,7 +67,7 @@ func ApplyTransformation(query models.Query, transformation models.Transformatio frames = append(frames, frame) } } - response.Responses[pk] = backend.DataResponse{Frames: frames, Error: err} + response.Responses[pk] = backend.DataResponse{Frames: frames, Error: err, ErrorSource: backend.ErrorSourcePlugin} } case models.SummarizeTransformation: var err error @@ -81,7 +82,7 @@ func ApplyTransformation(query models.Query, transformation models.Transformatio frames = append(frames, frame) } } - response.Responses[pk] = backend.DataResponse{Frames: frames, Error: err} + response.Responses[pk] = backend.DataResponse{Frames: frames, Error: err, ErrorSource: backend.ErrorSourcePlugin} } default: return input, nil diff --git a/pkg/infinity/xmlBackend.go b/pkg/infinity/xmlBackend.go index 34db9f92f..6078d81dc 100644 --- a/pkg/infinity/xmlBackend.go +++ b/pkg/infinity/xmlBackend.go @@ -6,8 +6,9 @@ import ( "github.com/grafana/grafana-infinity-datasource/pkg/models" "github.com/grafana/grafana-plugin-sdk-go/backend/tracing" "github.com/grafana/grafana-plugin-sdk-go/data" - "github.com/yesoreyeram/grafana-plugins/lib/go/jsonframer" - "github.com/yesoreyeram/grafana-plugins/lib/go/xmlframer" + "github.com/grafana/grafana-plugin-sdk-go/experimental/errorsource" + "github.com/grafana/infinity-libs/lib/go/jsonframer" + "github.com/grafana/infinity-libs/lib/go/xmlframer" ) func GetXMLBackendResponse(ctx context.Context, inputString string, query models.Query) (*data.Frame, error) { @@ -31,5 +32,8 @@ func GetXMLBackendResponse(ctx context.Context, inputString string, query models if newFrame != nil { frame.Fields = append(frame.Fields, newFrame.Fields...) } + if err != nil { + err = errorsource.PluginError(err, false) + } return frame, err } diff --git a/pkg/models/macros.go b/pkg/models/macros.go index 74e57b27f..91eaf8bbd 100644 --- a/pkg/models/macros.go +++ b/pkg/models/macros.go @@ -9,7 +9,8 @@ import ( "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/backend/gtime" - m "github.com/yesoreyeram/grafana-plugins/lib/go/macros" + "github.com/grafana/grafana-plugin-sdk-go/experimental/errorsource" + m "github.com/grafana/infinity-libs/lib/go/macros" ) type macroFunc func(string, []string) (string, error) @@ -18,7 +19,7 @@ func getMatches(macroName, input string) ([][]string, error) { macroRegex := fmt.Sprintf("\\$__%s\\b(?:\\((.*?)\\))?", macroName) rgx, err := regexp.Compile(macroRegex) if err != nil { - return nil, err + return nil, errorsource.PluginError(err, false) } return rgx.FindAllStringSubmatch(input, -1), nil } @@ -37,7 +38,7 @@ func InterPolateMacros(queryString string, timeRange backend.TimeRange, pluginCo macros := map[string]macroFunc{ "combineValues": func(query string, args []string) (string, error) { if len(args) <= 3 { - return query, errors.New("insufficient arguments to combineValues macro") + return query, errorsource.DownstreamError(errors.New("insufficient arguments to combineValues macro"), false) } if len(args) == 4 && args[3] == "*" { return "", nil @@ -56,7 +57,7 @@ func InterPolateMacros(queryString string, timeRange backend.TimeRange, pluginCo }, "customInterval": func(query string, args []string) (string, error) { if len(args) == 0 { - return query, errors.New("insufficient arguments to customInterval macro") + return query, errorsource.DownstreamError(errors.New("insufficient arguments to customInterval macro"), false) } for argI := range args { if argI == len(args)-1 { @@ -65,7 +66,7 @@ func InterPolateMacros(queryString string, timeRange backend.TimeRange, pluginCo if argI%2 != 0 { duration, err := gtime.ParseDuration(args[argI-1]) if err != nil { - return query, errors.New("invalid customInterval macro") + return query, errorsource.DownstreamError(errors.New("invalid customInterval macro"), false) } if timeRangeInMilliSeconds <= duration.Milliseconds() { return args[argI], nil @@ -78,7 +79,7 @@ func InterPolateMacros(queryString string, timeRange backend.TimeRange, pluginCo for key, macro := range macros { matches, err := getMatches(key, queryString) if err != nil { - return queryString, err + return queryString, errorsource.PluginError(err, false) } for _, match := range matches { if len(match) == 0 { @@ -90,7 +91,7 @@ func InterPolateMacros(queryString string, timeRange backend.TimeRange, pluginCo } res, err := macro(queryString, args) if err != nil { - return queryString, err + return queryString, errorsource.PluginError(err, false) } queryString = strings.Replace(queryString, match[0], res, -1) } diff --git a/pkg/models/macros_test.go b/pkg/models/macros_test.go index c04ed79b0..33d597464 100644 --- a/pkg/models/macros_test.go +++ b/pkg/models/macros_test.go @@ -8,6 +8,7 @@ import ( "github.com/grafana/grafana-infinity-datasource/pkg/models" "github.com/grafana/grafana-plugin-sdk-go/backend" + "github.com/grafana/grafana-plugin-sdk-go/experimental/errorsource" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -21,9 +22,9 @@ func TestInterPolateCombineValueMacros(t *testing.T) { wantError error }{ {query: "foo", want: "foo"}, - {query: "$__combineValues", wantError: errors.New("insufficient arguments to combineValues macro")}, - {query: "$__combineValues()", wantError: errors.New("insufficient arguments to combineValues macro")}, - {query: "$__combineValues(a,b,c)", wantError: errors.New("insufficient arguments to combineValues macro")}, + {query: "$__combineValues", wantError: errorsource.DownstreamError(errors.New("insufficient arguments to combineValues macro"), false)}, + {query: "$__combineValues()", wantError: errorsource.DownstreamError(errors.New("insufficient arguments to combineValues macro"), false)}, + {query: "$__combineValues(a,b,c)", wantError: errorsource.DownstreamError(errors.New("insufficient arguments to combineValues macro"), false)}, {query: "$__combineValues(a,b,c,*)", want: ""}, {query: "$__combineValues(a,b,c,d)", want: "adb"}, {query: "$__combineValues(a,b,__space,d,e)", want: "adb aeb"}, @@ -107,7 +108,7 @@ func TestInterPolateCustomIntervalMacros(t *testing.T) { {query: "$__customInterval(1d)", want: "1d"}, {query: "$__customInterval(1m,1 MIN)", want: "1 MIN"}, {query: "$__customInterval(1m,1 MIN,1d)", want: "1d"}, - {query: "$__customInterval(1min,1 MIN,1d)", wantError: errors.New("invalid customInterval macro")}, + {query: "$__customInterval(1min,1 MIN,1d)", wantError: errorsource.DownstreamError(errors.New("invalid customInterval macro"), false)}, {query: "$__customInterval(2d,2 DAYS,1d)", want: "2 DAYS"}, {query: "$__customInterval(5m,5 MINUTES,1d,1 DAY,10d,10 days,1d)", want: "1 DAY"}, {query: "foo $__customInterval(5m,5 MINUTES,1d,1 DAY,10d,10 days,1d) $__customInterval(2d,2 DAYS,1d) bar", want: "foo 1 DAY 2 DAYS bar"}, diff --git a/pkg/models/query.go b/pkg/models/query.go index 5bba36f16..51aeaa80f 100644 --- a/pkg/models/query.go +++ b/pkg/models/query.go @@ -8,6 +8,7 @@ import ( "strings" "github.com/grafana/grafana-plugin-sdk-go/backend" + "github.com/grafana/grafana-plugin-sdk-go/experimental/errorsource" ) type QueryType string @@ -30,7 +31,6 @@ type InfinityParser string const ( InfinityParserSimple InfinityParser = "simple" InfinityParserBackend InfinityParser = "backend" - InfinityParserSQLite InfinityParser = "sqlite" InfinityParserUQL InfinityParser = "uql" InfinityParserGROQ InfinityParser = "groq" ) @@ -94,14 +94,13 @@ type Query struct { URL string `json:"url"` URLOptions URLOptions `json:"url_options"` Data string `json:"data"` - Parser InfinityParser `json:"parser"` // 'simple' | 'backend' | 'sqlite' | 'uql' | 'groq' + Parser InfinityParser `json:"parser"` // 'simple' | 'backend' | 'uql' | 'groq' FilterExpression string `json:"filterExpression"` SummarizeExpression string `json:"summarizeExpression"` SummarizeBy string `json:"summarizeBy"` SummarizeAlias string `json:"summarizeAlias"` UQL string `json:"uql"` GROQ string `json:"groq"` - SQLiteQuery string `json:"sqlite_query"` CSVOptions InfinityCSVOptions `json:"csv_options"` JSONOptions InfinityJSONOptions `json:"json_options"` RootSelector string `json:"root_selector"` @@ -311,11 +310,13 @@ func LoadQuery(ctx context.Context, backendQuery backend.DataQuery, pluginContex var query Query err := json.Unmarshal(backendQuery.JSON, &query) if err != nil { - return query, fmt.Errorf("error while parsing the query json. %s", err.Error()) + // Plugin error as the user should not have been able to send a bad query + return query, errorsource.PluginError(fmt.Errorf("error while parsing the query json. %w", err), false) } query = ApplyDefaultsToQuery(ctx, query) if query.PageMode == PaginationModeList && strings.TrimSpace(query.PageParamListFieldName) == "" { - return query, errors.New("pagination_param_list_field_name cannot be empty") + // Downstream error as user input is not correct + return query, errorsource.DownstreamError(errors.New("pagination_param_list_field_name cannot be empty"), false) } return ApplyMacros(ctx, query, backendQuery.TimeRange, pluginContext) } diff --git a/pkg/models/query_test.go b/pkg/models/query_test.go index 86aa75c76..f4571a54c 100644 --- a/pkg/models/query_test.go +++ b/pkg/models/query_test.go @@ -63,7 +63,6 @@ func TestLoadQuery(t *testing.T) { }, "uql" : "my-uql-query", "groq" : "my-groq-query", - "sqlite_query" : "select foo from bar", "expression" : "my-expression", "seriesCount" : 20, "alias" : "my-alias", @@ -112,7 +111,6 @@ func TestLoadQuery(t *testing.T) { }, UQL: "my-uql-query", GROQ: "my-groq-query", - SQLiteQuery: "select foo from bar", Expression: "my-expression", SeriesCount: 20, Alias: "my-alias", diff --git a/pkg/pluginhost/handler_querydata.go b/pkg/pluginhost/handler_querydata.go index 1afaff0bc..ccae69009 100644 --- a/pkg/pluginhost/handler_querydata.go +++ b/pkg/pluginhost/handler_querydata.go @@ -10,6 +10,7 @@ import ( "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/backend/tracing" "github.com/grafana/grafana-plugin-sdk-go/data" + "github.com/grafana/grafana-plugin-sdk-go/experimental/errorsource" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" ) @@ -21,16 +22,16 @@ func (ds *DataSource) QueryData(ctx context.Context, req *backend.QueryDataReque defer span.End() response := backend.NewQueryDataResponse() if ds.client == nil { - return response, errors.New("invalid infinity client") + return response, errorsource.PluginError(errors.New("invalid infinity client"), false) } for _, q := range req.Queries { - res := backend.DataResponse{} query, err := models.LoadQuery(ctx, q, req.PluginContext) if err != nil { span.RecordError(err) logger.Error("error un-marshaling the query", "error", err.Error()) - res.Error = fmt.Errorf("error un-marshaling the query. %w", err) - response.Responses[q.RefID] = res + // Here we are using error source from the original error and if it does not have any source we are using the plugin error as the default source + errorRes := errorsource.Response(errorsource.SourceError(backend.ErrorSourcePlugin, fmt.Errorf("%s: %w", "error un-marshaling the query", err), false)) + response.Responses[q.RefID] = errorRes continue } if query.Type == models.QueryTypeTransformations { @@ -39,13 +40,13 @@ func (ds *DataSource) QueryData(ctx context.Context, req *backend.QueryDataReque logger.Error("error applying infinity query transformation", "error", err.Error()) span.RecordError(err) span.SetStatus(500, err.Error()) - return response, err + // We should have error source from the original error, but in a case it is not there, we are using the plugin error as the default source + return response, errorsource.PluginError(fmt.Errorf("%s: %w", "error applying infinity query transformation", err), false) } response = response1 continue } - res = QueryDataQuery(ctx, query, *ds.client, req.Headers, req.PluginContext) - response.Responses[q.RefID] = res + response.Responses[q.RefID] = QueryDataQuery(ctx, query, *ds.client, req.Headers, req.PluginContext) } return response, nil } @@ -60,6 +61,8 @@ func QueryData(ctx context.Context, backendQuery backend.DataQuery, infClient in span.SetStatus(500, err.Error()) logger.Error("error un-marshaling the query", "error", err.Error()) response.Error = fmt.Errorf("error un-marshaling the query. %w", err) + // We should have error source from the original error, but in a case it is not there, we are using the plugin error as the default source + response.ErrorSource = errorsource.SourceError(backend.ErrorSourcePlugin, err, false).Source() return response } return QueryDataQuery(ctx, query, infClient, requestHeaders, pluginContext) @@ -96,8 +99,7 @@ func QueryDataQuery(ctx context.Context, query models.Query, infClient infinity. sheetRange = sheetName + "!" + sheetRange } if sheetId == "" { - response.Error = errors.New("invalid or empty sheet ID") - return response + return errorsource.Response(errorsource.DownstreamError(errors.New("invalid or empty sheet ID"), false)) } query.URL = fmt.Sprintf("https://sheets.googleapis.com/v4/spreadsheets/%s?includeGridData=true&ranges=%s", sheetId, sheetRange) frame, err := infinity.GetFrameForURLSources(ctx, query, infClient, requestHeaders) @@ -105,7 +107,10 @@ func QueryDataQuery(ctx context.Context, query models.Query, infClient infinity. span.RecordError(err) span.SetStatus(500, err.Error()) response.Frames = append(response.Frames, frame) - response.Error = fmt.Errorf("error getting data frame from google sheets. %w", err) + wrappedError := fmt.Errorf("%s: %w", "error getting data frame from google sheets", err) + response.Error = wrappedError + // We should have error source from the original error, but in a case it is not there, we are using the plugin error as the default source + response.ErrorSource = errorsource.SourceError(backend.ErrorSourcePlugin, wrappedError, false).Source() return response } if frame != nil { @@ -117,15 +122,18 @@ func QueryDataQuery(ctx context.Context, query models.Query, infClient infinity. case "url", "azure-blob": if infClient.Settings.AuthenticationMethod != models.AuthenticationMethodAzureBlob && infClient.Settings.AuthenticationMethod != models.AuthenticationMethodNone && len(infClient.Settings.AllowedHosts) < 1 { response.Error = errors.New("datasource is missing allowed hosts/URLs. Configure it in the datasource settings page for enhanced security") + response.ErrorSource = backend.ErrorSourceDownstream return response } if infClient.Settings.HaveSecureHeaders() && len(infClient.Settings.AllowedHosts) < 1 { response.Error = errors.New("datasource is missing allowed hosts/URLs. Configure it in the datasource settings page for enhanced security") + response.ErrorSource = backend.ErrorSourceDownstream return response } if notices := infinity.GetSecureHeaderWarnings(query); infClient.Settings.UnsecuredQueryHandling == models.UnsecuredQueryHandlingDeny && len(notices) > 0 { response.Error = errors.New("query contain sensitive content and denied by the unsecuredQueryHandling config") response.Status = backend.StatusForbidden + response.ErrorSource = backend.ErrorSourceDownstream return response } frame, err := infinity.GetFrameForURLSources(ctx, query, infClient, requestHeaders) @@ -138,6 +146,8 @@ func QueryDataQuery(ctx context.Context, query models.Query, infClient infinity. span.RecordError(err) span.SetStatus(500, err.Error()) response.Error = fmt.Errorf("error getting data frame. %w", err) + // We should have error source from the original error, but in a case it is not there, we are using the plugin error as the default source + response.ErrorSource = errorsource.SourceError(backend.ErrorSourcePlugin, err, false).Source() return response } if frame != nil && infClient.Settings.AuthenticationMethod != models.AuthenticationMethodAzureBlob && infClient.Settings.AuthenticationMethod != models.AuthenticationMethodNone && infClient.Settings.AuthenticationMethod != "" && len(infClient.Settings.AllowedHosts) < 1 { @@ -158,6 +168,8 @@ func QueryDataQuery(ctx context.Context, query models.Query, infClient infinity. frame, _ := infinity.WrapMetaForInlineQuery(ctx, frame, err, query) response.Frames = append(response.Frames, frame) response.Error = fmt.Errorf("error getting data frame from inline data. %w", err) + // We should have error source from the original error, but in a case it is not there, we are using the plugin error as the default source + response.ErrorSource = errorsource.SourceError(backend.ErrorSourcePlugin, err, false).Source() return response } if frame != nil { diff --git a/pkg/testsuite/golden/azure_blob/backend.jsonc b/pkg/testsuite/golden/azure_blob/backend.jsonc index 74ac223b7..665b30c59 100644 --- a/pkg/testsuite/golden/azure_blob/backend.jsonc +++ b/pkg/testsuite/golden/azure_blob/backend.jsonc @@ -29,7 +29,6 @@ // "summarizeBy": "", // "uql": "", // "groq": "", -// "sqlite_query": "", // "csv_options": { // "delimiter": "", // "skip_empty_lines": false, @@ -158,7 +157,6 @@ "summarizeBy": "", "uql": "", "groq": "", - "sqlite_query": "", "csv_options": { "delimiter": "", "skip_empty_lines": false, diff --git a/pkg/testsuite/golden/azure_blob/backend_csv.jsonc b/pkg/testsuite/golden/azure_blob/backend_csv.jsonc index 64c73c0b0..c64a28e2b 100644 --- a/pkg/testsuite/golden/azure_blob/backend_csv.jsonc +++ b/pkg/testsuite/golden/azure_blob/backend_csv.jsonc @@ -29,7 +29,6 @@ // "summarizeBy": "", // "uql": "", // "groq": "", -// "sqlite_query": "", // "csv_options": { // "delimiter": "", // "skip_empty_lines": false, @@ -115,7 +114,6 @@ "summarizeBy": "", "uql": "", "groq": "", - "sqlite_query": "", "csv_options": { "delimiter": "", "skip_empty_lines": false, diff --git a/pkg/testsuite/golden/azure_blob/default_tsv.jsonc b/pkg/testsuite/golden/azure_blob/default_tsv.jsonc index ea37a3c49..81298b4aa 100644 --- a/pkg/testsuite/golden/azure_blob/default_tsv.jsonc +++ b/pkg/testsuite/golden/azure_blob/default_tsv.jsonc @@ -29,7 +29,6 @@ // "summarizeBy": "", // "uql": "", // "groq": "", -// "sqlite_query": "", // "csv_options": { // "delimiter": "", // "skip_empty_lines": false, @@ -105,7 +104,6 @@ "summarizeBy": "", "uql": "", "groq": "", - "sqlite_query": "", "csv_options": { "delimiter": "", "skip_empty_lines": false, diff --git a/pkg/testsuite/golden/azure_blob/uql_xml.jsonc b/pkg/testsuite/golden/azure_blob/uql_xml.jsonc index c7220909c..a84473743 100644 --- a/pkg/testsuite/golden/azure_blob/uql_xml.jsonc +++ b/pkg/testsuite/golden/azure_blob/uql_xml.jsonc @@ -29,7 +29,6 @@ // "summarizeBy": "", // "uql": "parse-xml", // "groq": "", -// "sqlite_query": "", // "csv_options": { // "delimiter": "", // "skip_empty_lines": false, @@ -105,7 +104,6 @@ "summarizeBy": "", "uql": "parse-xml", "groq": "", - "sqlite_query": "", "csv_options": { "delimiter": "", "skip_empty_lines": false, diff --git a/pkg/testsuite/golden/backend-computed-columns.jsonc b/pkg/testsuite/golden/backend-computed-columns.jsonc index b491c6b6d..e8d7e2212 100644 --- a/pkg/testsuite/golden/backend-computed-columns.jsonc +++ b/pkg/testsuite/golden/backend-computed-columns.jsonc @@ -31,7 +31,6 @@ // "summarizeAlias": "", // "uql": "", // "groq": "", -// "sqlite_query": "", // "csv_options": { // "delimiter": "", // "skip_empty_lines": false, @@ -120,7 +119,6 @@ "summarizeAlias": "", "uql": "", "groq": "", - "sqlite_query": "", "csv_options": { "delimiter": "", "skip_empty_lines": false, diff --git a/pkg/testsuite/golden/backend-filter-computed-columns.jsonc b/pkg/testsuite/golden/backend-filter-computed-columns.jsonc index 889f07c27..3fffd6e8d 100644 --- a/pkg/testsuite/golden/backend-filter-computed-columns.jsonc +++ b/pkg/testsuite/golden/backend-filter-computed-columns.jsonc @@ -31,7 +31,6 @@ // "summarizeAlias": "", // "uql": "", // "groq": "", -// "sqlite_query": "", // "csv_options": { // "delimiter": "", // "skip_empty_lines": false, @@ -124,7 +123,6 @@ "summarizeAlias": "", "uql": "", "groq": "", - "sqlite_query": "", "csv_options": { "delimiter": "", "skip_empty_lines": false, diff --git a/pkg/testsuite/golden/csv_backend_inline_default.jsonc b/pkg/testsuite/golden/csv_backend_inline_default.jsonc index 66b82f827..e602ad46f 100644 --- a/pkg/testsuite/golden/csv_backend_inline_default.jsonc +++ b/pkg/testsuite/golden/csv_backend_inline_default.jsonc @@ -31,7 +31,6 @@ // "summarizeAlias": "", // "uql": "", // "groq": "", -// "sqlite_query": "", // "csv_options": { // "delimiter": "", // "skip_empty_lines": false, @@ -113,7 +112,6 @@ "summarizeAlias": "", "uql": "", "groq": "", - "sqlite_query": "", "csv_options": { "delimiter": "", "skip_empty_lines": false, diff --git a/pkg/testsuite/golden/csv_backend_url_default.jsonc b/pkg/testsuite/golden/csv_backend_url_default.jsonc index 2346075bc..e872df810 100644 --- a/pkg/testsuite/golden/csv_backend_url_default.jsonc +++ b/pkg/testsuite/golden/csv_backend_url_default.jsonc @@ -31,7 +31,6 @@ // "summarizeAlias": "", // "uql": "", // "groq": "", -// "sqlite_query": "", // "csv_options": { // "delimiter": "", // "skip_empty_lines": false, @@ -112,7 +111,6 @@ "summarizeAlias": "", "uql": "", "groq": "", - "sqlite_query": "", "csv_options": { "delimiter": "", "skip_empty_lines": false, diff --git a/pkg/testsuite/golden/csv_default_url_default.jsonc b/pkg/testsuite/golden/csv_default_url_default.jsonc index 96fb7f564..d88fc3e70 100644 --- a/pkg/testsuite/golden/csv_default_url_default.jsonc +++ b/pkg/testsuite/golden/csv_default_url_default.jsonc @@ -31,7 +31,6 @@ // "summarizeAlias": "", // "uql": "", // "groq": "", -// "sqlite_query": "", // "csv_options": { // "delimiter": "", // "skip_empty_lines": false, @@ -106,7 +105,6 @@ "summarizeAlias": "", "uql": "", "groq": "", - "sqlite_query": "", "csv_options": { "delimiter": "", "skip_empty_lines": false, diff --git a/pkg/testsuite/golden/html_backend_url_default.jsonc b/pkg/testsuite/golden/html_backend_url_default.jsonc index 917847d41..bd2295fcf 100644 --- a/pkg/testsuite/golden/html_backend_url_default.jsonc +++ b/pkg/testsuite/golden/html_backend_url_default.jsonc @@ -31,7 +31,6 @@ // "summarizeAlias": "", // "uql": "", // "groq": "", -// "sqlite_query": "", // "csv_options": { // "delimiter": "", // "skip_empty_lines": false, @@ -147,7 +146,6 @@ "summarizeAlias": "", "uql": "", "groq": "", - "sqlite_query": "", "csv_options": { "delimiter": "", "skip_empty_lines": false, diff --git a/pkg/testsuite/golden/html_default_url_default.jsonc b/pkg/testsuite/golden/html_default_url_default.jsonc index 32dc48518..54c21b1e9 100644 --- a/pkg/testsuite/golden/html_default_url_default.jsonc +++ b/pkg/testsuite/golden/html_default_url_default.jsonc @@ -31,7 +31,6 @@ // "summarizeAlias": "", // "uql": "", // "groq": "", -// "sqlite_query": "", // "csv_options": { // "delimiter": "", // "skip_empty_lines": false, @@ -137,7 +136,6 @@ "summarizeAlias": "", "uql": "", "groq": "", - "sqlite_query": "", "csv_options": { "delimiter": "", "skip_empty_lines": false, diff --git a/pkg/testsuite/golden/inline/should_execute_default_query_without_error.jsonc b/pkg/testsuite/golden/inline/should_execute_default_query_without_error.jsonc index 6d72167b1..a2afcbdb7 100644 --- a/pkg/testsuite/golden/inline/should_execute_default_query_without_error.jsonc +++ b/pkg/testsuite/golden/inline/should_execute_default_query_without_error.jsonc @@ -31,7 +31,6 @@ // "summarizeAlias": "", // "uql": "", // "groq": "", -// "sqlite_query": "", // "csv_options": { // "delimiter": "", // "skip_empty_lines": false, @@ -106,7 +105,6 @@ "summarizeAlias": "", "uql": "", "groq": "", - "sqlite_query": "", "csv_options": { "delimiter": "", "skip_empty_lines": false, diff --git a/pkg/testsuite/golden/inline/should_return_backend_results_jsonata_root_selector.jsonc b/pkg/testsuite/golden/inline/should_return_backend_results_jsonata_root_selector.jsonc index 5253b3af2..98ca7170d 100644 --- a/pkg/testsuite/golden/inline/should_return_backend_results_jsonata_root_selector.jsonc +++ b/pkg/testsuite/golden/inline/should_return_backend_results_jsonata_root_selector.jsonc @@ -31,7 +31,6 @@ // "summarizeAlias": "", // "uql": "", // "groq": "", -// "sqlite_query": "", // "csv_options": { // "delimiter": "", // "skip_empty_lines": false, @@ -111,7 +110,6 @@ "summarizeAlias": "", "uql": "", "groq": "", - "sqlite_query": "", "csv_options": { "delimiter": "", "skip_empty_lines": false, diff --git a/pkg/testsuite/golden/inline/should_return_inline_uql_correctly.jsonc b/pkg/testsuite/golden/inline/should_return_inline_uql_correctly.jsonc index dc3adbb3a..328df4989 100644 --- a/pkg/testsuite/golden/inline/should_return_inline_uql_correctly.jsonc +++ b/pkg/testsuite/golden/inline/should_return_inline_uql_correctly.jsonc @@ -31,7 +31,6 @@ // "summarizeAlias": "", // "uql": "parse-json | count", // "groq": "", -// "sqlite_query": "", // "csv_options": { // "delimiter": "", // "skip_empty_lines": false, @@ -106,7 +105,6 @@ "summarizeAlias": "", "uql": "parse-json | count", "groq": "", - "sqlite_query": "", "csv_options": { "delimiter": "", "skip_empty_lines": false, diff --git a/pkg/testsuite/golden/json_default_url_default.jsonc b/pkg/testsuite/golden/json_default_url_default.jsonc index c960df4c1..ae463f995 100644 --- a/pkg/testsuite/golden/json_default_url_default.jsonc +++ b/pkg/testsuite/golden/json_default_url_default.jsonc @@ -31,7 +31,6 @@ // "summarizeAlias": "", // "uql": "", // "groq": "", -// "sqlite_query": "", // "csv_options": { // "delimiter": "", // "skip_empty_lines": false, @@ -108,7 +107,6 @@ "summarizeAlias": "", "uql": "", "groq": "", - "sqlite_query": "", "csv_options": { "delimiter": "", "skip_empty_lines": false, diff --git a/pkg/testsuite/golden/remote/csv_query.jsonc b/pkg/testsuite/golden/remote/csv_query.jsonc index 61282d3b8..c74cb5ed0 100644 --- a/pkg/testsuite/golden/remote/csv_query.jsonc +++ b/pkg/testsuite/golden/remote/csv_query.jsonc @@ -31,7 +31,6 @@ // "summarizeAlias": "", // "uql": "", // "groq": "", -// "sqlite_query": "", // "csv_options": { // "delimiter": "", // "skip_empty_lines": false, @@ -106,7 +105,6 @@ "summarizeAlias": "", "uql": "", "groq": "", - "sqlite_query": "", "csv_options": { "delimiter": "", "skip_empty_lines": false, diff --git a/pkg/testsuite/golden/remote/groq_query.jsonc b/pkg/testsuite/golden/remote/groq_query.jsonc index ae25bede3..fd02f58d0 100644 --- a/pkg/testsuite/golden/remote/groq_query.jsonc +++ b/pkg/testsuite/golden/remote/groq_query.jsonc @@ -31,7 +31,6 @@ // "summarizeAlias": "", // "uql": "", // "groq": "*{1,2,3}", -// "sqlite_query": "", // "csv_options": { // "delimiter": "", // "skip_empty_lines": false, @@ -106,7 +105,6 @@ "summarizeAlias": "", "uql": "", "groq": "*{1,2,3}", - "sqlite_query": "", "csv_options": { "delimiter": "", "skip_empty_lines": false, diff --git a/pkg/testsuite/golden/remote/json_query.jsonc b/pkg/testsuite/golden/remote/json_query.jsonc index 409a91d2e..f0da9e252 100644 --- a/pkg/testsuite/golden/remote/json_query.jsonc +++ b/pkg/testsuite/golden/remote/json_query.jsonc @@ -31,7 +31,6 @@ // "summarizeAlias": "", // "uql": "", // "groq": "", -// "sqlite_query": "", // "csv_options": { // "delimiter": "", // "skip_empty_lines": false, @@ -110,7 +109,6 @@ "summarizeAlias": "", "uql": "", "groq": "", - "sqlite_query": "", "csv_options": { "delimiter": "", "skip_empty_lines": false, diff --git a/pkg/testsuite/golden/remote/should_execute_default_query_without_error.jsonc b/pkg/testsuite/golden/remote/should_execute_default_query_without_error.jsonc index f98ccdd77..09f1d7edd 100644 --- a/pkg/testsuite/golden/remote/should_execute_default_query_without_error.jsonc +++ b/pkg/testsuite/golden/remote/should_execute_default_query_without_error.jsonc @@ -31,7 +31,6 @@ // "summarizeAlias": "", // "uql": "", // "groq": "", -// "sqlite_query": "", // "csv_options": { // "delimiter": "", // "skip_empty_lines": false, @@ -106,7 +105,6 @@ "summarizeAlias": "", "uql": "", "groq": "", - "sqlite_query": "", "csv_options": { "delimiter": "", "skip_empty_lines": false, diff --git a/pkg/testsuite/golden/remote/uql_query.jsonc b/pkg/testsuite/golden/remote/uql_query.jsonc index 69430ba5d..5dd27fb66 100644 --- a/pkg/testsuite/golden/remote/uql_query.jsonc +++ b/pkg/testsuite/golden/remote/uql_query.jsonc @@ -31,7 +31,6 @@ // "summarizeAlias": "", // "uql": "parse-json | count", // "groq": "", -// "sqlite_query": "", // "csv_options": { // "delimiter": "", // "skip_empty_lines": false, @@ -106,7 +105,6 @@ "summarizeAlias": "", "uql": "parse-json | count", "groq": "", - "sqlite_query": "", "csv_options": { "delimiter": "", "skip_empty_lines": false, diff --git a/pkg/testsuite/golden/scenario_azure_cost_management.jsonc b/pkg/testsuite/golden/scenario_azure_cost_management.jsonc index cb975bdd3..14d293170 100644 --- a/pkg/testsuite/golden/scenario_azure_cost_management.jsonc +++ b/pkg/testsuite/golden/scenario_azure_cost_management.jsonc @@ -31,7 +31,6 @@ // "summarizeAlias": "", // "uql": "", // "groq": "", -// "sqlite_query": "", // "csv_options": { // "delimiter": "", // "skip_empty_lines": false, @@ -329,7 +328,6 @@ "summarizeAlias": "", "uql": "", "groq": "", - "sqlite_query": "", "csv_options": { "delimiter": "", "skip_empty_lines": false, diff --git a/pkg/testsuite/golden/transformations_limit_default_A.jsonc b/pkg/testsuite/golden/transformations_limit_default_A.jsonc index a05641bf2..cdc018247 100644 --- a/pkg/testsuite/golden/transformations_limit_default_A.jsonc +++ b/pkg/testsuite/golden/transformations_limit_default_A.jsonc @@ -31,7 +31,6 @@ // "summarizeAlias": "", // "uql": "", // "groq": "", -// "sqlite_query": "", // "csv_options": { // "delimiter": "", // "skip_empty_lines": false, @@ -118,7 +117,6 @@ "summarizeAlias": "", "uql": "", "groq": "", - "sqlite_query": "", "csv_options": { "delimiter": "", "skip_empty_lines": false, diff --git a/pkg/testsuite/golden/transformations_limit_default_B.jsonc b/pkg/testsuite/golden/transformations_limit_default_B.jsonc index 69e92ed88..d86cd188b 100644 --- a/pkg/testsuite/golden/transformations_limit_default_B.jsonc +++ b/pkg/testsuite/golden/transformations_limit_default_B.jsonc @@ -31,7 +31,6 @@ // "summarizeAlias": "", // "uql": "", // "groq": "", -// "sqlite_query": "", // "csv_options": { // "delimiter": "", // "skip_empty_lines": false, @@ -118,7 +117,6 @@ "summarizeAlias": "", "uql": "", "groq": "", - "sqlite_query": "", "csv_options": { "delimiter": "", "skip_empty_lines": false, diff --git a/pkg/testsuite/golden/xml_backend_url_default.jsonc b/pkg/testsuite/golden/xml_backend_url_default.jsonc index cad7a34f7..2b092b2a0 100644 --- a/pkg/testsuite/golden/xml_backend_url_default.jsonc +++ b/pkg/testsuite/golden/xml_backend_url_default.jsonc @@ -31,7 +31,6 @@ // "summarizeAlias": "", // "uql": "", // "groq": "", -// "sqlite_query": "", // "csv_options": { // "delimiter": "", // "skip_empty_lines": false, @@ -112,7 +111,6 @@ "summarizeAlias": "", "uql": "", "groq": "", - "sqlite_query": "", "csv_options": { "delimiter": "", "skip_empty_lines": false, diff --git a/pkg/testsuite/handler_querydata_test.go b/pkg/testsuite/handler_querydata_test.go index 21429c7ec..d5e75f75d 100644 --- a/pkg/testsuite/handler_querydata_test.go +++ b/pkg/testsuite/handler_querydata_test.go @@ -513,72 +513,6 @@ func TestResponseFormats(t *testing.T) { experimental.CheckGoldenJSONResponse(t, "golden", "backend-filter-computed-columns", &res, UPDATE_GOLDEN_DATA) }) }) - t.Run("JSON SQLite", func(t *testing.T) { - t.Run("should parse the response and send results", func(t *testing.T) { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - assert.Equal(t, http.MethodGet, r.Method) - fmt.Fprintf(w, `{ - "channel": { - "id": 38629, - "name": "Traffic Monitor", - "description": "Traffic Monitor showing density of cars detected", - "latitude": "42.28", - "longitude": "-71.35", - "field1": "Density of Westbound Cars", - "field2": "Density of Eastbound Cars", - "created_at": "2015-05-19T20:14:03Z", - "updated_at": "2019-07-24T20:12:00Z", - "last_entry_id": 13487228 - }, - "feeds": [ - { - "created_at": "2022-09-06T16:40:50Z", - "entry_id": 13487129, - "field1": "20.000000", - "field2": "46.000000" - }, - { - "created_at": "2022-09-06T16:40:50Z", - "entry_id": 13487130, - "field1": "22.000000", - "field2": "32.000000" - }, - { - "created_at": "2022-09-06T17:40:50Z", - "entry_id": 13487129, - "field1": "30.000000", - "field2": "56.000000" - }, - { - "created_at": "2022-09-06T17:40:50Z", - "entry_id": 13487130, - "field1": "10.000000", - "field2": "36.000000" - } - ] - }`) - })) - defer server.Close() - client, err := infinity.NewClient(context.TODO(), models.InfinitySettings{URL: server.URL}) - require.Nil(t, err) - res := pluginhost.QueryData(context.Background(), backend.DataQuery{ - JSON: []byte(fmt.Sprintf(`{ - "type": "json", - "url": "%s", - "source": "url", - "format": "timeseries", - "parser": "sqlite", - "root_selector": "feeds", - "sqlite": "select * from input" - }`, server.URL)), - }, *client, map[string]string{}, backend.PluginContext{}) - require.NotNil(t, res) - require.Nil(t, res.Error) - // require.Equal(t, data.FieldTypeNullableFloat64, res.Frames[0].Fields[0].Type()) - // require.Equal(t, data.FieldTypeNullableString, res.Frames[0].Fields[1].Type()) - // require.Equal(t, data.FieldTypeNullableTime, res.Frames[0].Fields[2].Type()) - }) - }) t.Run("GraphQL", func(t *testing.T) { t.Run("should parse the response and send results", func(t *testing.T) { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { diff --git a/src/app/parsers/JSONParser.ts b/src/app/parsers/JSONParser.ts index 1bdacd2b0..602525beb 100644 --- a/src/app/parsers/JSONParser.ts +++ b/src/app/parsers/JSONParser.ts @@ -8,7 +8,7 @@ export class JSONParser extends InfinityParser res && res.columns; export const isDataFrame = (res: any): res is DataFrame => res && res.fields; @@ -33,6 +43,24 @@ export const isDataQuery = (query: InfinityQuery): query is InfinityQueryWithDat return false; } }; + +// We have to have query: unknown here as InfinityQuery and InfinityQueryWithURLSource are not compatible according to TypeScript +export const isInfinityQueryWithUrlSource = (query: unknown): query is InfinityQueryWithURLSource => { + // We do a basic check to ensure that query is an object and has a type property + if (!query || typeof query !== 'object' || !('type' in query)) { + return false; + } + + // we check if the query is a data query or has suitable type + if (isDataQuery(query as InfinityQuery) || query.type === 'uql' || query.type === 'groq') { + // It needs to have a source property and it should be 'url' + if ('source' in query) { + return query.source === 'url'; + } + } + + return false; +}; export const toTimeSeriesLong = (data: DataFrame[]): DataFrame[] => { if (!Array.isArray(data) || data.length === 0) { return data; diff --git a/src/components/JSONOptionsEditor.tsx b/src/components/JSONOptionsEditor.tsx index 773f12839..44eb1b38d 100644 --- a/src/components/JSONOptionsEditor.tsx +++ b/src/components/JSONOptionsEditor.tsx @@ -8,7 +8,7 @@ export const JSONOptionsEditor = (props: { query: InfinityQuery; onChange: (valu if (query.type !== 'json') { return <>; } - if (query.parser === 'backend' || query.parser === 'uql' || query.parser === 'groq' || query.parser === 'sqlite') { + if (query.parser === 'backend' || query.parser === 'uql' || query.parser === 'groq') { return <>; } const { json_options = {} } = query; diff --git a/src/datasource.ts b/src/datasource.ts index 1cfd39ba7..4242e23eb 100644 --- a/src/datasource.ts +++ b/src/datasource.ts @@ -157,8 +157,6 @@ export class Datasource extends DataSourceWithBackend { diff --git a/src/editors/query/components/ParserType.tsx b/src/editors/query/components/ParserType.tsx index 7881b6afe..ef793f5a7 100644 --- a/src/editors/query/components/ParserType.tsx +++ b/src/editors/query/components/ParserType.tsx @@ -47,7 +47,6 @@ export const ParseTypeEditor = (props: { query: InfinityQuery; onChange: (value: options={[ { value: 'simple', label: 'Default' }, { value: 'backend', label: 'Backend' }, - // { value: 'sqlite', label: 'SQLite' }, { value: 'uql', label: 'UQL' }, { value: 'groq', label: 'GROQ' }, ]} @@ -58,9 +57,6 @@ export const ParseTypeEditor = (props: { query: InfinityQuery; onChange: (value: } else if (query.parser === 'groq') { let groq = query.groq || '*'; onChange({ ...query, parser: e.value, groq }); - } else if (query.parser === 'sqlite') { - let sqlite_query = query.sqlite_query || 'SELECT * FROM input'; - onChange({ ...query, parser: e.value, sqlite_query }); } else { onChange({ ...query, parser: e.value }); } diff --git a/src/editors/query/query.columns.editor.tsx b/src/editors/query/query.columns.editor.tsx index bf312eb16..33ba86bff 100644 --- a/src/editors/query/query.columns.editor.tsx +++ b/src/editors/query/query.columns.editor.tsx @@ -9,7 +9,6 @@ import { JSONOptionsEditor } from '../../components/JSONOptionsEditor'; import { CSVOptionsEditor } from '../../components/CSVOptionsEditor'; import { UQLEditor } from './query.uql'; import { GROQEditor } from './query.groq'; -import { SQLiteEditor } from './query.sqlite'; import type { InfinityColumn, InfinityQuery } from './../../types'; export const QueryColumnsEditor = (props: { query: InfinityQuery; onChange: (value: any) => void; onRunQuery: () => void }) => { @@ -49,9 +48,6 @@ export const QueryColumnsEditor = (props: { query: InfinityQuery; onChange: (val if (query.parser === 'groq') { return 'GROQ Query'; } - if (query.parser === 'sqlite') { - return 'SQLite Query'; - } return `Field types, alias and selectors`; default: return 'Field types and alias'; @@ -62,8 +58,6 @@ export const QueryColumnsEditor = (props: { query: InfinityQuery; onChange: (val ) : (query.type === 'json' || query.type === 'graphql') && query.parser === 'groq' ? ( - ) : query.type === 'json' && query.parser === 'sqlite' ? ( - ) : ( <> diff --git a/src/editors/query/query.options.tsx b/src/editors/query/query.options.tsx index c0e6d68e2..7000bb998 100644 --- a/src/editors/query/query.options.tsx +++ b/src/editors/query/query.options.tsx @@ -11,8 +11,8 @@ import { ParseTypeEditor } from './components/ParserType'; import { GoogleSheetsEditor } from './components/GoogleSheets'; import { URL, Method } from './query.url'; import { Datasource } from './../../datasource'; -import { isDataQuery } from './../../app/utils'; -import type { EditorMode, InfinityQuery } from '../../types'; +import { isDataQuery, isInfinityQueryWithUrlSource } from './../../app/utils'; +import type { EditorMode, InfinityQuery, InfinityQueryType, InfinityQueryWithURLSource } from '../../types'; export const BasicOptions = (props: { mode: EditorMode; @@ -59,10 +59,10 @@ export const BasicOptions = (props: { Github - {isDataQuery(query) && query.source === 'url' && ( + {isInfinityQueryWithUrlSource(query) && ( - + } onChange={onChange} onRunQuery={onRunQuery} onShowUrlOptions={onShowUrlOptions} />