157 lines
4.3 KiB
Markdown
157 lines
4.3 KiB
Markdown
<p align="center">
|
|
<a href="https://irontelemetry.com">
|
|
<img src="https://irontelemetry.com/logo.png" alt="IronTelemetry" width="120" />
|
|
</a>
|
|
</p>
|
|
|
|
<h1 align="center">IronTelemetry SDK for Java</h1>
|
|
|
|
<p align="center">
|
|
<strong>Error monitoring and crash reporting for Java applications</strong>
|
|
</p>
|
|
|
|
<p align="center">
|
|
<a href="https://search.maven.org/artifact/com.ironservices/telemetry"><img src="https://img.shields.io/maven-central/v/com.ironservices/telemetry.svg" alt="Maven Central"></a>
|
|
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
|
|
</p>
|
|
|
|
<p align="center">
|
|
<a href="https://irontelemetry.com">Website</a> •
|
|
<a href="https://irontelemetry.com/docs">Documentation</a> •
|
|
<a href="https://irontelemetry.com/docs/java">Java Guide</a> •
|
|
<a href="https://git.marketally.com/ironservices">Git</a>
|
|
</p>
|
|
|
|
---
|
|
|
|
**IronTelemetry** helps you capture exceptions, track user journeys, and get actionable insights to fix issues faster. Built for developers who want simple, powerful error monitoring without the complexity.
|
|
|
|
## Features
|
|
|
|
- **Exception Capture** - Automatically capture exceptions with full stack traces
|
|
- **Journey Tracking** - Understand what users did before an error occurred
|
|
- **Breadcrumbs** - Add context with custom breadcrumbs and metadata
|
|
- **Async Support** - CompletableFuture support for async operations
|
|
- **Thread-Safe** - All operations are safe for concurrent use
|
|
- **Spring Integration** - Easy integration with Spring Boot
|
|
|
|
## Installation
|
|
|
|
### Maven
|
|
|
|
```xml
|
|
<dependency>
|
|
<groupId>com.ironservices</groupId>
|
|
<artifactId>telemetry</artifactId>
|
|
<version>0.1.0</version>
|
|
</dependency>
|
|
```
|
|
|
|
### Gradle
|
|
|
|
```groovy
|
|
implementation 'com.ironservices:telemetry:0.1.0'
|
|
```
|
|
|
|
## Quick Start
|
|
|
|
### Initialize the SDK
|
|
|
|
```java
|
|
import com.ironservices.telemetry.TelemetryClient;
|
|
|
|
TelemetryClient client = new TelemetryClient("https://pk_live_xxx@irontelemetry.com");
|
|
```
|
|
|
|
### Capture Exceptions
|
|
|
|
```java
|
|
try {
|
|
doSomething();
|
|
} catch (Exception e) {
|
|
client.captureException(e);
|
|
throw e;
|
|
}
|
|
```
|
|
|
|
### Track User Journeys
|
|
|
|
```java
|
|
Journey journey = client.startJourney("Checkout Flow");
|
|
journey.setUser("user-123", "user@example.com", "John Doe");
|
|
|
|
try {
|
|
journey.runStep("Validate Cart", BreadcrumbCategory.BUSINESS, () -> {
|
|
validateCart();
|
|
});
|
|
|
|
journey.runStep("Process Payment", BreadcrumbCategory.BUSINESS, () -> {
|
|
processPayment();
|
|
});
|
|
|
|
journey.complete();
|
|
} catch (Exception e) {
|
|
journey.fail(e);
|
|
client.captureException(e);
|
|
throw e;
|
|
}
|
|
```
|
|
|
|
### Add Breadcrumbs
|
|
|
|
```java
|
|
client.addBreadcrumb("User clicked checkout button", BreadcrumbCategory.UI);
|
|
client.addBreadcrumb("Payment API called", BreadcrumbCategory.HTTP);
|
|
```
|
|
|
|
## Spring Integration
|
|
|
|
```java
|
|
@ControllerAdvice
|
|
public class GlobalExceptionHandler {
|
|
private final TelemetryClient telemetryClient;
|
|
|
|
@ExceptionHandler(Exception.class)
|
|
public ResponseEntity<?> handleException(Exception e) {
|
|
telemetryClient.captureException(e);
|
|
return ResponseEntity.status(500).body("Internal Server Error");
|
|
}
|
|
}
|
|
```
|
|
|
|
## Configuration
|
|
|
|
```java
|
|
TelemetryOptions options = new TelemetryOptions("https://pk_live_xxx@irontelemetry.com")
|
|
.setEnvironment("production")
|
|
.setAppVersion("1.2.3")
|
|
.setSampleRate(1.0)
|
|
.setDebug(false);
|
|
|
|
TelemetryClient client = new TelemetryClient(options);
|
|
```
|
|
|
|
## Documentation
|
|
|
|
For complete documentation, visit [irontelemetry.com/docs](https://irontelemetry.com/docs).
|
|
|
|
## Other SDKs
|
|
|
|
| Platform | Package |
|
|
|----------|---------|
|
|
| JavaScript/TypeScript | [@ironservices/telemetry](https://git.marketally.com/ironservices/irontelemetry-js) |
|
|
| .NET | [IronTelemetry.Client](https://git.marketally.com/ironservices/irontelemetry-dotnet) |
|
|
| Python | [irontelemetry](https://git.marketally.com/ironservices/irontelemetry-python) |
|
|
| Go | [irontelemetry-go](https://git.marketally.com/ironservices/irontelemetry-go) |
|
|
| Rust | [irontelemetry](https://git.marketally.com/ironservices/irontelemetry-rust) |
|
|
|
|
## Support
|
|
|
|
- **Documentation**: [irontelemetry.com/docs](https://irontelemetry.com/docs)
|
|
- **Email**: dev@ironservices.io
|
|
- **Issues**: [git.marketally.com/ironservices/irontelemetry-java/issues](https://git.marketally.com/ironservices/irontelemetry-java/issues)
|
|
|
|
## License
|
|
|
|
MIT License - see [LICENSE](LICENSE) for details.
|