Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to handle prometheus remote_write case with influxdb-relay #1653

Closed
Alexvianet opened this issue Jun 4, 2018 · 1 comment
Closed

How to handle prometheus remote_write case with influxdb-relay #1653

Alexvianet opened this issue Jun 4, 2018 · 1 comment

Comments

@Alexvianet
Copy link

Alexvianet commented Jun 4, 2018

influxdata/influxdb-relay#66

URL for relevant page?

influxdata/influxdb-relay#66

What products and version are you using?

latest

Where did you look before opening the issue?

how should i configure relay in prometheus case
prometheus config:

# Remote write configuration (for Graphite, OpenTSDB, or InfluxDB).
remote_write:
  - url: "http://relay.Loadbalancer:9096/api/v1/prom/write?u=foo&p=bar&db=prometheus"

relay config:

bind-addr = "0.0.0.0:9096"
# Array of InfluxDB instances to use as backends for Relay.
output = [

 { name="influxdb1", location="http://10.35.96.144:8086/write", timeout="10s" },
 { name="influxdb2", location="http://10.35.96.145:8086/write", timeout="10s" },

]

Loadbalancer nginx config:

http {
  client_max_body_size 20M;
  sendfile    on;
  tcp_nopush  on;
  tcp_nodelay on;

  upstream influxdb-relay {

    server relay:9096 fail_timeout=0;
  }
  upstream influxdb {

    server influxdb1:8086 fail_timeout=0;
    server influxdb2:8086 fail_timeout=0;
  }

  server {
    listen                  9096;
    server_name             relay.Loadbalancer;

    location /write {
      limit_except POST {
        deny all;
                        }
      proxy_pass http://influxdb-relay;
                    }
    location /api/v1/prom/write {
      limit_except POST {
        deny all;
                        }
      proxy_pass http://influxdb-relay;
                    }
        }

  server {
    listen                  8086;
    server_name             influxdb.Loadbalancer;
    location /query {
      limit_except GET {
        deny all;
    }

    proxy_pass http://influxdb;

  }
    location /read {
      limit_except GET {
        deny all;
    }

    proxy_pass http://influxdb;

  }
    location /api/v1/prom/read {
      limit_except GET {
        deny all;
    }

    proxy_pass http://influxdb;

  }
 }
}

and get error
2018/06/01 14:08:02 [error] 10360#0: *69959 readv() failed (104: Connection reset by peer) while reading upstream, client: prometheus_host, server: relay.Loadbalancer, request: "POST /api/v1/prom/write?u=foo&p=bar&db=prometheus HTTP/1.1", upstream: "http://relay:9096/api/v1/prom/write?u=foo&p=bar&db=prometheus", host: "relay.Loadbalancer:9096"

Runing on relay server:
curl -i -XPOST 'http://localhost:9096/api/v1/prom/write?u=foo&p=bar&db=prometheus' --data-binary 'cpu_load_short,host=server01,region=us-west value=22.64 1434055562000000000'

gives:

HTTP/1.1 404 Not Found
Content-Length: 35
Content-Type: application/json
Date: Mon, 04 Jun 2018 11:32:54 GMT

{"error":"invalid write endpoint"}

@stevebang
Copy link
Contributor

This is an influxdb-relay issue, which is not documented in the InfluxData docs. Also, AFAIK, influxdb-relay is not supported. @Alexvianet -- you can try adding this issue in the influxdata/influxdb-relay repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants