Releases: faststats-dev/faststats-java
0.25.1
0.25.0
What's Changed
- Added
platform_versionmetric for additional error context and future use in the chart editor - Calling
FastStatsContext#readyis required now to start the metrics submission
Full Changelog: 0.24.1...0.25.0
0.24.1
0.24.0
What's Changed
This release introduces the new FastStats context model, adds feature flag
support, and cleans up the public Java API for metrics and error tracking.
A detailed migration guide can be found here: https://docs.faststats.dev/java/migration
Highlights
- Added
FastStatsContextas the shared entry point for SDK services. - Added platform context factories:
BukkitContext.FactoryBungeeContext.FactoryFabricContext.FactoryHytaleContext.FactoryMinestomContext.FactoryNukkitContext.FactorySpongeContext.BuilderVelocityContext.Builder
- Added feature flag support:
FeatureFlagServiceFeatureFlagAttributes- boolean, string, and number flag values
- cached reads, forced fetches, TTL configuration, opt-in and opt-out
- Added
ErrorTrackerServicefor context-owned error submission. - Added
TrackedErrorso tracked errors can carry attributes and handled state. - Added shared context configuration via
Config. - Added SDK metadata via
SdkInfo. - Added built-in logging abstraction for SDK internals.
- Added a new
configmodule for shared config handling.
Breaking Changes
Context-Based Setup
Metrics are no longer created directly from platform metric factories. Use a
platform context instead.
Before:
private final BukkitMetrics metrics = BukkitMetrics.factory()
.token("YOUR_TOKEN")
.create(this);After:
private final BukkitContext context = new BukkitContext.Factory(this, "YOUR_TOKEN")
.metrics(Metrics.Factory::create)
.create();Lifecycle methods moved to the context:
@Override
public void onEnable() {
context.ready();
}
@Override
public void onDisable() {
context.shutdown();
}Package Moves
Core classes moved out of dev.faststats.core.
Before:
import dev.faststats.core.ErrorTracker;
import dev.faststats.core.Metrics;
import dev.faststats.core.data.Metric;After:
import dev.faststats.ErrorTracker;
import dev.faststats.Metrics;
import dev.faststats.data.Metric;Error Tracking
Error trackers are now registered through the context.
Before:
BukkitMetrics.factory()
.errorTracker(ERROR_TRACKER)
.token("YOUR_TOKEN")
.create(this);After:
new BukkitContext.Factory(this, "YOUR_TOKEN")
.errorTrackerService(ERROR_TRACKER)
.metrics(Metrics.Factory::create)
.create();Metrics Factory Changes
Per-metrics .token(...), .url(...), and .debug(...) configuration was
removed from the metrics factory. The token is now supplied to the context
factory, and runtime behavior is controlled through config/system properties.
Feature Flags
Note
Feature Flags are still in Private Preview please contact staff if you would like to try them out.
Feature flags can now be configured as a context service:
private final BukkitContext context = new BukkitContext.Factory(this, "YOUR_TOKEN")
.featureFlagService(factory -> factory
.attributes(Attributes.empty().put("version", "1.2.3"))
.create())
.create();
private final FeatureFlagService flags = context.featureFlagService().orElseThrow();
private final FeatureFlag<Boolean> newCommands = flags.define("new_commands", false);Read values asynchronously:
newCommands.whenReady().thenAccept(enabled -> {
if (enabled) {
// Enable new behavior
}
});Migration
Most projects should:
- Replace
dev.faststats.core.*imports withdev.faststats.*. - Replace platform metrics factories with platform context factories.
- Move
.token(...)into the context factory constructor or injected builder. - Move
.errorTracker(...)to.errorTrackerService(...). - Move custom metrics into
.metrics(factory -> factory ... .create()). - Replace
metrics.ready()/metrics.shutdown()with
context.ready()/context.shutdown().
Full Changelog
- Added context-based SDK architecture.
- Added feature flags.
- Added error tracker service.
- Added tracked error metadata support.
- Added shared config module.
- Added SDK info metadata.
- Refactored metrics APIs.
- Refactored platform integrations to use contexts.
- Removed old direct platform metrics factory setup.
Full Changelog: 0.23.0...0.24.0