Skip to content

HTTP Endpoints v3

chengshiwen edited this page Aug 15, 2024 · 1 revision

HTTP Endpoints v3.0.0

The Influx Proxy API provides a simple way to interact with the influx proxy server. It uses HTTP response codes, HTTP authentication, and basic authentication, and responses are returned in JSON.

HTTP Endpoints

Endpoint Description
/ping Use /ping to check the status of your InfluxDB Proxy instance and your version of InfluxDB Proxy.
/query Use /query to query data and manage databases and measurements, v1 compatibility supported.
/write Use /write to write data to a pre-existing database, v1 compatibility supported.
/api/v2/query Use /api/v2/query to query data in InfluxDB 2.0+ using the InfluxDB 2.0 API and Flux.
/api/v2/write Use /api/v2/write to write data to InfluxDB 2.0+ using the InfluxDB 2.0 API.
/health Use /health to view health status of all influxdb backends.
/replica Use /replica to query replica backends with database and measurement.
/metrics Use /metrics for prometheus-formatted metrics.
/debug/pprof Use /debug/pprof to generate profiles for troubleshooting.

The following sections assume your InfluxDB Proxy instance is running on 127.0.0.1:7076 and HTTPS is not enabled.

/ping HTTP endpoint

official reference:

/query HTTP endpoint

official reference:

/write HTTP endpoint

official reference:

/api/v2/query HTTP endpoint

official reference:

/api/v2/write HTTP endpoint

official reference:

/health HTTP endpoint

Definition

GET http://127.0.0.1:7076/health

Query string parameters

Query String Parameter Optional/Required Description
pretty=true Optional Enables pretty-printed JSON output.

Example

$ curl 'http://127.0.0.1:7076/health?pretty=true'

{
    "checks": [],
    "circles": [
        {
            "circle": {
                "id": 0,
                "name": "circle-1",
                "active": true,
                "write_only": false
            },
            "backends": [
                {
                    "name": "influxdb-1-1",
                    "url": "http://127.0.0.1:8086",
                    "active": true,
                    "backlog": false,
                    "rewriting": false,
                    "write_only": false
                }
            ]
        },
        ...
    ],
    "message": "ready for queries and writes",
    "name": "influx-proxy",
    "status": "pass",
    "version": "3.0.0"
}

Field description:

circle:

  • id: circle id
  • name: circle name
  • active: whether all influxdb instances of circle are active
  • write_only: whether circle is write-only (at least one influxdb instance is write-only)

backends:

  • name: influxdb name
  • url: influxdb url
  • active: whether the influxdb is running
  • backlog: is there failed data in the cache file to influxdb
  • rewriting: whether the cache data is being rewritten to influxdb
  • write_only: whether influxdb is write-only

/replica HTTP endpoint

Definition

GET http://127.0.0.1:7076/replica

Query string parameters

Query String Parameter Optional/Required Description
org=<org> Required Org name for replica backends query.
bucket=<bucket> Required Bucket name for replica backends query.
measurement=<measurement> Required Measurement name for replica backends query.
pretty=true Optional Enables pretty-printed JSON output.

Example

$ curl 'http://127.0.0.1:7076/replica?org=org1&bucket=bucket1&measurement=cpu1&pretty=true'

[
    {
        "backend": {
            "name": "influxdb-1-2",
            "url": "http://127.0.0.1:8087"
        },
        "circle": {
            "id": 0,
            "name": "circle-1"
        }
    },
    {
        "backend": {
            "name": "influxdb-2-2",
            "url": "http://127.0.0.1:8089"
        },
        "circle": {
            "id": 1,
            "name": "circle-2"
        }
    }
]

/metrics HTTP endpoint

official reference:

/debug/pprof HTTP endpoint

official reference: