Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

feat: add Sonar analysis to build pipeline (#324)

Adam Szatyin6f4327bfa17d
diff --git a/.github/workflows/README.md b/.github/workflows/README.md
index 6486823672..c596e08d91 100644
--- a/.github/workflows/README.md
+++ b/.github/workflows/README.md
@@ -23,3 +23,8 @@ To run GitHub workflow, a few environment variables needs to add in GitHub secre
<td> Docker hub password/token with push permission </td>
<td> **** </td>
</tr>
+ <tr>
+ <td> SONAR_TOKEN </td>
+ <td> <a href="https://sonarcloud.io">SonarCloud</a> token </td>
+ <td> **** </td>
+ </tr>
diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml
new file mode 100644
index 0000000000..751b9053f2
--- /dev/null
+++ b/.github/workflows/sonar.yml
@@ -0,0 +1,27 @@
+name: sonar
+on:
+ pull_request:
+ branches:
+ - main
+ - v*
+ paths:
+ - 'frontend/**'
+defaults:
+ run:
+ working-directory: frontend
+jobs:
+ sonar-analysis:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+ - name: Sonar analysis
+ uses: sonarsource/sonarcloud-github-action@master
+ with:
+ projectBaseDir: frontend
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
+
\ No newline at end of file
diff --git a/frontend/sonar-project.properties b/frontend/sonar-project.properties
new file mode 100644
index 0000000000..a70ba95421
--- /dev/null
+++ b/frontend/sonar-project.properties
@@ -0,0 +1,6 @@
+sonar.organization=szatyinadam
+sonar.projectKey=szatyinadam_signoz
+
+# relative paths to source directories. More details and properties are described
+# in https://sonarcloud.io/documentation/project-administration/narrowing-the-focus/
+sonar.sources=./src
\ No newline at end of file