grafana/sentry-datasource

Sentry plugin - Variable value in dashboard report an HTTP 400 "Invalid project parameter"

Closed this issue · 3 comments

What happened:

I'm trying to use variable to define project name on my Sentry dashboard as referenced on the documentation of the plugin
https://grafana.com/grafana/plugins/grafana-sentry-datasource/

What you expected to happen: Filter error with the project name from the defined variable

How to reproduce it (as minimally and precisely as possible):
Add Sentry as datasource and use variable as project filter with the following parameters :
Query type : Stats
Project : your variable name (from the drop-down menu)
Field : sum(quantity)
Category filter : error

Anything else we need to know?:

Sentry Grafana integration is based on the following documentation https://grafana.com/grafana/plugins/grafana-sentry-datasource/
Also, permissions on Sentry end are the following :
Project : read
Team : no access
Release : no access
Issue & Event : read
Organization : read
Member : no access

Environment:

  • Grafana version: 8.4.0
  • Data source type & version: Sentry plugin
  • OS Grafana is installed on: Ubuntu 20.04
  • User OS & Browser: Firefox 96
  • Grafana plugins: Sentry
  • Others:

When I'm performing filtering with drop down menu, here the JSON

From query inspector without variable

{
  "request": {
    "url": "api/ds/query",
    "method": "POST",
    "data": {
      "queries": [
        {
          "datasource": {
            "uid": "lcd6BkB7k",
            "type": "grafana-sentry-datasource"
          },
          "environments": [],
          "hide": false,
          "projectIds": [
            "10"
          ],

As you can see, projectIds is set to 10, which is the right value on Sentry side for the project (from the URL e.g)

From query inspector with variable

{
  "request": {
    "url": "api/ds/query",
    "method": "POST",
    "data": {
      "queries": [
        {
          "datasource": {
            "uid": "lcd6BkB7k",
            "type": "grafana-sentry-datasource"
          },
          "environments": [],
          "hide": false,
          "projectIds": [
            "${sentry_project}"
          ],

As you can see, with variable from dashboard, the syntax is correct but I have the following result
"error": "400 Bad Request Invalid project parameter. Values must be numbers."
The variable seems correct according to the documentation

I also tried to replace project name with an integer as value but no luck with the following variable configuration :
Variable type : custom
Values separated by comma : my-project:10

Some help will be appreciated

Ping @grafana/observability-logs-and-traces

Thank you for your report.

After investigating the issue further, I can see that we are not currently interpolating variables when used in the Projects field. This is a known issue, and we have an issue already in the Sentry datasource repo to address this.

I'm closing this issue in favour of the issue in the Sentry datasource repo.

Thanks for the mention on the other ticket @joey-grafana 👍