Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[COR-177] Latency Fixes #72

Merged
merged 4 commits into from
Nov 19, 2022
Merged

[COR-177] Latency Fixes #72

merged 4 commits into from
Nov 19, 2022

Conversation

gunnarsundberg
Copy link
Contributor

Fixes a couple of issues from initial latency PR.

Latency Units

Latencies were exported in microseconds, so the values fell outside of all buckets for histogram. Latencies are still recorded in microseconds, but exported in float64 milliseconds.

Example of current data from prod:

# HELP latency_connector_histogram Latency from connector reception to kafka produce
# TYPE latency_connector_histogram histogram
latency_connector_histogram_bucket{Connector="sushiswap",Env="prod",job="streamserver",le="0"} 0
latency_connector_histogram_bucket{Connector="sushiswap",Env="prod",job="streamserver",le="5"} 0
latency_connector_histogram_bucket{Connector="sushiswap",Env="prod",job="streamserver",le="10"} 0
latency_connector_histogram_bucket{Connector="sushiswap",Env="prod",job="streamserver",le="25"} 0
latency_connector_histogram_bucket{Connector="sushiswap",Env="prod",job="streamserver",le="50"} 0
latency_connector_histogram_bucket{Connector="sushiswap",Env="prod",job="streamserver",le="75"} 0
latency_connector_histogram_bucket{Connector="sushiswap",Env="prod",job="streamserver",le="100"} 0
latency_connector_histogram_bucket{Connector="sushiswap",Env="prod",job="streamserver",le="250"} 0
latency_connector_histogram_bucket{Connector="sushiswap",Env="prod",job="streamserver",le="500"} 0
latency_connector_histogram_bucket{Connector="sushiswap",Env="prod",job="streamserver",le="750"} 0
latency_connector_histogram_bucket{Connector="sushiswap",Env="prod",job="streamserver",le="1000"} 0
latency_connector_histogram_bucket{Connector="sushiswap",Env="prod",job="streamserver",le="2500"} 0
latency_connector_histogram_bucket{Connector="sushiswap",Env="prod",job="streamserver",le="5000"} 0
latency_connector_histogram_bucket{Connector="sushiswap",Env="prod",job="streamserver",le="7500"} 0
latency_connector_histogram_bucket{Connector="sushiswap",Env="prod",job="streamserver",le="10000"} 0
latency_connector_histogram_bucket{Connector="sushiswap",Env="prod",job="streamserver",le="+Inf"} 54470
latency_connector_histogram_sum{Connector="sushiswap",Env="prod",job="streamserver"} 4.2127170146e+10

Example from local testing with updated units:

# HELP latency_connector_histogram Latency from connector reception to kafka produce
# TYPE latency_connector_histogram histogram
latency_connector_histogram_bucket{Connector="streamserver",Env="staging",job="streamserver",le="0"} 0
latency_connector_histogram_bucket{Connector="streamserver",Env="staging",job="streamserver",le="5"} 0
latency_connector_histogram_bucket{Connector="streamserver",Env="staging",job="streamserver",le="10"} 0
latency_connector_histogram_bucket{Connector="streamserver",Env="staging",job="streamserver",le="25"} 0
latency_connector_histogram_bucket{Connector="streamserver",Env="staging",job="streamserver",le="50"} 0
latency_connector_histogram_bucket{Connector="streamserver",Env="staging",job="streamserver",le="75"} 0
latency_connector_histogram_bucket{Connector="streamserver",Env="staging",job="streamserver",le="100"} 0
latency_connector_histogram_bucket{Connector="streamserver",Env="staging",job="streamserver",le="250"} 0
latency_connector_histogram_bucket{Connector="streamserver",Env="staging",job="streamserver",le="500"} 0
latency_connector_histogram_bucket{Connector="streamserver",Env="staging",job="streamserver",le="750"} 0
latency_connector_histogram_bucket{Connector="streamserver",Env="staging",job="streamserver",le="1000"} 18
latency_connector_histogram_bucket{Connector="streamserver",Env="staging",job="streamserver",le="2500"} 31
latency_connector_histogram_bucket{Connector="streamserver",Env="staging",job="streamserver",le="5000"} 41
latency_connector_histogram_bucket{Connector="streamserver",Env="staging",job="streamserver",le="7500"} 42
latency_connector_histogram_bucket{Connector="streamserver",Env="staging",job="streamserver",le="10000"} 42
latency_connector_histogram_bucket{Connector="streamserver",Env="staging",job="streamserver",le="+Inf"} 42
latency_connector_histogram_sum{Connector="streamserver",Env="staging",job="streamserver"} 76029.403
latency_connector_histogram_count{Connector="streamserver",Env="staging",job="streamserver"} 42

After this update, a dash to show the distribution of latency values will be possible. Currently, we can only see a mean and that all values are less than infinity.

metric.go Updates

ExportLatencyMetrics was refactored to be more readable. It performs the same function, but in a way where someone that isn't me can tell what is going on. The initial version was a confusing mess of maps (sorry). The unit tests were updated to match the changes as well.

cnkarz
cnkarz previously requested changes Nov 18, 2022
Copy link
Contributor

@cnkarz cnkarz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall looks good. just one comment about the function design.

monitor/metric.go Outdated Show resolved Hide resolved
@gunnarsundberg gunnarsundberg dismissed cnkarz’s stale review November 19, 2022 01:57

requested changes were done ✅

@gunnarsundberg gunnarsundberg merged commit 3b8a5d3 into main Nov 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants