Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
JeSappelleRoot opened this issue Feb 23, 2022 · 3 comments

Comments

@JeSappelleRoot
Copy link

JeSappelleRoot commented Feb 23, 2022

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

@JeSappelleRoot JeSappelleRoot changed the title Sentry plugin - Variable value in dashboard Sentry plugin - Variable value in dashboard report an HTTP 400 "Invalid project parameter" Feb 23, 2022
@tolzhabayev
Copy link

Ping @grafana/observability-logs-and-traces

@joey-grafana
Copy link
Contributor

joey-grafana commented Feb 24, 2022

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.

@JeSappelleRoot
Copy link
Author

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

@yesoreyeram yesoreyeram transferred this issue from grafana/grafana Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants