Java and Kotlin

Install com.github.blipit-io:blipit-java

The blipit-java library is served by JitPack straight from GitHub. Add the repository and the dependency, then call Blipit.init once at startup with your project's public key and project id.

1Add the repository and dependency

build.gradle.kts
repositories {
    mavenCentral()
    maven("https://jitpack.io")
}

dependencies {
    implementation("com.github.blipit-io:blipit-java:v0.1.0")
}
pom.xml
<repositories>
  <repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
  </repository>
</repositories>

<dependency>
  <groupId>com.github.blipit-io</groupId>
  <artifactId>blipit-java</artifactId>
  <version>v0.1.0</version>
</dependency>

2Initialise at startup

Spring Boot: at the top of main, before SpringApplication.run, or in a @PostConstruct method of a @Configuration class.

java
import io.blipit.Blipit;
import io.blipit.BlipitOptions;

Blipit.init(BlipitOptions.builder()
    .key("<public key>")
    .project(<project id>)
    .environment("production")
    .release("myapp@1.4.2")
    .build());

3Manual capture and login attempts

java
Blipit.captureException(err);
Blipit.captureMessage("cache miss rate above 50%");
Blipit.setUser("42", "ana@example.com");
Blipit.captureSecurity("login_failed", email, "bad_password", null, ip, userAgent, null);

4Check it works

Open Issues in app.blipit.io. The first event appears within a few seconds, grouped into an issue, and the people in charge get an email.

java
Blipit.captureMessage("Hello from Java");

Good to know

  • Kotlin uses the same calls.
  • tracesSampleRate(0.2) in the builder sends requests to the Performance page.
  • Already on the io.sentry SDK? It works unchanged with the DSN https://<public key>@in.blipit.io/<project id>.

Stuck? Email support@blipit.io. Keys and the exact DSN for each project are under API keys in app.blipit.io.