Skip to content

Commit

Permalink
more metrics keys + docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nvuillam committed Aug 16, 2024
1 parent 7591e2c commit 957c347
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/reporters/ApiReporter.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ API_REPORTER_METRICS_BASIC_AUTH_PASSWORD=GHTRGDHDHdhghg23345DFG^sfg!ss
Example of metrics sent to Prometheus

```text
TODO
spectral,source=MegaLinter,orgIdentifier=alpha,gitIdentifier=megalinter/alpha,descriptor=API,linter=spectral,linterKey=API_SPECTRAL metric=0,numberFilesFound=1,elapsedTime=1.57
shellcheck,source=MegaLinter,orgIdentifier=alpha,gitIdentifier=megalinter/alpha,descriptor=BASH,linter=shellcheck,linterKey=BASH_SHELLCHECK metric=0,numberFilesFound=5,elapsedTime=0.13
markdownlint,source=MegaLinter,orgIdentifier=alpha,gitIdentifier=megalinter/alpha,descriptor=MARKDOWN,linter=markdownlint,linterKey=MARKDOWN_MARKDOWNLINT metric=291,numberFilesFound=264,numberErrorsFixed=0,elapsedTime=31.5
```

## Troubleshooting
Expand Down
3 changes: 3 additions & 0 deletions megalinter/reporters/ApiReporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ def build_metrics_payload(self):
f"source={self.payload["source"]},"
+ f"orgIdentifier={self.payload["orgIdentifier"]},"
+ f"gitIdentifier={self.payload["gitIdentifier"]},"
+ f"gitIdentifier={self.payload["gitIdentifier"]},"
+ f"gitRepoName={self.payload["gitRepoName"]},"
+ f"gitBranchName={self.payload["gitBranchName"]},"
)
all_metrics_lines = []
for linter in self.master.linters:
Expand Down

0 comments on commit 957c347

Please sign in to comment.