FrankChen021 / bithon

An observability platform mainly for Java
Apache License 2.0
15 stars 5 forks source link

metadata cache optimization #524

Closed FrankChen021 closed 1 year ago

FrankChen021 commented 1 year ago

Description

When processing http outgoing metrics, current sink will search for the host name of target ip. If there're lots of http outgoing requests with different ip addresses, there will be lots of queries on these ip.

image

This causes too many spans in the log for one transaction.

image

Cause

If a item is missed, it will be added into a cache with life time up to 1 minutes. So for the first large batch, all items miss, and leads to above problem.

Solution

The CachableMetaStorage needs to be updated to add a periodic routine to load app names from underlying metadata storage into a cache. And the query routine always load from cache.