Hi.
This is an old thread, but this maybe helpful for someone.
We had the same problem of this post.
Hope this help someone.
Regards.
Francisco J. Garcia
Original Message:
Sent: Mon June 26, 2023 03:50 AM
From: Luc-Michel Demey
Subject: Metrics App: Error invalid UTF8 string '\xe9' with WAS 905 & Prometheus
Hello,
Sorry for the delay in replying, I was travelling.
Thank you for all this information, but I can't use it.
Concerning
encoding: 'ISO-8859-1
wherever I place it in the .yml file, I get errors.
Example :
global:
scrape_interval: 15s
evaluation_interval: 15s
scrape_configs:
encoding: 'ISO-8859-1'
- job_name: 'LMD_905'
static_configs:
- targets: ['localhost:9019']
Result:
prometheus.exe --config.file="prometheus_2.yml"
ts=2023-06-26T06:49:44.489Z caller=main.go:479 level=error msg="Error loading config (--config.file=prometheus_2.yml)" file=D:\prometheus\prometheus_2.yml err="parsing YAML file prometheus_2.yml: yaml: line 5: did not find expected key"
Without the line "encoding: 'ISO-8859-1'", the file is ok.
What is the exact syntax to use?
Regarding the configuration of the Metrics application, I don't know how to configure it to produce UTF-8.
Regarding the JVM parameters, I'm in a tWAS ND environment, so adding launch parameters isn't practical (impact on other applications).
Prometheus is in version 2.44.0, and the metrics.ear application is the one supplied with WAS 9.0.5.15.
Can you please help me?
------------------------------
Luc-Michel Demey
DEMEY CONSULTING
lmd@demey-consulting.fr
#IBMChampion
------------------------------
Original Message:
Sent: Wed June 21, 2023 05:21 AM
From: Youssef Sbai Idrissi
Subject: Metrics App: Error invalid UTF8 string '\xe9' with WAS 905 & Prometheus
In my opinion, the error you're encountering seems to be related to encoding issues with the text retrieved from the Metrics application. It appears that the French characters in the help text are causing problems when Prometheus tries to parse the metrics.
To resolve this, you can try the following steps:
1. Update Prometheus configuration: In your Prometheus configuration file (prometheus.yml), specify the character encoding explicitly for scraping the metrics. Add the following line at the top of the file:
scrape_config: encoding: ISO-8859-1
Save the file and restart Prometheus.
Verify the Metrics application configuration: Ensure that the Metrics application is configured correctly to provide metrics in a compatible encoding, such as UTF-8.
Check JVM settings: Verify the JVM settings for both the Metrics application and Prometheus. Ensure that the JVM is configured to use an appropriate character encoding, such as UTF-8, by setting the file.encoding system property. You can add the following line to the JVM arguments in the startup script (e.g., server.xml):
Restart both the Metrics application and Prometheus after making this change.
Verify the installation: Double-check that you have installed the correct versions of both the Metrics application and Prometheus. Ensure that they are compatible and support the same encoding.
------------------------------
Youssef Sbai Idrissi
Software Engineer