Skip to content

Commit

Permalink
Add counter to unpkg endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
amvanbaren committed Sep 27, 2024
1 parent 7e29166 commit d956e1e
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,15 @@ public ResponseEntity<byte[]> browse(String namespaceName, String extensionName,

var extension = extVersion.getExtension();
var namespace = extension.getNamespace();

Metrics.counter("vscode.unpkg", List.of(
Tag.of("namespace", namespace.getName()),
Tag.of("extension", extension.getName()),
Tag.of("version", extVersion.getVersion()),
Tag.of("file", String.valueOf(exactMatch != null)),
Tag.of("path", path)
)).increment();

return exactMatch != null
? browseFile(exactMatch, extVersion)
: browseDirectory(resources, namespace.getName(), extension.getName(), extVersion.getVersion(), path);
Expand Down

0 comments on commit d956e1e

Please sign in to comment.