SlideShare a Scribd company logo
Nathaniel Cook
Increasing Reuse and
Time to Awesome by
Using Flux Packages
Write and share your Flux code
Flux Packages Coming Soon
© 2019 InfluxData. All rights reserved. 3
What are Flux packages?
● Flux source code
● Name
● Version
● Other Metadata
Anatomy of a Flux Package
© 2019 InfluxData. All rights reserved. 5
Create a Flux package
alerts/
package.flux
check.flux
notify.flux
// package.flux
package alerts
option package = {
version: "0.3.1",
dependencies: [{
package: "alerta",
version: "1.0.0"
}]
}
A package for consistently downsampling data across teams
Example: Consistent Downsampling
© 2019 InfluxData. All rights reserved. 7
Downsampling Package
//downsample.flux
package downsample
bucket = "downsampled_5m"
every = 5m
mean = (tables=<-) =>
tables
|> aggregateWindow(every: every, fn: mean)
|> set(key: "agg", value: "mean")
|> to(bucket: bucket)
© 2019 InfluxData. All rights reserved. 8
Package Tests
//downsample_test.flux
package downsample_test
import "downsample"
test mean = () => ({
input: ...,
want: ...,
fn: downsample.mean,
})
© 2019 InfluxData. All rights reserved. 9
Package
//package.flux
package downsample
option package = {
version: "0.3.1",
}
A package for monitoring services using the RED method
Example: RED Alerts
© 2019 InfluxData. All rights reserved. 11
RED Package
// red.flux
package red
import "influxdata/influxdb/monitoring"
requestsCheck = ...
errorsCheck = ...
durationsCheck = ...
© 2019 InfluxData. All rights reserved. 12
//package.flux
package red
option package = {
version: "0.32.1",
dependencies: [{
package: "influxdata/influxdb/monitor",
version: "1.0.0"
}]
}
Details on how packages function
Flux Package Mechanics
© 2019 InfluxData. All rights reserved. 14
Package Lookup
FLUX_PATH is an environment variable that defines a list of
directories to search for packages.
1. Search for directory of the form $FLUX_PATH/pauldix/foo
2. Search for version directory of the form
$FLUX_PATH/pauldix/foo/_version/v0.3.5
3. Search public registry for package (optionally download and
cache into FLUX_PATH)
© 2019 InfluxData. All rights reserved. 15
Dependency Resolution
What if the same dependency is used by more than one
dependent package?
Flux will pick the maximum version of the provided minimum
versions.
© 2019 InfluxData. All rights reserved. 16
Max of Mins Version Selection
package endpoints
option package = {
version: "1.5.1",
dependencies: [{
package: "alerta",
version: "1.2.1"
}]
}
package alerts
option package = {
version: "0.3.1",
dependencies: [{
package: "alerta",
version: "1.0.0"
}]
}
A short introduction
Semantic Versioning
© 2019 InfluxData. All rights reserved. 18
What is a semantic version?
v1.35.8
Major Minor Patch
© 2019 InfluxData. All rights reserved. 19
Major Versions
Different major versions of a package will be treated as a
separate package.
package foo
import "nathanielc/downsample"
import d2 "nathanielc/downsample@2"
A place to publish and share Flux packages
Flux Package Registry
© 2019 InfluxData. All rights reserved. 21
Package Registry
● User Account to authenticate with Registry
● Packages are Immutable
● Namespaced by a user or organization
● Semantically Versioned
© 2019 InfluxData. All rights reserved. 22
Influx CLI Utility
$ # Initialize a new package directory tree
$ influx package init
$ # Run all tests in the package directory
$ influx package test
$ # Publish the package to the registry
$ influx package publish
Flux is a
community
Let us know what you think about packages

More Related Content

PDF
Where Flux and InfluxDB Are Headed | Paul Dix | InfluxData
PDF
Monitoring and Alerting with InfluxDB 2.0 | Nate Isley & Deniz Kusefoglu | In...
PPTX
PHP Dependency Management with Composer
PDF
Dependency management with Composer
PDF
Create your own composer package
PPTX
Composer | PHP Dependency Manager
PDF
Dockerizing Symfony Applications - Symfony Live Berlin 2014
 
PDF
Fluentd v1.0 in a nutshell
Where Flux and InfluxDB Are Headed | Paul Dix | InfluxData
Monitoring and Alerting with InfluxDB 2.0 | Nate Isley & Deniz Kusefoglu | In...
PHP Dependency Management with Composer
Dependency management with Composer
Create your own composer package
Composer | PHP Dependency Manager
Dockerizing Symfony Applications - Symfony Live Berlin 2014
 
