Skip to content

Commit

Permalink
Merge pull request influxdata#145 from influxdata/fix-network
Browse files Browse the repository at this point in the history
fix(network): removing bucket, fixing formatting
  • Loading branch information
mhall119 authored Jul 7, 2020
2 parents 37ad95e + 9828c42 commit 4e0a225
Showing 1 changed file with 15 additions and 31 deletions.
46 changes: 15 additions & 31 deletions network_interface_performance/network_interface_performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,7 @@ spec:
name: network_host
query: |-
import "influxdata/influxdb/v1"
v1.measurementTagValues(bucket: v.bucket, measurement: "net", tag: "host")
type: query
---
apiVersion: influxdata.com/v2alpha1
kind: Variable
metadata:
name: relaxed-dijkstra-c26003
spec:
language: flux
name: bucket
query: |-
buckets()
|> filter(fn: (r) => r.name !~ /^_/)
|> rename(columns: {name: "_value"})
|> keep(columns: ["_value"])
v1.measurementTagValues(bucket: "network_data", measurement: "net", tag: "host")
type: query
---
apiVersion: influxdata.com/v2alpha1
Expand All @@ -32,7 +18,7 @@ spec:
language: flux
name: network_interface
query: |-
from(bucket: v.bucket)
from(bucket: "network_data")
|> range(start: -24h)
|> filter(fn: (r) => r._measurement == "net")
|> filter(fn: (r) => r.host == v.network_host)
Expand Down Expand Up @@ -61,7 +47,7 @@ spec:
- query: |-
import "system"
import "influxdata/influxdb/v1"
data = from(bucket: v.bucket)
data = from(bucket: "network_data")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "net")
|> filter(fn: (r) => r._field =~ /^bytes_/)
Expand Down Expand Up @@ -101,7 +87,7 @@ spec:
position: overlaid
queries:
- query: |-
from(bucket: v.bucket)
from(bucket: "network_data")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "net")
|> filter(fn: (r) => r._field == "drop_in" or r._field == "err_in")
Expand All @@ -113,7 +99,7 @@ spec:
|> map(fn: (r) => ({ r with _field: if r._field == "drop_in" then "Ingress Discards" else "Ingress Errors" }))
|> drop(columns: ["_start", "_stop"])
- query: |-
from(bucket: v.bucket)
from(bucket: "network_data")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "net")
|> filter(fn: (r) => r._field == "drop_out" or r._field == "err_out")
Expand Down Expand Up @@ -154,7 +140,7 @@ spec:
position: overlaid
queries:
- query: |-
from(bucket: v.bucket)
from(bucket: "network_data")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "net")
|> filter(fn: (r) => r._field == "packets_sent")
Expand All @@ -167,7 +153,7 @@ spec:
|> map(fn: (r) => ({ r with _value: r._value * -1.0 }))
|> drop(columns: ["_start", "_stop"])
- query: |-
from(bucket: v.bucket)
from(bucket: "network_data")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "net")
|> filter(fn: (r) => r._field == "packets_recv")
Expand Down Expand Up @@ -207,7 +193,7 @@ spec:
position: overlaid
queries:
- query: |-
from(bucket: v.bucket)
from(bucket: "network_data")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "net")
|> filter(fn: (r) => r._field == "bytes_sent")
Expand All @@ -220,7 +206,7 @@ spec:
|> map(fn: (r) => ({ r with _value: r._value * -8.0 }))
|> drop(columns: ["_start", "_stop"])
- query: |-
from(bucket: v.bucket)
from(bucket: "network_data")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "net")
|> filter(fn: (r) => r._field == "bytes_recv")
Expand All @@ -247,7 +233,8 @@ spec:
- query: |-
import "system"
import "influxdata/influxdb/v1"
data =from(bucket: v.bucket)
data =from(bucket: "network_data")
|> range(start: v.timeRangeStart, stop:v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "net")
|> filter(fn: (r) => r._field =~ /^packets_/)
Expand Down Expand Up @@ -275,7 +262,7 @@ spec:
- query: |-
import "system"
import "influxdata/influxdb/v1"
data = from(bucket: v.bucket)
data = from(bucket: "network_data")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "net")
|> filter(fn: (r) => r._field =~ /^drop_/)
Expand All @@ -302,7 +289,7 @@ spec:
- query: |-
import "system"
import "influxdata/influxdb/v1"
data = from(bucket: v.bucket)
data = from(bucket: "network_data")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "net")
|> filter(fn: (r) => r._field =~ /^err_/)
Expand Down Expand Up @@ -333,7 +320,7 @@ spec:
name: Active Interfaces
queries:
- query: |-
from(bucket: v.bucket)
from(bucket: "network_data")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "net")
|> filter(fn: (r) => r._field == "bytes_sent" or r._field == "bytes_recv")
Expand Down Expand Up @@ -533,9 +520,7 @@ spec:
retentionRules:
- everySeconds: 604800
type: expire
########################################################################################
# Network Error Check #
########################################################################################
---
apiVersion: influxdata.com/v2alpha1
kind: CheckThreshold
metadata:
Expand All @@ -548,7 +533,6 @@ spec:
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "net")
|> filter(fn: (r) => r["_field"] == "err_in")
|> filter(fn: (r) => r["host"] == "Richards-MacBook-Pro.local")
|> aggregateWindow(every: 1m, fn: mean)
|> yield(name: "mean")
status: active
Expand Down

0 comments on commit 4e0a225

Please sign in to comment.