06 Jan 2025 03:33 PM - edited 06 Jan 2025 04:16 PM
In the old extensions framework, I had an extension that would read from a database and inject data into Dynatrace via API.
I converted it to EF2, with no change in the code doing this.
Before, I got into the dimension of a metric a string like "Exploração" but now, with EF2, I'm getting "Exploração".
Now, ç encodes in UTF-8 as "C3 A7" which might mean that the extensions are now using ISO 8859-1 or another single-byte encoding.
Is anyone aware of why this might have happened in the transition?
06 Jan 2025 03:51 PM
How is the data "injected"? Is it a log line, a metric dimension, a metric key, a dimension key, etc.
When you say in the "logs", is the data shown as `Exploração` in the extension logs or in the log lines you are sending to Dynatrace?
06 Jan 2025 04:14 PM - edited 06 Jan 2025 04:17 PM
In reality I got it wrong, it's a dimension of a metric, not logs (correcting the old text so it's OK).
I'm in the process of changing the following line, which seems to have done the job with EF1, but not now with EF2:
ingestHeaders = {'Authorization': 'Api-Token ' + self.api_token, 'Content-Type': 'text/plain; charset=ISO-8859-1', 'accept': 'application/json; charset=utf-8'}
I'll update after I change the above.
BTW, the ActiveGate is the same, with EF1/EF2, so no changes there, except that we were on older version of AG, and also updated that to support EF2. Other chance is that I'm getting this data from Oracle, and was using version 1.4.0, and now I have created the EF2 extension with 2.5.0?
06 Jan 2025 05:10 PM
I changed the above line to
ingestHeaders = {'Authorization': 'Api-Token ' + self.api_token, 'Content-Type': 'text/plain; charset=UTF-8', 'accept': 'application/json; charset=utf-8'}
and it started working as the old EF1 version.
Given that I have several extensions working with Latin characters, it really doesn't seem to be EF1/EF2 related.But I do remember having to fiddle with the charset type to getting it to work before in EF1...
At the moment, I would say it is related to the upgrade in the Oracle library, but not pretty sure. It might also be some other strange interaction. If I discover more, I'll post it here.