Add escaping for new lines in AbstractInfluxdbMetricsSender#645
Add escaping for new lines in AbstractInfluxdbMetricsSender#645dgetzlaf wants to merge 2 commits intoapache:masterfrom dgetzlaf:fix-linebreaks-in-influxdb
Conversation
Codecov Report
@@ Coverage Diff @@
## master #645 +/- ##
============================================
+ Coverage 55.43% 55.46% +0.02%
- Complexity 10157 10180 +23
============================================
Files 1044 1046 +2
Lines 64082 64151 +69
Branches 7250 7265 +15
============================================
+ Hits 35527 35579 +52
- Misses 26048 26069 +21
+ Partials 2507 2503 -4 Continue to review full report at Codecov.
|
| .replaceAll(" ", "\\\\ ") | ||
| .replaceAll(",", "\\\\,") | ||
| .replaceAll("=", "\\\\=") | ||
| .replaceAll("\n", "\\\\n"); |
There was a problem hiding this comment.
This looks ok to me, but while we are here, I believe we should use replace as replaceAll is only needed when using a regex as the pattern to find (it should also perform better).
There was a problem hiding this comment.
@ham1 thanks for your feedback. I've updated this code block according to your recommendation.
…luxdbMetricsSender
|
Thanks for the PR. Could you test next nightly or build from trunk and report back, if it solves your problem? |
Contributed by David Getzlaff (david.getzlaff at t-systems.com>) Closes apache#645 on github
|
Hi @FSchumacher, |
|
has this fix made its way into a downloadable build of JMeter? |
|
@coeyc this fix was approved and merged. Sadly JMeter wasn't released yet 😿 |
|
AFAIK it should be included in v5.4.1+. Am I mistaken? |
|
Oh, there were no releases since the fix has been merged. That is quite some time now. |
|
so, i guess the next build, we will look at the nightly build |
|
Just in case, the nightly would include Open Model Thread Group, and I would be glad to hear your feedback :) |
|
@vlsi do you know someone, who could initiate a JMeter 5.5 release? Your Open Model Thread Group looks good to me; sadly I had no chance in testing it yet. |
|
A mail to dev@jmeter.apache.org would do |
Description
Add escaping for new lines in AbstractInfluxdbMetricsSender.tagToStringValue()
Motivation and Context
For load- and performance testing (distributed testing) we send metrics to the InfluxDB.

From time to time, no metrics occur in the dashboard while testing:
In the log file of the JMeter controller, I find this line pretty often:
It seems that the escaping of the line breaks is not working properly. By that, invalid requests are sent to the InfluxDB, resulting in 'missing fields'.
How Has This Been Tested?
Current JMeter 5.4.1 Release:
3. Looking at the console output / jmeter log file --> The error occurs
4. influxDB : No metrics received
JMeter 5.4.1 Release + this fix:
3. Looking at the console output / jmeter log file --> No error occurs
4. influxDB : metrics are received
Types of changes
Checklist: