summaryrefslogtreecommitdiffstats
path: root/src/exporting/opentsdb/opentsdb.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/exporting/opentsdb/opentsdb.c (renamed from exporting/opentsdb/opentsdb.c)18
1 files changed, 5 insertions, 13 deletions
diff --git a/exporting/opentsdb/opentsdb.c b/src/exporting/opentsdb/opentsdb.c
index ffccb5b22..ab4495cb2 100644
--- a/exporting/opentsdb/opentsdb.c
+++ b/src/exporting/opentsdb/opentsdb.c
@@ -127,7 +127,7 @@ int init_opentsdb_http_instance(struct instance *instance)
void sanitize_opentsdb_label_value(char *dst, const char *src, size_t len)
{
while (*src != '\0' && len) {
- if (isalpha(*src) || isdigit(*src) || *src == '-' || *src == '.' || *src == '/' || IS_UTF8_BYTE(*src))
+ if (isalpha((uint8_t)*src) || isdigit((uint8_t)*src) || *src == '-' || *src == '.' || *src == '/' || IS_UTF8_BYTE(*src))
*dst++ = *src;
else
*dst++ = '_';
@@ -186,15 +186,13 @@ int format_dimension_collected_opentsdb_telnet(struct instance *instance, RRDDIM
buffer_sprintf(
instance->buffer,
- "put %s.%s.%s %llu " COLLECTED_NUMBER_FORMAT " host=%s%s%s%s\n",
+ "put %s.%s.%s %llu " COLLECTED_NUMBER_FORMAT " host=%s%s\n",
instance->config.prefix,
chart_name,
dimension_name,
(unsigned long long)rd->collector.last_collected_time.tv_sec,
rd->collector.last_collected_value,
(host == localhost) ? instance->config.hostname : rrdhost_hostname(host),
- (host->tags) ? " " : "",
- (host->tags) ? rrdhost_tags(host) : "",
(instance->labels_buffer) ? buffer_tostring(instance->labels_buffer) : "");
return 0;
@@ -232,15 +230,13 @@ int format_dimension_stored_opentsdb_telnet(struct instance *instance, RRDDIM *r
buffer_sprintf(
instance->buffer,
- "put %s.%s.%s %llu " NETDATA_DOUBLE_FORMAT " host=%s%s%s%s\n",
+ "put %s.%s.%s %llu " NETDATA_DOUBLE_FORMAT " host=%s%s\n",
instance->config.prefix,
chart_name,
dimension_name,
(unsigned long long)last_t,
value,
(host == localhost) ? instance->config.hostname : rrdhost_hostname(host),
- (host->tags) ? " " : "",
- (host->tags) ? rrdhost_tags(host) : "",
(instance->labels_buffer) ? buffer_tostring(instance->labels_buffer) : "");
return 0;
@@ -326,7 +322,7 @@ int format_dimension_collected_opentsdb_http(struct instance *instance, RRDDIM *
"\"timestamp\":%llu,"
"\"value\":"COLLECTED_NUMBER_FORMAT","
"\"tags\":{"
- "\"host\":\"%s%s%s\"%s"
+ "\"host\":\"%s\"%s"
"}"
"}",
instance->config.prefix,
@@ -335,8 +331,6 @@ int format_dimension_collected_opentsdb_http(struct instance *instance, RRDDIM *
(unsigned long long)rd->collector.last_collected_time.tv_sec,
rd->collector.last_collected_value,
(host == localhost) ? instance->config.hostname : rrdhost_hostname(host),
- (host->tags) ? " " : "",
- (host->tags) ? rrdhost_tags(host) : "",
instance->labels_buffer ? buffer_tostring(instance->labels_buffer) : "");
return 0;
@@ -382,7 +376,7 @@ int format_dimension_stored_opentsdb_http(struct instance *instance, RRDDIM *rd)
"\"timestamp\":%llu,"
"\"value\":" NETDATA_DOUBLE_FORMAT ","
"\"tags\":{"
- "\"host\":\"%s%s%s\"%s"
+ "\"host\":\"%s\"%s"
"}"
"}",
instance->config.prefix,
@@ -391,8 +385,6 @@ int format_dimension_stored_opentsdb_http(struct instance *instance, RRDDIM *rd)
(unsigned long long)last_t,
value,
(host == localhost) ? instance->config.hostname : rrdhost_hostname(host),
- (host->tags) ? " " : "",
- (host->tags) ? rrdhost_tags(host) : "",
instance->labels_buffer ? buffer_tostring(instance->labels_buffer) : "");
return 0;