Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(loki sink): use json size of unencoded event (#17572)
Currently the `loki` sink is encoding the event and then taking the estimated json size of that encoded event. This is wrong. All sinks should take the estimated json size of the unencoded event. There is an open question around whether we should be taking the json size before or after the `only_fields` and `except_fields` are applied. I'm currently trying to get an answer to that. Currently everything is before. The `loki` sink works a little bit different to the other stream based sinks. Most sinks pass the event unencoded to the request builder. It is at this point that the json size of the metrics are calculated. However, `loki` encodes the event and passes the encoded value to the request builder. This PR changes it so it also passes the json size to the request builder so it can use that value to calculate the metrics. Signed-off-by: Stephen Wakely <fungus.humungus@gmail.com>
- Loading branch information