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

fix(query-service): skip preloading non-json files under dashboards #6979

Merged
merged 3 commits into from
Jan 31, 2025

Conversation

prashant-shahi
Copy link
Member

@prashant-shahi prashant-shahi commented Jan 30, 2025

Summary

  • query-service: skip preloading non-json files under dashboards

Resolves the error log:

{"level":"INFO","timestamp":"2025-01-29T17:37:18.635Z","caller":"dashboards/provision.go:26","msg":"Provisioning dashboard: ","filename":".gitkeep"}
{"level":"ERROR","timestamp":"2025-01-29T17:37:18.635Z","caller":"dashboards/provision.go:38","msg":"Creating Dashboards: Error in unmarshalling json from file","filename":".gitkeep","error":"unexpected end of JSON input","stacktrace":"go.signoz.io/signoz/pkg/query-service/app/dashboards.readCurrentDir\n\t/home/sa_100696978840572610735/signoz/pkg/query-service/app/dashboards/provision.go:38\ngo.signoz.io/signoz/pkg/query-service/app/dashboards.LoadDashboardFiles\n\t/home/sa_100696978840572610735/signoz/pkg/query-service/app/dashboards/provision.go:79\ngo.signoz.io/signoz/pkg/query-service/app.NewAPIHandler\n\t/home/sa_100696978840572610735/signoz/pkg/query-service/app/http_handler.go:271\ngo.signoz.io/signoz/ee/query-service/app/api.NewAPIHandler\n\t/home/sa_100696978840572610735/signoz/ee/query-service/app/api/api.go:56\ngo.signoz.io/signoz/ee/query-service/app.NewServer\n\t/home/sa_100696978840572610735/signoz/ee/query-service/app/server.go:287\nmain.main\n\t/home/sa_100696978840572610735/signoz/ee/query-service/main.go:191\nruntime.main\n\t/home/sa_100696978840572610735/go/pkg/mod/golang.org/[email protected]/src/runtime/proc.go:271"}

Related Issues / PR's

NA

Screenshots

NA

Affected Areas and Manually Tested Areas


Important

Skip non-JSON files during dashboard preloading in readCurrentDir function of provision.go.

  • Behavior:
    • In readCurrentDir function in provision.go, skip files that do not have a .json extension when preloading dashboards.
    • Log a debug message for each skipped non-JSON file.
  • Logging:
    • Add debug log for skipped non-JSON files in readCurrentDir.

This description was created by Ellipsis for 1aaf4fd. It will automatically update as commits are pushed.

@github-actions github-actions bot added the bug Something isn't working label Jan 30, 2025
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Reviewed everything up to 1aaf4fd in 28 seconds

More details
  • Looked at 23 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. pkg/query-service/app/dashboards/provision.go:24
  • Draft comment:
    The error from file.Readdirnames(0) is ignored. Consider handling this error to avoid potential issues if reading directory names fails.
  • Reason this comment was not posted:
    Comment was on unchanged code.
2. pkg/query-service/app/dashboards/provision.go:27
  • Draft comment:
    Avoid using inline styles in React components. Instead, use external stylesheets, CSS classes, or styled components. This comment applies to the use of inline styles in the code.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The code is well-structured and follows the rules provided. However, there is a minor issue with the use of inline styles in React components, which should be avoided.

Workflow ID: wflow_ewAusl1pIeh0tD97


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@prashant-shahi prashant-shahi enabled auto-merge (squash) January 31, 2025 13:02
@prashant-shahi prashant-shahi merged commit c6fda99 into main Jan 31, 2025
16 checks passed
@prashant-shahi prashant-shahi deleted the fix/skip-non-json-dashboards branch January 31, 2025 13:09
SagarRajput-7 pushed a commit that referenced this pull request Feb 10, 2025
…6979)

### Summary

- query-service: skip preloading non-json files under dashboards

Resolves the error log:

```
{"level":"INFO","timestamp":"2025-01-29T17:37:18.635Z","caller":"dashboards/provision.go:26","msg":"Provisioning dashboard: ","filename":".gitkeep"}
{"level":"ERROR","timestamp":"2025-01-29T17:37:18.635Z","caller":"dashboards/provision.go:38","msg":"Creating Dashboards: Error in unmarshalling json from file","filename":".gitkeep","error":"unexpected end of JSON input","stacktrace":"go.signoz.io/signoz/pkg/query-service/app/dashboards.readCurrentDir\n\t/home/sa_100696978840572610735/signoz/pkg/query-service/app/dashboards/provision.go:38\ngo.signoz.io/signoz/pkg/query-service/app/dashboards.LoadDashboardFiles\n\t/home/sa_100696978840572610735/signoz/pkg/query-service/app/dashboards/provision.go:79\ngo.signoz.io/signoz/pkg/query-service/app.NewAPIHandler\n\t/home/sa_100696978840572610735/signoz/pkg/query-service/app/http_handler.go:271\ngo.signoz.io/signoz/ee/query-service/app/api.NewAPIHandler\n\t/home/sa_100696978840572610735/signoz/ee/query-service/app/api/api.go:56\ngo.signoz.io/signoz/ee/query-service/app.NewServer\n\t/home/sa_100696978840572610735/signoz/ee/query-service/app/server.go:287\nmain.main\n\t/home/sa_100696978840572610735/signoz/ee/query-service/main.go:191\nruntime.main\n\t/home/sa_100696978840572610735/go/pkg/mod/golang.org/[email protected]/src/runtime/proc.go:271"}
```

Signed-off-by: Prashant Shahi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants