Closed bbranquinho closed 2 years ago
@bbranquinho Something is wrong with authentication in the GitHub Actions - I've reached out to GitHub support - it will take a few days based on their previous response rate
2 files 2 suites 10s :stopwatch: 3 tests 3 :heavy_check_mark: 0 :zzz: 0 :x:
Results for commit 5e27aa74.
Description
There is an issue to publish metrics when the metric name contains special characters; this PR is to fix that issue. The best way to fix that is by using URL encoding. The metric name should use URL encoded characters, otherwise, graphite does not show the metric. Graphite shows the error "No Data" if the metric name contains special characters.
Error
The following figure shows the error.
Log: _22/01/10 05:33:30 TRACE jmx2graphite.MetricsPipeline: MetricValue{name='com.zaxxer.hikari.typePool-(HikariCP-writer-2).TotalConnections', value=5, timestampSeconds=1641772800}
An easy way to test graphite is by executing the command
echo "local.jmx.my-project.com.zaxxer.hikari.type_Pool-(HikariCP-reader-1).TotalConnections 5 `date +%s`" | nc ${GRAPHITE_SERVER} ${PORT}
Fix
Using the URLEncoder (https://docs.oracle.com/javase/1.5.0/docs/api/java/net/URLEncoder.html) the error is fixed.
Log: _22/01/10 05:37:36 TRACE jmx2graphite.MetricsPipeline: MetricValue{name='com.zaxxer.hikari.typePool-%28HikariCP-writer-2%29.ActiveConnections', value=0, timestampSeconds=1641772800}
Command to test graphite
echo "local.jmx.my-project.com.zaxxer.hikari.type_Pool-%28HikariCP-reader-1%29.TotalConnections 5 `date +%s`" | nc ${GRAPHITE_SERVER} ${PORT}
Additional Information
The following PRs show the same fix applied to other projects:
https://github.com/grafana/grafana/pull/401 https://github.com/graphite-project/graphite-web/pull/1663