Skip to content

Commit 6593817

Browse files
committed
add job uuid and bump to v7
1 parent e8911e9 commit 6593817

File tree

7 files changed

+22
-10
lines changed

7 files changed

+22
-10
lines changed

badges/coverage.svg

Lines changed: 1 addition & 1 deletion
Loading

dist/index.js

Lines changed: 7 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
"package:watch": "npm run package -- --watch",
4242
"test": "NODE_OPTIONS=--experimental-vm-modules NODE_NO_WARNINGS=1 npx jest",
4343
"all": "npm run format:write && npm run lint && npm run test && npm run coverage && npm run package",
44-
"typecheck": "tsc --noEmit"
44+
"typecheck": "tsc --noEmit",
45+
"test:update:snapshot": "NODE_OPTIONS=--experimental-vm-modules NODE_NO_WARNINGS=1 npx jest --updateSnapshot"
4546
},
4647
"license": "MIT",
4748
"dependencies": {

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export async function run(): Promise<void> {
100100

101101
const metricsNamespace = core.getInput('metrics-namespace') || 'cae'
102102

103-
const metricsVersion = core.getInput('metrics-version') || 'v6'
103+
const metricsVersion = core.getInput('metrics-version') || 'v7'
104104

105105
const config: TMetricsConfig = {
106106
serviceName,

src/metrics-generator.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,12 @@ describe('generateMetrics', () => {
228228
'vcs.repository.name': expect.any(String),
229229
'vcs.repository.ref.name': expect.any(String),
230230
'vcs.repository.ref.revision': expect.any(String),
231-
'ci.build.id': expect.any(String)
231+
'ci.run.id': expect.any(String)
232232
},
233233
`
234234
{
235-
"ci.build.id": Any<String>,
235+
"ci.job.id": "job-456",
236+
"ci.run.id": Any<String>,
236237
"deployment.environment": Any<String>,
237238
"service.name": Any<String>,
238239
"service.version": Any<String>,

src/metrics-generator.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,13 @@ const getBaseAttributes = (
186186
if (config.branch) attributes['vcs.repository.ref.name'] = config.branch
187187
if (config.commitSha)
188188
attributes['vcs.repository.ref.revision'] = config.commitSha
189-
if (config.runId) attributes['ci.build.id'] = config.runId
189+
if (config.runId) {
190+
attributes['ci.run.id'] = config.runId
191+
}
192+
193+
if (config.jobUUID) {
194+
attributes['ci.job.id'] = config.jobUUID
195+
}
190196

191197
return attributes
192198
}

0 commit comments

Comments
 (0)