influxdata / influxdata/influxdb

JSON Data format for Flux Queries

Open
#16,913 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/api area/flux kind/enhancement
Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

__Proposal:__
Add JSON output support for Flux queries.

__Current behavior:__
Currently, when executing queries using the HTTP API with the Flux language, the resulting data is returned ONLY in CSV format. Link: [InfluxDB API](https://docs.influxdata.com/flux/v0.50/guides/executing-queries/#influxdb-api)

__Desired behavior:__
It would be incredibly useful if the HTTP API (or all other subsequent APIs) had an option to return data in JSON format, rather than CSV.

__Alternatives considered:__
The alternative to this is to use a CSV to JSON transformer, but on large datasets, this can be an expensive operation and time consuming.

__Use case:__
It's 2020. Given the vast amount of APIs that primarily use JSON as their data-interchange format, you would think a modern database like InfluxDB could return data in a more structured and portable format other than CSV. Almost all of our services use JSON as the data exchange format, and we would really like to leverage the power of Flux and InfluxDB. Unfortunately, due to this limitation, we are unable to use Flux and InfluxDB.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue points to the Flux HTTP API documentation for the current CSV response behavior. Review that API path and determine how JSON output should be exposed across the relevant APIs. Done means Flux query results can be requested and returned in JSON without requiring a CSV-to-JSON conversion.

Written by the indexing model from the issue text.

Assessment

Tech stack
json
Domain
api, database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.