Skip to content

Commit b5b8884

Browse files
Improve redirect to Kamon APM
Do a best guess for which integration we're using to toggle the upcoming "continue onboarding" flow where the service name and the correct framework/lib (best we can tell) are pre-filled and the user just has to copy-paste their configuration or API key.
1 parent d44a9c1 commit b5b8884

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

core/kamon-status-page/src/main/vue/src/components/ModuleList.vue

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
:key="reporter.name"
2222
:module="reporter"
2323
:is-missing-key="isMisconfiguredApmModule(reporter)"
24+
@show:api-key="$emit('show:api-key')"
2425
/>
2526
<div v-if="!hasApmModule" class="apm-suggestion">
2627
<a href="https://kamon.io/apm/?utm_source=kamon&utm_medium=status-page&utm_campaign=kamon-status" target="_blank">

core/kamon-status-page/src/main/vue/src/components/ModuleStatusCard.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export default class ModuleStatusCard extends Vue {
101101
}
102102
103103
public showApmApiKey() {
104-
window.open('https://apm.kamon.io?envinfo=show')
104+
this.$emit('show:api-key')
105105
}
106106
}
107107
</script>

core/kamon-status-page/src/main/vue/src/views/Overview.vue

+27-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</v-col>
1717

1818
<v-col cols="12" class="js-reporters">
19-
<module-list :config="config" :modules="modules"/>
19+
<module-list :config="config" :modules="modules" @show:api-key="showApmApiKey" />
2020
</v-col>
2121

2222
<v-col cols="12" class="js-instrumentation">
@@ -111,6 +111,28 @@ export default class Overview extends Vue {
111111
return this.settings.map(s => s.config)
112112
}
113113
114+
get redirectInfo() {
115+
const serviceName = this.config.map(c => c?.kamon?.environment?.service).orNull
116+
const usedInstrumentation = this.instrumentationModules.filter(m => m.enabled && m.active)
117+
const framework = (() => {
118+
if (usedInstrumentation.some(i => i.name.toLocaleLowerCase().includes('play'))) {
119+
return 'play'
120+
} else if (usedInstrumentation.some(i => i.name.toLocaleLowerCase().includes('akka'))) {
121+
return 'akka'
122+
} else if (usedInstrumentation.some(i => i.name.toLocaleLowerCase().includes('spring'))) {
123+
return 'spring'
124+
} else {
125+
return 'plain'
126+
}
127+
})()
128+
const query = new URLSearchParams()
129+
130+
query.set('continueOnboarding', 'true')
131+
query.set('framework', framework)
132+
query.set('serviceName', serviceName)
133+
return `https://apm.kamon.io?${query.toString()}`
134+
}
135+
114136
public mounted() {
115137
this.refreshData()
116138
}
@@ -127,6 +149,10 @@ export default class Overview extends Vue {
127149
this.$vuetify.goTo('.js-metrics')
128150
}
129151
152+
private showApmApiKey() {
153+
window.open(this.redirectInfo)
154+
}
155+
130156
private refreshData(): void {
131157
StatusApi.settings().then(settings => { this.settings = some(settings) })
132158
StatusApi.metricRegistryStatus().then(metricRegistry => { this.metricRegistry = some(metricRegistry) })

0 commit comments

Comments
 (0)