Skip to content

Releases: faststats-dev/faststats-java

0.25.1

04 Jun 18:31

Choose a tag to compare

What's Changed

  • Fix and automate FabricContext#ready handling
  • Automate FabricContext#shutdown handling

Full Changelog: 0.25.0...0.25.1

0.25.0

04 Jun 13:36

Choose a tag to compare

What's Changed

  • Added platform_version metric for additional error context and future use in the chart editor
  • Calling FastStatsContext#ready is required now to start the metrics submission

Full Changelog: 0.24.1...0.25.0

0.24.1

01 Jun 20:35

Choose a tag to compare

0.24.0

01 Jun 09:59
17ed96a

Choose a tag to compare

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 FastStatsContext as the shared entry point for SDK services.
  • Added platform context factories:
    • BukkitContext.Factory
    • BungeeContext.Factory
    • FabricContext.Factory
    • HytaleContext.Factory
    • MinestomContext.Factory
    • NukkitContext.Factory
    • SpongeContext.Builder
    • VelocityContext.Builder
  • Added feature flag support:
    • FeatureFlagService
    • FeatureFlag
    • Attributes
    • boolean, string, and number flag values
    • cached reads, forced fetches, TTL configuration, opt-in and opt-out
  • Added ErrorTrackerService for context-owned error submission.
  • Added TrackedError so 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 config module 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:

  1. Replace dev.faststats.core.* imports with dev.faststats.*.
  2. Replace platform metrics factories with platform context factories.
  3. Move .token(...) into the context factory constructor or injected builder.
  4. Move .errorTracker(...) to .errorTrackerService(...).
  5. Move custom metrics into .metrics(factory -> factory ... .create()).
  6. 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

0.23.0

25 May 11:23
d9fc178

Choose a tag to compare

What's Changed

Full Changelog: 0.22.1...0.23.0

0.22.1

21 May 13:54
1a07d25

Choose a tag to compare

What's Changed

Full Changelog: 0.22.0...0.22.1

0.22.0

10 Apr 20:11

Choose a tag to compare

What's Changed

Full Changelog: 0.21.0...0.22.0

0.21.0

04 Apr 14:58

Choose a tag to compare

What's Changed

Full Changelog: 0.20.1...0.21.0

0.20.1

03 Apr 16:11

Choose a tag to compare

What's Changed

  • Move built-in data appending above custom metrics by @NonSwag in #131

Full Changelog: 0.20.0...0.20.1

0.20.0

25 Mar 17:48
2f0d3df

Choose a tag to compare

What's Changed

  • Add handled error tracking to ErrorTracker by @NonSwag in #123

Full Changelog: 0.19.0...0.20.0