influxdata / influxdata/influxdb

Implement influxdb write provider for local storage writes

Open
#21,835 0 comments 0 reactions 0 assignees View on GitHub
team/query
Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

Flux has a dependency system where users of the Flux library can inject implementations of dependencies that Flux will use in native functions. One of the more recent ones is an influxdb provider that implements ways to access an InfluxDB instance for the influxdb functions to work.

We recently merged a Flux-native version of `experimental.to()` [here](https://github.com/influxdata/flux/pull/3848). The benefit of this is that it both supports remote writes and local writes. In order to properly utilize this native version, we need to implement our own provider that implements support for local writes. A local write is one where there is no host specified and the organization is also not specified. If the `experimental.to()` function is used in this circumstance, it will write the data to the bucket within the organization of the current request using the already provided authorization.

This [PR](https://github.com/influxdata/influxdb/pull/21834) was created in order to allow the existing OSS code to avoid an incompatibility with the existing native code.

DOD:
- The `WriterFor` function is implemented by the `influxdb.Provider` implementation.
- This function will use the http provider if a host or organization is provided.
- It checks that the existing token can write to the given bucket when performing a local write.
- The existing `experimental.to()` code that is in influxdb is removed.
- Tests exist for this behavior.

Contributor guide

Open the contributing guide

Research direction

Locate the influxdb.Provider implementation and its WriterFor entry point, then read the existing HTTP provider and influxdb experimental.to() code. Trace how local writes identify the current request's organization and authorization, and inspect nearby tests. Done means local and remote routing, bucket-write authorization checks, removal of the old code, and coverage for the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.