Skip to content

Commit

Permalink
Merge pull request #1001 from amvanbaren/unpkg-endpoint-metrics
Browse files Browse the repository at this point in the history
Add counter to unpkg endpoint
  • Loading branch information
amvanbaren authored Sep 27, 2024
2 parents 7e29166 + d956e1e commit 3c1f632
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 3c1f632

Please sign in to comment.