[dev.icinga.com #12227] Incorrect escaping / formatting of perfdata to InfluxDB #4401
Comments
Updated by gbeutner on 2016-07-26 05:54:08 +00:00 @spjmurray: Can you have a look at this please? :) |
Updated by spjmurray on 2016-07-26 06:00:09 +00:00 I can try escaping the backslashes... Utterly undocumented though by influxdata sigh |
Updated by spjmurray on 2016-07-27 14:09:41 +00:00 Recreate...
|
Updated by spjmurray on 2016-07-27 15:09:48 +00:00 Well this is horrible... Influx interprets "\ " as an escaped space, likewise "\," as an escaped comma, thus screwing things up in this instance. Escaped backslashes aren't a thing either. Our only option is to replace trailing slashes (which spoils the prettiness of Grafana), or translate to "\\ " which will confusingly add a magical white space on the end, but look pretty! I prefer the latter as "C:\ " looks more sane to the spreadsheet crowd than "C:_" |
Updated by TheFlyingCorpse on 2016-07-27 17:24:27 +00:00 https://docs.influxdata.com/influxdb/v0.13/write\_protocols/write\_syntax/#escaping-characters are we sure its not icinga that is doing this? I dont see this issue with other sources and have the \ represented (that I can see) without a space at the end. C:_ wouldnt really be an issue, it would be safer to use when querying than \'s, no? |
Updated by TheFlyingCorpse on 2016-07-27 17:26:14 +00:00 And I didnt even read the whole thing before clicking submit.
What if the string is sent as "C:\" instead? Ie, encapsulate in ""'s if it ends with a \? |
Updated by TheFlyingCorpse on 2016-07-27 18:13:54 +00:00 Bah. i see the issue now. Tried both ,"metric=C:\" and ,metric="C:\", it doesnt look too good either. Yes, C:_ looks bad but at least its safe and we are then also relatively safe from some future changes that might happen in InfluxDB. |
Updated by spjmurray on 2016-07-28 08:27:11 +00:00 Given it's only windows that suffers I'm game O:) |
Updated by spjmurray on 2016-07-28 09:03:14 +00:00 Although undocumented it appears to escape '=' too...
|
Updated by spjmurray on 2016-07-28 09:32:23 +00:00 Much better!
|
Updated by spjmurray on 2016-07-28 09:33:58 +00:00
From e605e81f2f9de9e6650d89ba56bae626cf7e640d Mon Sep 17 00:00:00 2001 Backslashes escape spaces or commas (and evidently equals), given tags are refs #12227 |
Updated by gbeutner on 2016-07-28 11:41:19 +00:00 The patch file you've attached to this ticket seems to be for another ticket. :) |
Updated by spjmurray on 2016-07-28 11:42:53 +00:00
Right patch :) |
Updated by spjmurray on 2016-07-28 12:15:05 +00:00
Applied in changeset d1dbe2a. |
Updated by mfriedrich on 2016-07-28 12:22:02 +00:00
|
Updated by spjmurray on 2016-07-28 12:55:15 +00:00
Less modern patch which will work without -std=c++11 and string::back() |
Updated by gbeutner on 2016-07-28 13:55:01 +00:00
|
Updated by TheFlyingCorpse on 2016-07-30 11:38:35 +00:00
The patch does not fix everything as expected. Example:
It appears this is escaped again after the debug output, as it is being sent to InfluxDB. Steps to reproduce:
Correct:
|
Updated by spjmurray on 2016-08-01 11:46:12 +00:00 It isn't escaped again, what gets echoed out is what gets added to a list, then joined with \n into the message body, no more, no less. You should be able to see this via 'tcpdump -i blah0 port 8086 -A'. InfluxDB however doesn't necessarily reply with what you'd expect, and that has been known to display extra slashes. I'd double check what's actually on the wire. |
Updated by TheFlyingCorpse on 2016-08-04 02:09:13 +00:00 ServiceName in Icinga2: "SuperDIsk hhh"
It does look to me like it is double escaped. |
Updated by spjmurray on 2016-08-08 08:53:55 +00:00
Is what I'm getting out which works perfectly, unable to recreate :*( |
Updated by mfriedrich on 2016-08-12 08:41:50 +00:00 Is there anything else what needs to be done for resolving/closing this issue? |
Updated by TheFlyingCorpse on 2016-08-15 16:40:02 +00:00 ServiceConfig:
Output got via tcpdump, grep filtered to only get the tests:
Icinga2 was compiled from last nights master with ido magic by shroud, the output is similar when using snapshots.
I'll dig around a bit and see if I can figure out why it double escapes. |
Updated by TheFlyingCorpse on 2016-08-16 20:28:12 +00:00
Patches to fix the escaping attached. |
Updated by TheFlyingCorpse on 2016-08-16 20:56:16 +00:00
Applied in changeset 93dc0bd. |
Updated by TheFlyingCorpse on 2016-08-16 21:57:05 +00:00
Patch needs to be merged before this is resolved. I goofed. |
Updated by TheFlyingCorpse on 2016-08-17 04:10:08 +00:00
Applied in changeset 4e3da7e. |
This issue has been migrated from Redmine: https://dev.icinga.com/issues/12227
Created by TheFlyingCorpse on 2016-07-25 18:09:06 +00:00
Assignee: (none)
Status: Resolved (closed on 2016-08-17 04:10:08 +00:00)
Target Version: 2.5.0
Last Update: 2016-08-17 04:10:08 +00:00 (in Redmine)
Perfdata presented to InfluxdbWriter:
This is the data in icinga2:
This data does not appear in influxdb. Other metrics from the host appear, but not the above.
Attachments
Changesets
2016-07-28 12:11:23 +00:00 by spjmurray d1dbe2a
2016-07-28 13:54:33 +00:00 by spjmurray 344248f
2016-07-29 04:51:33 +00:00 by spjmurray 84ea006
2016-08-16 20:36:09 +00:00 by TheFlyingCorpse bfed90c
2016-08-16 20:54:15 +00:00 by TheFlyingCorpse 35eb654
2016-08-16 20:54:24 +00:00 by TheFlyingCorpse 93dc0bd
2016-08-17 04:08:05 +00:00 by TheFlyingCorpse 4e3da7e
2016-08-17 04:10:41 +00:00 by TheFlyingCorpse 5c0b3c5
The text was updated successfully, but these errors were encountered: