Kamon icon indicating copy to clipboard operation
Kamon copied to clipboard

kamon-prometheus uses invalid escapce sequence

Open mrt181 opened this issue 4 years ago • 0 comments

I am running my app with kamon 2.1.12 on Windows 10 through IntelliJ

I am not using the bundle because this has many other issues (see #957)

This are the kamon dependencies I use

    object Version {
      val kamon           = "2.1.12"
    }
    val kamonCore = "io.kamon" %% "kamon-core" % Version.kamon
    val kamonRuntime = Seq(
      "io.kamon" %% "kamon-status-page",
      "io.kamon" %% "kamon-prometheus",
      "io.kamon" %% "kamon-system-metrics",
      "io.kamon" %% "kamon-executors",
      "io.kamon" %% "kamon-akka",
      "io.kamon" %% "kamon-akka-http"
    ).map(_ % Version.kamon)
Connected to the target VM, address: '127.0.0.1:58334', transport: 'socket'

 _  __                _        ______
| |/ /               | |       \ \ \ \
| ' / __ _ _ __   ___| | __ _   \ \ \ \
|  < / _` | '_ \ / _ \ |/ _` |   ) ) ) )
| . \ (_| | | | |  __/ | (_| |  / / / /
|_|\_\__,_|_| |_|\___|_|\__,_| /_/_/_/
                              
==============================
Running with Kanela, the Kamon Instrumentation Agent :: (v1.0.8)

2021-03-16T12:06:28.052Z INFO  [              main]         kamon.status.page.StatusPage  - Status page started on http://0.0.0.0:5266/
2021-03-16T12:06:28.292Z DEBUG [              main] re.os.windows.WindowsOperatingSystem  - Debug privileges not enabled.
2021-03-16T12:06:28.386Z INFO  [              main]  kamon.prometheus.PrometheusReporter  - Started the embedded HTTP server on http://127.0.0.1:9095/metrics

This exposes the metrics as expected

# HELP host_storage_device_data_read_bytes_total Counts the amount of byes that have been read from a storage device
# TYPE host_storage_device_data_read_bytes_total counter
host_storage_device_data_read_bytes_total{device="\\.\PHYSICALDRIVE0",component="host"} 1014784.0

But this is invalid, causing the target to be not used by prometheus. Checking the metrics using promtool confirms this.

curl -s http://localhost:9095/metrics | ./promtool.exe check metrics
error while linting: text format parsing error in line 66: invalid escape sequence '\P'

This stops prometheus from scraping from the target. Removing "io.kamon" %% "kamon-system-metrics" fixes scraping.

mrt181 avatar Mar 16 '21 12:03 mrt181