Skip to content

Metrics & Analytics ​

можно. collects feature flag usage metrics: how many times a flag was evaluated and what result it returned. Metrics are visualized in the web dashboard via sparkline charts and accessible through the REST API.

How Metrics Are Collected ​

The SDK accumulates true/false counters for each flag in memory and sends them to the server in a single request at a configurable interval (default: 60 seconds):

sequenceDiagram
    participant App as Application
    participant SDK as SDK
    participant Server

    loop Each isEnabled()
        App->>SDK: isEnabled("flag", ctx)
        Note over SDK: trueCount++ or falseCount++
    end

    Note over SDK: Interval elapsed:<br/>snapshot buffer,<br/>clear buffer

    SDK->>Server: POST /api/client/metrics<br/>{flag: {t: 150, f: 50}}

    alt Success
        Note over Server: Saves to flag_metrics<br/>aggregating into hourly buckets
    else Network error
        Note over SDK: Merges counters<br/>back into buffer
    end

Each record contains:

FieldDescription
flagIdFlag ID
environmentIdEnvironment ID
evaluationTrueCountNumber of true returns
evaluationFalseCountNumber of false returns
timeBucketHourly interval
instanceIdSDK instance identifier
appNameApplication name

Viewing Metrics in the Dashboard ​

Each flag page displays a sparkline chart — a miniature graph showing the flag's evaluation trend over the selected period. The green line represents true, the gray line false.

Clicking the sparkline opens a dialog with a full chart and a list of SDK instances grouped by application. Filter by application name and specific instance. Metrics are retained for the last 48 hours.

Disabling Metrics ​

If metrics are not needed, disable them in the SDK:

java
MozhnoConfig config = MozhnoConfig.builder()
    .appName("my-app")
    .instanceId("instance-1")
    .mozhnoUrl("http://localhost:8080")
    .apiKey("<api-key>")
    .disableMetrics(true)
    .build();

Interpreting Metrics ​

PatternInterpretation
trueCount is growingThe flag is being enabled for more users — rollout is working
falseCount is growing, trueCount = 0Flag is off or no one matches the targeting rules
Sudden spike in falseCountPossible issue: flag suddenly stopped being enabled
No metrics at allSDK is not sending data — check connectivity

Limits ​

Default 60 seconds.

Released under the BSL 1.1 License.