diff options
Diffstat (limited to 'exporting/graphite')
-rw-r--r-- | exporting/graphite/README.md | 7 | ||||
-rw-r--r-- | exporting/graphite/graphite.c | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/exporting/graphite/README.md b/exporting/graphite/README.md index a6a25ef7..d755e093 100644 --- a/exporting/graphite/README.md +++ b/exporting/graphite/README.md @@ -22,7 +22,12 @@ directory and set the following options: ``` Add `:http` or `:https` modifiers to the connector type if you need to use other than a plaintext protocol. For example: `graphite:http:my_graphite_instance`, -`graphite:https:my_graphite_instance`. +`graphite:https:my_graphite_instance`. You can set basic HTTP authentication credentials using + +```conf + username = my_username + password = my_password +``` The Graphite connector is further configurable using additional settings. See the [exporting reference doc](/exporting/README.md#options) for details. diff --git a/exporting/graphite/graphite.c b/exporting/graphite/graphite.c index 722db0ff..84d4febf 100644 --- a/exporting/graphite/graphite.c +++ b/exporting/graphite/graphite.c @@ -218,10 +218,12 @@ void graphite_http_prepare_header(struct instance *instance) simple_connector_data->last_buffer->header, "POST /api/put HTTP/1.1\r\n" "Host: %s\r\n" + "%s" "Content-Type: application/graphite\r\n" "Content-Length: %lu\r\n" "\r\n", instance->config.destination, + simple_connector_data->auth_string ? simple_connector_data->auth_string : "", buffer_strlen(simple_connector_data->last_buffer->buffer)); return; |