-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #195 from coroot/agent_installation
setup: guidance on installing node-agent as a Systemd service or Docker container
- Loading branch information
Showing
8 changed files
with
248 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<template> | ||
<div class="code"> | ||
<v-btn icon small dark class="copy" @click="copy" :disabled="disabled"> | ||
<v-icon small>{{ icon }}</v-icon> | ||
</v-btn> | ||
<div ref="body"> | ||
<slot></slot> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: { | ||
disabled: Boolean, | ||
}, | ||
data() { | ||
return { | ||
copied: false, | ||
}; | ||
}, | ||
computed: { | ||
icon() { | ||
return this.copied ? 'mdi-check' : 'mdi-content-copy'; | ||
}, | ||
}, | ||
methods: { | ||
copy() { | ||
navigator.clipboard.writeText(this.$refs.body.innerText.trim()); | ||
this.copied = true; | ||
setTimeout(() => { | ||
this.copied = false; | ||
}, 1000); | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
.code { | ||
position: relative; | ||
margin-bottom: 12px; | ||
} | ||
.code:deep(pre) { | ||
font-family: monospace, monospace; | ||
font-size: 14px; | ||
display: block; | ||
overflow-x: auto; | ||
padding: 20px 20px 0 20px; | ||
background: #282a36; | ||
border-radius: 4px; | ||
color: var(--text-dark); | ||
} | ||
.copy { | ||
position: absolute; | ||
top: 10px; | ||
right: 10px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
<template> | ||
<v-dialog v-model="dialog"> | ||
<template #activator="{ on, attrs }"> | ||
<v-btn :color="color" :outlined="outlined" :small="small" v-bind="attrs" v-on="on"> | ||
<slot></slot> | ||
</v-btn> | ||
</template> | ||
<v-card class="pa-5"> | ||
<div class="d-flex align-center text-h5 mb-4"> | ||
Node agent installation | ||
<v-spacer /> | ||
<v-btn icon @click="dialog = false"><v-icon>mdi-close</v-icon></v-btn> | ||
</div> | ||
<p> | ||
<a href="https://github.com/coroot/coroot-node-agent" target="_blank">Coroot-node-agent</a> gathers metrics, traces, logs, and | ||
profiles, and sends them to Coroot. To ingest telemetry data, the agent must have the address of the Coroot instance and the | ||
capability to establish TCP connections with it. | ||
</p> | ||
<div class="subtitle-1">Coroot URL:</div> | ||
<v-form v-model="valid"> | ||
<v-text-field | ||
v-model="coroot_url" | ||
:rules="[$validators.notEmpty, $validators.isUrl]" | ||
placeholder="http://coroot:8080" | ||
outlined | ||
dense | ||
/> | ||
</v-form> | ||
|
||
<v-tabs v-model="tab" height="40" slider-size="2" class="mb-4"> | ||
<v-tab><v-icon class="mr-1">mdi-memory</v-icon>Linux node (Systemd)</v-tab> | ||
<v-tab><v-icon class="mr-1">mdi-docker</v-icon>Docker</v-tab> | ||
<v-tab><v-icon class="mr-1">mdi-kubernetes</v-icon>Kubernetes</v-tab> | ||
</v-tabs> | ||
<v-tabs-items v-model="tab"> | ||
<v-tab-item transition="none"> | ||
<p> | ||
This script downloads the latest version of the agent and installs it as a Systemd service. Additionally, it generates an | ||
uninstall script. | ||
</p> | ||
<Code :disabled="!valid"> | ||
<pre> | ||
curl -sfL https://raw.githubusercontent.com/coroot/coroot-node-agent/main/install.sh | \ | ||
COLLECTOR_ENDPOINT={{ coroot_url }} \ | ||
API_KEY={{ apiKey }} \ | ||
SCRAPE_INTERVAL={{ scrape_interval }} \ | ||
sh - | ||
</pre> | ||
</Code> | ||
<p>You can read the agent log using the <var>journalctl</var> command:</p> | ||
<Code> | ||
<pre> | ||
sudo journalctl -u coroot-node-agent | ||
</pre> | ||
</Code> | ||
<p>To uninstall the agent run the command below:</p> | ||
<Code> | ||
<pre> | ||
/usr/bin/coroot-node-agent-uninstall.sh | ||
</pre> | ||
</Code> | ||
</v-tab-item> | ||
|
||
<v-tab-item transition="none"> | ||
<Code :disabled="!valid"> | ||
<pre> | ||
docker run --detach --name coroot-node-agent \ | ||
--pull=always \ | ||
--privileged --pid host \ | ||
-v /sys/kernel/debug:/sys/kernel/debug:rw \ | ||
-v /sys/fs/cgroup:/host/sys/fs/cgroup:ro \ | ||
ghcr.io/coroot/coroot-node-agent:latest \ | ||
--cgroupfs-root=/host/sys/fs/cgroup \ | ||
--collector-endpoint={{ coroot_url }} \ | ||
--api-key={{ apiKey }} \ | ||
--scrape-interval={{ scrape_interval }} | ||
</pre> | ||
</Code> | ||
<p>To read the agent log:</p> | ||
<Code> | ||
<pre> | ||
docker logs coroot-node-agent | ||
</pre> | ||
</Code> | ||
<p>To uninstall the agent run the command below:</p> | ||
<Code> | ||
<pre> | ||
docker rm -f coroot-node-agent | ||
</pre> | ||
</Code> | ||
</v-tab-item> | ||
<v-tab-item transition="none"> | ||
<p> | ||
To integrate Coroot with a Kubernetes cluster, simply install a dedicated Coroot instance using the official Helm chart. It | ||
automatically includes a DaemonSet, ensuring the agent is installed on new cluster nodes without manual intervention. | ||
</p> | ||
<p> | ||
To learn more about how to use Coroot's Helm chart, refer to the | ||
<a href="https://coroot.com/docs/coroot-community-edition/getting-started/installation" target="_blank">documentation</a>. | ||
</p> | ||
</v-tab-item> | ||
</v-tabs-items> | ||
</v-card> | ||
</v-dialog> | ||
</template> | ||
|
||
<script> | ||
import Code from '../components/Code.vue'; | ||
export default { | ||
props: { | ||
color: String, | ||
outlined: Boolean, | ||
small: Boolean, | ||
}, | ||
components: { Code }, | ||
data() { | ||
return { | ||
dialog: false, | ||
tab: null, | ||
coroot_url: '', | ||
scrape_interval: '15s', | ||
valid: false, | ||
}; | ||
}, | ||
computed: { | ||
apiKey() { | ||
return this.$route.params.projectId; | ||
}, | ||
}, | ||
mounted() { | ||
this.get(); | ||
}, | ||
methods: { | ||
get() { | ||
this.$api.getIntegrations('prometheus', (data, error) => { | ||
if (error) { | ||
return; | ||
} | ||
if (data.refresh_interval) { | ||
this.scrape_interval = data.refresh_interval / 1000 + 's'; | ||
} | ||
}); | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters