splitio / split-synchronizer

Golang agent for Split SDKs
Other
16 stars 15 forks source link

Feat/historic telemetry #177

Closed mredolatti closed 2 years ago

mredolatti commented 2 years ago

This feature adds support for historic telemetry recording and querying in-memory for split-proxy. This component accepts a timeslice width (in seconds) and a maximum number of timeslices to keep in memory (the older will be purged as new ones are added).

Now, latencies & status code (which also allow derivation of successful, failed & total requests counts) per endpoint are made available for the last N timeslices. This data will then be feed to the soon to be added observability endpoint.

Data returned by the component (NOT final JSON that will be rendered in the endpoint's response) currently looks like this:

[
   { // timeslice 1
        <resource_a>: {
            status: {
                <code>:  <count>,
                ...
            },
            latency: [<bucket1_count>, ..., <bucket_n_count>]
        },
        <resource_b>: {
            status: {
                <code>:  <count>,
                ...
            },
            latency: [<bucket1_count>, ..., <bucket_n_count>]
        },
    },
    { // timeslice 2
    ...
     }
}
sonarqube-pull-requests[bot] commented 2 years ago

SonarQube Quality Gate

Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

95.7% 95.7% Coverage
0.0% 0.0% Duplication