In some circumstances, the servicegraph processor in the metrics generator can spend a lot of time locking and unlocking the mutex in UpsertEdge.
The following is a screenshot from two execution traces captured from metrics generators ingesting from Kafka. Both show one of the goroutines running readCh. The bottom trace shows a state where the generator is keeping up with its backlog, while at the top it's falling behind.
Execution trace goroutine flamegraph

If we need to improve throughput, optimizing this locking could be an option.