Fluentd v1.0 in a nutshell

What's hot (20)

PPT
Subversion Admin
PPTX
PHP development with Docker
ODP
"MagicBox" 16 - Codename Horn
PPT
]project-open[ Package Manager
PDF
Fluentd v0.14 Plugin API Details
PPTX
Composer JSON kills make files
PDF
Internationalizing Ubuntu apps
PPTX
Dockerizing a Symfony2 application
PDF
How to deploy PHP projects with docker
PDF
$ make install
PDF
Fluentd v0.12 master guide
PDF
Fluentd Meetup 2016 - ServerEngine Integration & Windows support
PDF
Dockerize your Symfony application - Symfony Live NYC 2014
PPTX
Deploying Symfony2 app with Ansible
PDF
Itb2018 cf apps to dev to production with command box cf-config docker
PPTX
Dockerize Me: Distributed PHP applications with Symfony, Docker, Consul and A...
PPTX
Apache web server
PPTX
G rpc lection1
PDF
Enterprise desktop at home with FreeIPA and GNOME
Subversion Admin
PHP development with Docker
"MagicBox" 16 - Codename Horn
]project-open[ Package Manager
Fluentd v0.14 Plugin API Details
Composer JSON kills make files
Internationalizing Ubuntu apps
Dockerizing a Symfony2 application
How to deploy PHP projects with docker
$ make install
Fluentd v0.12 master guide
Fluentd Meetup 2016 - ServerEngine Integration & Windows support
Dockerize your Symfony application - Symfony Live NYC 2014
Deploying Symfony2 app with Ansible
Itb2018 cf apps to dev to production with command box cf-config docker
Dockerize Me: Distributed PHP applications with Symfony, Docker, Consul and A...
Apache web server
G rpc lection1
Enterprise desktop at home with FreeIPA and GNOME
Ad

Similar to Increasing Reuse and Time to Awesome by Using Flux Packages | Nathaniel Cook | InfluxData (20)

PDF
Nathaniel Cook [InfluxData] | Scripting Languages Demonstration: Flux |> | In...
PPTX
Developing Your Own Flux Packages by David McKay | Head of Developer Relation...
PPTX
InfluxDB Roadmap: What’s New and What’s Coming
PDF
Flux QL - Nexgen Management of Time Series Inspired by JS
PDF
Time Series Tech Stack for the IoT Edge
ODP
Fluxxor react library
PDF
Introduction to InfluxDB 2.0 & Your First Flux Query by Sonia Gupta, Develope...
PDF
Russ Savage [Ngrok] | InfluxDB QuickStart | InfluxDays NA 2021
PDF
Intro to InfluxDB
PDF
Michael Hall [InfluxData] | Become an InfluxDB Pro in 20 Minutes | InfluxDays...
PPTX
Anais Dotis-Georgiou & Faith Chikwekwe [InfluxData] | Top 10 Hurdles for Flux...
PDF
Kristina Robinson [InfluxData] | Understand and Visualize Your Data with Infl...
PDF
Balaji Palani [InfluxData] | InfluxDB Tasks Overview | InfluxDays 2022
PPTX
Intro to InfluxDB 2.0 and Your First Flux Query by Sonia Gupta
PPTX
PURL and vers: The Mostly Universal Package URL and Version Ranges Identifier...
PDF
FASTEN: Scaling static analyses to ecosystem, presented at FOSDEM 2020 in Bru...
PDF
Vinay Kumar [InfluxData] | InfluxDB API Overview | InfluxDays 2022
PPTX
Using Grafana with InfluxDB 2.0 and Flux Lang by Jacob Lisi
PDF
Fasten Industry Meeting with GitHub about Dependancy Management
PDF
Dependency Issues in Open Source Software Package Registries
Nathaniel Cook [InfluxData] | Scripting Languages Demonstration: Flux |> | In...
Developing Your Own Flux Packages by David McKay | Head of Developer Relation...
InfluxDB Roadmap: What’s New and What’s Coming
Flux QL - Nexgen Management of Time Series Inspired by JS
Time Series Tech Stack for the IoT Edge
Fluxxor react library
Introduction to InfluxDB 2.0 & Your First Flux Query by Sonia Gupta, Develope...
Russ Savage [Ngrok] | InfluxDB QuickStart | InfluxDays NA 2021
Intro to InfluxDB
Michael Hall [InfluxData] | Become an InfluxDB Pro in 20 Minutes | InfluxDays...
Anais Dotis-Georgiou & Faith Chikwekwe [InfluxData] | Top 10 Hurdles for Flux...
Kristina Robinson [InfluxData] | Understand and Visualize Your Data with Infl...
Balaji Palani [InfluxData] | InfluxDB Tasks Overview | InfluxDays 2022
Intro to InfluxDB 2.0 and Your First Flux Query by Sonia Gupta
PURL and vers: The Mostly Universal Package URL and Version Ranges Identifier...
FASTEN: Scaling static analyses to ecosystem, presented at FOSDEM 2020 in Bru...
Vinay Kumar [InfluxData] | InfluxDB API Overview | InfluxDays 2022
Using Grafana with InfluxDB 2.0 and Flux Lang by Jacob Lisi
Fasten Industry Meeting with GitHub about Dependancy Management
Dependency Issues in Open Source Software Package Registries
Ad

More from InfluxData (20)

PPTX
Announcing InfluxDB Clustered
PDF
Best Practices for Leveraging the Apache Arrow Ecosystem
PDF
How Bevi Uses InfluxDB and Grafana to Improve Predictive Maintenance and Redu...
PDF
Power Your Predictive Analytics with InfluxDB
PDF
How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
PDF
Build an Edge-to-Cloud Solution with the MING Stack
PDF
Meet the Founders: An Open Discussion About Rewriting Using Rust
PDF
Introducing InfluxDB Cloud Dedicated
PDF
Gain Better Observability with OpenTelemetry and InfluxDB
PPTX
How a Heat Treating Plant Ensures Tight Process Control and Exceptional Quali...
PDF
How Delft University's Engineering Students Make Their EV Formula-Style Race ...
PPTX
Introducing InfluxDB’s New Time Series Database Storage Engine
PDF
Start Automating InfluxDB Deployments at the Edge with balena
PDF
Understanding InfluxDB’s New Storage Engine
PDF
Streamline and Scale Out Data Pipelines with Kubernetes, Telegraf, and InfluxDB
PPTX
Ward Bowman [PTC] | ThingWorx Long-Term Data Storage with InfluxDB | InfluxDa...
PDF
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
PDF
Steinkamp, Clifford [InfluxData] | Closing Thoughts | InfluxDays 2022
PDF
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
PDF
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
Announcing InfluxDB Clustered
Best Practices for Leveraging the Apache Arrow Ecosystem
How Bevi Uses InfluxDB and Grafana to Improve Predictive Maintenance and Redu...
Power Your Predictive Analytics with InfluxDB
How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
Build an Edge-to-Cloud Solution with the MING Stack
Meet the Founders: An Open Discussion About Rewriting Using Rust
Introducing InfluxDB Cloud Dedicated
Gain Better Observability with OpenTelemetry and InfluxDB
How a Heat Treating Plant Ensures Tight Process Control and Exceptional Quali...
How Delft University's Engineering Students Make Their EV Formula-Style Race ...
Introducing InfluxDB’s New Time Series Database Storage Engine
Start Automating InfluxDB Deployments at the Edge with balena
Understanding InfluxDB’s New Storage Engine
Streamline and Scale Out Data Pipelines with Kubernetes, Telegraf, and InfluxDB
Ward Bowman [PTC] | ThingWorx Long-Term Data Storage with InfluxDB | InfluxDa...
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022

Recently uploaded (20)

PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PDF
August Patch Tuesday
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PDF
Unlock new opportunities with location data.pdf
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PDF
CloudStack 4.21: First Look Webinar slides
PPTX
The various Industrial Revolutions .pptx
PPTX
Modernising the Digital Integration Hub
PDF
Getting started with AI Agents and Multi-Agent Systems
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
Getting Started with Data Integration: FME Form 101
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
A review of recent deep learning applications in wood surface defect identifi...
PDF
Developing a website for English-speaking practice to English as a foreign la...
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
Hindi spoken digit analysis for native and non-native speakers
NewMind AI Weekly Chronicles – August ’25 Week III
August Patch Tuesday
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
Unlock new opportunities with location data.pdf
Module 1.ppt Iot fundamentals and Architecture
Taming the Chaos: How to Turn Unstructured Data into Decisions
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
CloudStack 4.21: First Look Webinar slides
The various Industrial Revolutions .pptx
Modernising the Digital Integration Hub
Getting started with AI Agents and Multi-Agent Systems
1 - Historical Antecedents, Social Consideration.pdf
Getting Started with Data Integration: FME Form 101
A contest of sentiment analysis: k-nearest neighbor versus neural network
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
A review of recent deep learning applications in wood surface defect identifi...
Developing a website for English-speaking practice to English as a foreign la...
Enhancing emotion recognition model for a student engagement use case through...
Hindi spoken digit analysis for native and non-native speakers

Increasing Reuse and Time to Awesome by Using Flux Packages | Nathaniel Cook | InfluxData

  • 1. Nathaniel Cook Increasing Reuse and Time to Awesome by Using Flux Packages
  • 2. Write and share your Flux code Flux Packages Coming Soon
  • 3. © 2019 InfluxData. All rights reserved. 3 What are Flux packages? ● Flux source code ● Name ● Version ● Other Metadata
  • 4. Anatomy of a Flux Package
  • 5. © 2019 InfluxData. All rights reserved. 5 Create a Flux package alerts/ package.flux check.flux notify.flux // package.flux package alerts option package = { version: "0.3.1", dependencies: [{ package: "alerta", version: "1.0.0" }] }
  • 6. A package for consistently downsampling data across teams Example: Consistent Downsampling
  • 7. © 2019 InfluxData. All rights reserved. 7 Downsampling Package //downsample.flux package downsample bucket = "downsampled_5m" every = 5m mean = (tables=<-) => tables |> aggregateWindow(every: every, fn: mean) |> set(key: "agg", value: "mean") |> to(bucket: bucket)
  • 8. © 2019 InfluxData. All rights reserved. 8 Package Tests //downsample_test.flux package downsample_test import "downsample" test mean = () => ({ input: ..., want: ..., fn: downsample.mean, })
  • 9. © 2019 InfluxData. All rights reserved. 9 Package //package.flux package downsample option package = { version: "0.3.1", }
  • 10. A package for monitoring services using the RED method Example: RED Alerts
  • 11. © 2019 InfluxData. All rights reserved. 11 RED Package // red.flux package red import "influxdata/influxdb/monitoring" requestsCheck = ... errorsCheck = ... durationsCheck = ...
  • 12. © 2019 InfluxData. All rights reserved. 12 //package.flux package red option package = { version: "0.32.1", dependencies: [{ package: "influxdata/influxdb/monitor", version: "1.0.0" }] }
  • 13. Details on how packages function Flux Package Mechanics
  • 14. © 2019 InfluxData. All rights reserved. 14 Package Lookup FLUX_PATH is an environment variable that defines a list of directories to search for packages. 1. Search for directory of the form $FLUX_PATH/pauldix/foo 2. Search for version directory of the form $FLUX_PATH/pauldix/foo/_version/v0.3.5 3. Search public registry for package (optionally download and cache into FLUX_PATH)
  • 15. © 2019 InfluxData. All rights reserved. 15 Dependency Resolution What if the same dependency is used by more than one dependent package? Flux will pick the maximum version of the provided minimum versions.
  • 16. © 2019 InfluxData. All rights reserved. 16 Max of Mins Version Selection package endpoints option package = { version: "1.5.1", dependencies: [{ package: "alerta", version: "1.2.1" }] } package alerts option package = { version: "0.3.1", dependencies: [{ package: "alerta", version: "1.0.0" }] }
  • 18. © 2019 InfluxData. All rights reserved. 18 What is a semantic version? v1.35.8 Major Minor Patch
  • 19. © 2019 InfluxData. All rights reserved. 19 Major Versions Different major versions of a package will be treated as a separate package. package foo import "nathanielc/downsample" import d2 "nathanielc/downsample@2"
  • 20. A place to publish and share Flux packages Flux Package Registry
  • 21. © 2019 InfluxData. All rights reserved. 21 Package Registry ● User Account to authenticate with Registry ● Packages are Immutable ● Namespaced by a user or organization ● Semantically Versioned
  • 22. © 2019 InfluxData. All rights reserved. 22 Influx CLI Utility $ # Initialize a new package directory tree $ influx package init $ # Run all tests in the package directory $ influx package test $ # Publish the package to the registry $ influx package publish
  • 23. Flux is a community Let us know what you think about packages