mneudert/instream
65.4
Adequate · 18 September 2026
2.5k
lines of production code
Elixir
primary language
1
measurement over time
What this system is
Instream is an Elixir driver for InfluxDB that supports both v1.x and v2.x APIs through a unified connection and query interface. It enables users to execute Flux and InfluxQL queries, write data via line protocol or UDP, and decode responses into strongly typed series structs with compile-time validation. The system handles version-specific routing, authentication, and structured logging while abstracting HTTP communication and JSON serialization.
How it got here
2015 — InfluxDB v2 support and architectural refactoring
14 changes.
This period focused on refactoring the Instream library to support InfluxDB v2.x while maintaining v1.x compatibility, introducing version-specific connection runners and authentication methods. Significant work was done on data handling, including new series hydration, validation logic, and a dedicated line protocol encoder for efficient data ingestion. The development environment was also standardized with comprehensive test infrastructure, linting tools, and coverage settings.
2016–2021 — HTTP client migration and v2 support
11 changes.
This period focused on modernizing the library's infrastructure by introducing a Hackney-based HTTP client and implementing comprehensive structured logging with password redaction. Significant effort was dedicated to supporting InfluxDB v2.x through new CSV decoding capabilities and extensive test coverage for both v1 and v2 connection and writer modules.
2022 — InfluxDB v2 test coverage expansion
4 changes.
This period focused on expanding test coverage for the InfluxDB v2 integration by adding comprehensive test suites for the series hydrator, data deleter, and Line protocol writers. The work included creating helper modules for connection and series definitions to support these new tests, ensuring correct data serialization, hydration, and deletion logic.
Features
Add CSV decoder with InfluxDB v2.x datatype annotation support
Users can now decode InfluxDB v2.x CSV responses that include datatype annotations (such as boolean, long, double, duration, base64Binary, and RFC3339 date/time formats) into properly typed Elixir maps. The new \Instream.Decoder.CSV\ module handles multiple CSV tables, applies default values for empty fields, and converts specific values like "true"/"false" booleans and "infinity" doubles to their corresponding Elixir atoms or types. A supporting \Instream.Decoder.RFC3339\ module ensures accurate nanosecond-precision timestamp conversion.
lib/instream/decoder · high confidence
Add Instream module with comprehensive usage documentation
The new \Instream\ module provides the main entry point for the InfluxDB driver, featuring detailed documentation on establishing connections for both InfluxDB v1.x and v2.x, executing Flux and InfluxQL queries with parameter binding and timeout configuration, writing data points via Series modules or plain maps, and deleting data in v2.x environments.
lib · high confidence
Adds project configuration and tooling files
The repository now includes configuration files for the Credo linter, Dialyzer, and Elixir formatter, along with a CHANGELOG, README, license, and test coverage settings. These files establish the project's coding standards, documentation, and development environment setup.
(repo-wide) · high confidence
Adds structured logging for InfluxDB requests with password redaction
This change introduces a new default logging system for Instream that captures structured data for ping, query, status, write, and delete operations. For users, this means request details are now logged at the debug level, including the number of points written, the query result, and the delete predicate. Crucially, passwords included in query strings are automatically redacted before being logged to prevent credential leakage. The system also attaches common metadata, such as query time and response status, to each log entry.
lib/instream/log · high confidence
Introduce Hackney-based HTTP client and case-insensitive header lookup
The library now includes a new HTTP client implementation using the \:hackney\ library (\Instream.HTTPClient.Hackney\), which wraps \:hackney.request/5\ to handle HTTP requests and extract response bodies. Additionally, a new utility module \Instream.HTTPClient.Headers\ provides case-insensitive header lookup by normalizing header names to lowercase during comparison, ensuring consistent header retrieval regardless of casing in the response.
_lib/instream/http\client · high confidence
New Line Protocol Encoder Module
A new dedicated module for encoding data points into the InfluxDB line protocol has been introduced. This module handles the serialization of measurements, tags, and fields, ensuring that keys are sorted for consistent output and special characters are properly escaped. It supports integer and RFC3339 binary timestamps, converting them to nanosecond precision integers, and allows timestamps to be omitted or set to nil.
lib/instream/encoder · high confidence
Support for InfluxDB line protocol and UDP writes
Users can now write data using the InfluxDB line protocol via new \Instream.Writer.Line\ (dispatching to v1 or v2 specific writers) and \Instream.Writer.UDP\ modules. The line protocol writers handle HTTP POST requests with appropriate headers and URL construction for their respective API versions, while the UDP writer enables asynchronous or synchronous point transmission via a process pool, allowing for high-throughput, low-latency data ingestion.
lib/instream/writer · high confidence
Behavioural changes
Configures test logger format
The application now includes a dedicated configuration file that sets the console logger format specifically for the test environment. This change ensures that test logs include query times and response status metadata, providing more detailed visibility into test execution without affecting other environments.
config · high confidence
New series hydration and validation logic
The library now includes a dedicated hydrator and validator for InfluxDB series structs. The hydrator converts raw query result maps (including pivoted CSV results and InfluxQL GROUP BY outputs) into strongly typed series structs, handling timestamp conversion from both integers and RFC3339 strings. The validator enforces stricter series definitions by requiring explicit field and measurement definitions, forbidding the use of reserved keys like '\_field', '\_measurement', and 'time' as user-defined fields or tags, and raising errors if a name is used for both a field and a tag.
lib/instream/series · high confidence
Refactored connection architecture with version-specific query runners and JSON library abstraction
The connection module has been restructured to support InfluxDB v1 and v2 through separate \QueryRunner\ and \ResponseParser\ implementations, ensuring version-specific behavior for queries, writes, and response parsing. A new \Config\ module centralizes connection configuration, supporting application, runtime, and inline setup methods, while a dedicated \JSON\ module abstracts encoding and decoding to allow flexible JSON library integration (defaulting to Jason). The \Supervisor\ now handles connection initialization and worker management, providing a cleaner supervision tree for connection processes.
lib/instream/connection · high confidence
Reworked connection and series APIs for InfluxDB v1/v2 support
The library introduces a new \Instream.Connection\ module that manages server connections and routes operations to version-specific runners (\QueryRunnerV1\/\QueryRunnerV2\), enabling support for InfluxDB v2.x features like buckets and organizations while maintaining v1.x compatibility. A new \Instream.Series\ module allows users to define structured data points with compile-time validation, default values, and hydration from query results. The \Instream.Writer\ behaviour is simplified to focus on point writing, and the \Instream.HTTPClient\ provides a switchable interface for HTTP requests.
lib/instream · high confidence
Support for InfluxDB v2 query and write endpoints with flexible authentication and encoding
The library now supports InfluxDB v2 connections by routing queries to the \/api/v2/query\ endpoint and writes to \/api/v2/write\, while maintaining v1 compatibility via the legacy \/query\ and \/write\ paths. Users can now specify individual time precision (epoch) for read and write operations, choose response encoding formats such as CSV or JSON, and select the query language (Flux or InfluxQL). Authentication is handled via headers for Bearer tokens, API tokens, or Basic Auth, replacing the previous method of passing credentials as URL parameters for v2 connections.
lib/instream/query · high confidence
Test coverage
Added Line Protocol encoder benchmark; Added connection integration tests; Added connection tests for InfluxDB v2; Added test coverage for InfluxDB v1 connection behaviors; Added test coverage for InfluxDB v2 connection authorization, bucket/org priority, and response parsing; Added test helper modules for connection and series definitions; Added tests for InfluxDB v1 line and UDP writers; Added tests for InfluxDB v2 Line protocol writers; Added tests for InfluxDB v2 data deletion logic; Added tests for series definition defaults and metadata; Added tests for series hydration and validation; Added tests for the CSV decoder; Added tests for the InfluxDB v2 series hydrator; Added tests for the Line protocol encoder; Added tests for the default logger's request logging behavior; Adds test infrastructure for InfluxDB query headers and version-specific test configuration.
Dependencies
Initial release of Instream 2.3.0-dev with Elixir 1.9+ and modern dependency stack
This entry introduces the initial project configuration for Instream, an InfluxDB driver for Elixir, setting the development version to 2.3.0-dev. It establishes a minimum Elixir requirement of 1.9 and defines the core runtime dependencies, including hackney for HTTP communication, influxql for query formatting, jason for JSON handling, nimble\_csv for CSV parsing, and poolboy for connection pooling. The configuration also includes development and test dependencies such as credo, dialyxir, ex\_doc, excoveralls, and mox, alongside a benchmarking tool (benchee). The project is configured to generate HTML documentation, run dialyzer checks with specific flags, and publish to Hex under the Apache-2.0 license.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 65.
Lenses
- Code Health 99
- Architecture 93
- Maturity 47
- Readiness 83
- Security 76
Changes since last survey
- 300 commits — 287 feature/other, 13 fixes
By area
- (root) — 81 commits
- lib/instream — 79 commits
- .github/workflows — 65 commits
- test/influxdb_v1 — 23 commits
- test/influxdb_v2 — 18 commits
- test/instream — 18 commits
- lib/instream.ex — 9 commits
- config/config.exs — 3 commits
- test/test_helper.exs — 2 commits
- (repo) — 1 commit
- test/helpers — 1 commit
Notable commits
- fix: Fix (default) query language header for InfluxDB v2.x (#77)
- fix: Fix Elixir 1.15.0 deprecations
- fix: Fix InfluxDB v1.8 testing environment
- fix: Fix UDP writer test configuration
- fix: Fix multiple line breaks in response (#73)
- fix: Fix parsing double type without decimal point (#68)
- fix: Fix precision usage example
- fix: Fix setup of InfluxDB v2.x dbrp mapping
- fix: Fix socket test initializer
- fix: Fix spec of write/3 of Instream.Connection.{QueryRunnerV1, QueryRunnerV2} (#74)
- fix: Fix test values passed for bucket/org override testing
- fix: Fix the pool_timeout param usage (#81)
- fix: Fix typespec for Config.get/4
- change: Add "location: :keep" to relevant macros
- change: Add "test" branch to run-on-push action config
- change: Add @impl attributes to series functions
- change: Add Elixir 1.11.x to InfluxDB v2.x matrix
- change: Add Elixir 1.13.x to testing matrix
- change: Add Elixir 1.14.x to testing matrix
- change: Add Elixir 1.15.x to testing matrix
- …and 280 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
mneudert/instream was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 18 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 4852c3785aea866a0f684d2c8af8ed93cab6d2a3 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-5d04157a340d.