Setting up projects & SDKs for Sentry self-hosted

Entrepreneurial Developer
Search for a command to run...

Entrepreneurial Developer
where i have to Installing dependency if I use docker compose. I have a lot of container
Sentry is an open-source full-stack error tracking system which supports a wide range of platforms. Sentry is a paid service that offers a lot of features but it also offers a free plan for developers with limited events and features. The free plan i...
This blog is the fourth post in the Sentry self-hosted series. We will set up the mail configuration for your Sentry self-hosted instance in this post. This post will assume you already went over the previous posts in the series to set up the Sentry ...

This blog is the third post in the Sentry self-hosted series. You will set up the NGINX configuration for your Sentry self-hosted instance in this post. This post will assume you already went over the previous post that explains how to set up your cu...

Part 2 of the Sentry self-hosted series

Sentry is an open-source full-stack error tracking system which supports a wide range of platforms. Sentry is a paid service that offers a lot of features but it also offers a free plan for developers with limited events and features. The free plan i...

This blog is the 5th post in the Sentry self-hosted series. In this article, we will be going through the process of creating a project with Sentry to track and monitor performance and errors. This post will assume you already went over the previous posts in the series to set up Sentry.
The first thing you need to do is create a project on sentry. To do that head to your Sentry self-hosted domain and click on the projects in the side menu: 
Choose the needed SDK from the list of platforms

Add a project name and select the team (you can also create a new team)

Click on create project.
After creating, it will redirect you to a setup page where they have a tutorial on how to set it up. Follow the instructions and you should be good to go
I will setup Vue.js as an example, others should be similar (but platform specific):
# Using yarn
yarn add @sentry/vue @sentry/tracing
# Using npm
npm install --save @sentry/vue @sentry/tracing
import Vue from "vue";
import Router from "vue-router";
import * as Sentry from "@sentry/vue";
import { BrowserTracing } from "@sentry/tracing";
Vue.use(Router);
const router = new Router({
// ...
});
Sentry.init({
Vue,
dsn: "dsn_to_your_instance",
integrations: [
new BrowserTracing({
routingInstrumentation: Sentry.vueRouterInstrumentation(router),
tracingOrigins: ["localhost", "my-site-url.com", /^\//],
}),
],
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
tracesSampleRate: 1.0,
});
// ...
new Vue({
router,
render: h => h(App),
}).$mount("#app");
import { createApp } from "vue";
import { createRouter } from "vue-router";
import * as Sentry from "@sentry/vue";
import { BrowserTracing } from "@sentry/tracing";
const app = createApp({
// ...
});
const router = createRouter({
// ...
});
Sentry.init({
app,
dsn: "dsn_to_your_instance",
integrations: [
new BrowserTracing({
routingInstrumentation: Sentry.vueRouterInstrumentation(router),
tracingOrigins: ["localhost", "my-site-url.com", /^\//],
}),
],
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
tracesSampleRate: 1.0,
});
app.use(router);
app.mount("#app");
A few things to note that must be changed:
After changing the above fields, your Sentry SDK should start sending usage analytics back to your Sentry self-hosted instance. (it might take a few mins for data to start appearing).
As usual, if you have any questions don't hesitate to DM me or ask it in the comments.
Good Luck!