cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Character encoding differences between EF1 and EF2?

AntonioSousa
DynaMight Guru
DynaMight Guru

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?

Antonio Sousa
3 REPLIES 3

david_lopes
Dynatrace Pro
Dynatrace Pro

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?

@david_lopes,

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?

 

Antonio Sousa

@david_lopes,

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.

 

Antonio Sousa

Featured Posts