Skip to content

Commit

Permalink
feat: add application version to newrelic
Browse files Browse the repository at this point in the history
  • Loading branch information
qin-guan committed Feb 3, 2024
1 parent 5de7b4d commit b230e31
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plugins/new-relic.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BrowserAgent } from '@newrelic/browser-agent/loaders/browser-agent'

export default defineNuxtPlugin(() => {
const appConfig = useAppConfig()
const { public: config } = useRuntimeConfig()

const options = {
Expand All @@ -10,6 +11,7 @@ export default defineNuxtPlugin(() => {
}

const newrelic = new BrowserAgent(options)
newrelic.setApplicationVersion(`${appConfig.buildInfo.version}-${appConfig.buildInfo.commit}`)

return {
provide: {
Expand Down

0 comments on commit b230e31

Please # to comment.