summaryrefslogtreecommitdiffstats
path: root/backends/backends.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-09-03 10:23:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-09-03 10:23:48 +0000
commitcd7ed12292aef11d9062b64f61215174e8cc1860 (patch)
tree9998ab03d153956743d9319cf3a0279b9593ce36 /backends/backends.h
parentReleasing debian version 1.16.1-6. (diff)
downloadnetdata-cd7ed12292aef11d9062b64f61215174e8cc1860.tar.xz
netdata-cd7ed12292aef11d9062b64f61215174e8cc1860.zip
Merging upstream version 1.17.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'backends/backends.h')
-rw-r--r--backends/backends.h35
1 files changed, 28 insertions, 7 deletions
diff --git a/backends/backends.h b/backends/backends.h
index 8d0bda413..9da04ccee 100644
--- a/backends/backends.h
+++ b/backends/backends.h
@@ -16,13 +16,14 @@ typedef enum backend_options {
} BACKEND_OPTIONS;
typedef enum backend_types {
- BACKEND_TYPE_UNKNOWN, //Invalid type
- BACKEND_TYPE_GRAPHITE, //Send plain text to Graphite
- BACKEND_TYPE_OPENTSDB_USING_TELNET, //Send data to OpenTSDB using telnet API
- BACKEND_TYPE_OPENTSDB_USING_HTTP, //Send data to OpenTSDB using HTTP API
- BACKEND_TYPE_JSON, //Stores the data using JSON.
- BACKEND_TYPE_PROMETEUS, //The user selected to use Prometheus backend
- BACKEND_TYPE_KINESIS //Send message to AWS Kinesis
+ BACKEND_TYPE_UNKNOWN, // Invalid type
+ BACKEND_TYPE_GRAPHITE, // Send plain text to Graphite
+ BACKEND_TYPE_OPENTSDB_USING_TELNET, // Send data to OpenTSDB using telnet API
+ BACKEND_TYPE_OPENTSDB_USING_HTTP, // Send data to OpenTSDB using HTTP API
+ BACKEND_TYPE_JSON, // Stores the data using JSON.
+ BACKEND_TYPE_PROMETEUS, // The user selected to use Prometheus backend
+ BACKEND_TYPE_KINESIS, // Send message to AWS Kinesis
+ BACKEND_TYPE_MONGODB // Send data to MongoDB collection
} BACKEND_TYPE;
@@ -56,6 +57,22 @@ extern calculated_number backend_calculate_value_from_stored_data(
extern size_t backend_name_copy(char *d, const char *s, size_t usable);
extern int discard_response(BUFFER *b, const char *backend);
+static inline char *strip_quotes(char *str) {
+ if(*str == '"' || *str == '\'') {
+ char *s;
+
+ str++;
+
+ s = str;
+ while(*s) s++;
+ if(s != str) s--;
+
+ if(*s == '"' || *s == '\'') *s = '\0';
+ }
+
+ return str;
+}
+
#endif // BACKENDS_INTERNALS
#include "backends/prometheus/backend_prometheus.h"
@@ -71,4 +88,8 @@ extern int discard_response(BUFFER *b, const char *backend);
#include "backends/prometheus/remote_write/remote_write.h"
#endif
+#if HAVE_MONGOC
+#include "backends/mongodb/mongodb.h"
+#endif
+
#endif /* NETDATA_BACKENDS_H */