Skip to content

Commit e73cfba

Browse files
committed
set owner and repo tags
1 parent 7389411 commit e73cfba

File tree

1 file changed

+16
-4
lines changed
  • packages/bundler-plugin-core/src/utils

1 file changed

+16
-4
lines changed

packages/bundler-plugin-core/src/utils/Output.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ class Output {
163163
const inputs: ProviderUtilInputs = { envs, args };
164164

165165
const provider = await startSpan(
166-
{ name: "detectProvider", scope: this.sentryScope },
166+
{ name: "output.write.detectProvider", scope: this.sentryScope },
167167
async () => {
168168
let detectedProvider;
169169
try {
@@ -202,12 +202,24 @@ class Output {
202202
if (!provider) return;
203203

204204
if (this.sentryScope) {
205-
this.sentryScope.setTag("provider.service", provider.service);
205+
this.sentryScope.setTag("service", provider.service);
206+
207+
const slug = provider.slug ?? "";
208+
const repoIndex = slug.lastIndexOf("/") + 1;
209+
const owner = slug.substring(0, repoIndex).trimEnd();
210+
if (owner.length > 0) {
211+
this.sentryScope.setTag("owner", owner);
212+
}
213+
214+
const repo = slug.substring(repoIndex, slug.length);
215+
if (repo.length > 0) {
216+
this.sentryScope.setTag("repo", repo);
217+
}
206218
}
207219

208220
let url = "";
209221
await startSpan(
210-
{ name: "getPreSignedURL", scope: this.sentryScope },
222+
{ name: "output.write.getPreSignedURL", scope: this.sentryScope },
211223
async () => {
212224
try {
213225
url = await getPreSignedURL({
@@ -248,7 +260,7 @@ class Output {
248260
);
249261

250262
await startSpan(
251-
{ name: "uploadStats", scope: this.sentryScope },
263+
{ name: "output.write.uploadStats", scope: this.sentryScope },
252264
async () => {
253265
try {
254266
await uploadStats({

0 commit comments

Comments
 (0)