Skip to content

Commit

Permalink
2.0 influxdb updates (#553)
Browse files Browse the repository at this point in the history
* swap legacy regexmatch w/ official influxql parser
  • Loading branch information
James Ranson authored Mar 16, 2021
1 parent ba6119f commit a095094
Show file tree
Hide file tree
Showing 134 changed files with 34,411 additions and 2,780 deletions.
245 changes: 245 additions & 0 deletions .spelling
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
# markdown-spellcheck spelling configuration file
# Format - lines beginning # are comments
# global dictionary is at the start, file overrides afterwards
# one word per line, to define a file override use ' - filename'
# where filename is relative to this configuration file
ALB
config
tsm
tsdb
backends
fgr
nlm
backend
configs
robiner
uint64
TS
HLS
ALBs
bbolt
badgerdb
redis
conf
example.full.yaml
golang
sync.Map
kubernetes
startup
tmp
boltdb
CoreOS's
datastore
lifecycle
setups
kube
roundtrip
kmiss
rmiss
phit
nchit
rhit
fulfill
clickhouse
datasource
plugin
grafana
vertamedia
timestamp
time_col
prewhere
intdiv
touint32
datetime
timeseries
parsable
todatetime
waitlisting
waitlisted
PCF
waitlist
favorite
lighttpd
nginx
ws
io
ENV
args
pprof
SIGHUP
yaml
struct
testdata
nosql
marshaling
unmarshaling
modeling
DeltaProxyCache
unmarshal
CTSF
marshalers
unmarshalers
modeler
unmarshaled
http.Handlers
PathConfigs
HealthCheck
timeseries.TimeRangeQuery
deserialize
regex
timerange
builtin
SetExtent
datapoints
datapoint
tricksterproxy
opentelemetry
todo
jaeger
promsim
behavior
InfluxDB
2xx
thresholding
metrics.md
8481
configuring.md
client_golang
cpu
Pathing
upstreams
hostname
fqdn
cacheability
TOML
1.16
csv
chronograf
brotli
tricktool
url
favor
pathing
v1.1
multipart
dearticulation
fulfillments
200
1.1
mockster
standalone
objectproxycache_test.go
param
params
80
443
lowercase
32
LRU
TTLs
TRF
1024
24-hour
1440
2021
2.1
Q3
Q4
Q1
v2.0
TSDBs
CNCF
Q2
MkDocs
AWS
v2.1
ElasticSearch
datasources
Thanos
v2.2
302
input_index
16
input_source
url_no_params
example.com
8480
path1
path2
param1
input_key
input_type
eq
md5
sha1
rmatch
num
ge
gt
lt
bool
auth
v1
circonus
irondb
CAQL
frontend
unparsable
otel
go.mod
dropdown
zipkin
stdout
QueryCache
WriteCache
DeltaProxyCacheRequest
FastForward
ProxyRequest
PrepareFetchReader
CacheRevalidation
FetchObject
FetchRevalidation
v1.1.x
2.0
2
highly-cardinalized
1
300s
0's
5's
3
21p
25p
1.9
CONTRIBUTING.md
githubhandle
jranson
selfnet
e.v.
thorekr
swarmstack
mh720
hostinger
ton31337
mailerlite
mailersend
mailercheck
ycode
aorfanos
rr
400
0.x
1.x
404
137
i
o
v1.9.3
30
1.0
v5.0.0.
0
300
600
1000
100
37 changes: 37 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ PACKAGE_DIR := ./$(BUILD_SUBDIR)/trickster-$(PROGVER)
BIN_DIR := $(PACKAGE_DIR)/bin
CONF_DIR := $(PACKAGE_DIR)/conf
CGO_ENABLED ?= 0
BUMPER_FILE := ./testdata/license_header_template.txt

.PHONY: validate-app-version
validate-app-version:
Expand Down Expand Up @@ -146,3 +147,39 @@ test-cover: test
.PHONY: clean
clean:
rm -rf ./trickster ./$(BUILD_SUBDIR)

.PHONY: generate
generate: perform-generate insert-license-headers

.PHONY: perform-generate
perform-generate:
$(GO) generate ./pkg/... ./cmd/...

.PHONY: insert-license-headers
insert-license-headers:
@for file in $$(find ./pkg ./cmd -name '*.go') ; \
do \
output=$$(grep 'Licensed under the Apache License' $$file) ; \
if [[ "$$?" != "0" ]]; then \
echo "adding License Header Block to $$file" ; \
cat $(BUMPER_FILE) > /tmp/trktmp.go ; \
cat $$file >> /tmp/trktmp.go ; \
mv /tmp/trktmp.go $$file ; \
fi ; \
done

.PHONY: spelling
spelling:
@which mdspell ; \
if [[ "$$?" != "0" ]]; then \
echo "mdspell is not installed" ; \
else \
mdspell './README.md' './docs/**/*.md' ; \
fi

@which codespell ; \
if [[ "$$?" != "0" ]]; then \
echo "codespell is not installed" ; \
else \
codespell --skip='vendor,*.git,*.png,*.pdf,*.tiff,*.plist,*.pem,rangesim*.go,*.gz' --ignore-words='./testdata/ignore_words.txt' ; \
fi
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Trickster is a fully-featured HTTP Reverse Proxy Cache for HTTP applications lik

### Proxy Feature Highlights

* A unique and powerful [Application Load Balancer](./docs/alb.md) for Time Series and generic HTTP endoints
* A unique and powerful [Application Load Balancer](./docs/alb.md) for Time Series and generic HTTP endpoints
* [Supports TLS](./docs/tls.md) and HTTP/2 for frontend termination and backend origination
* Offers several options for a [caching layer](./docs/caches.md), including in-memory, filesystem, Redis and bbolt
* [Highly customizable](./docs/configuring.md), using simple yaml configuration settings, [down to the HTTP Path](./docs/paths.md)
Expand Down
11 changes: 10 additions & 1 deletion cmd/trickster/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"fmt"
"net/http"
"os"
"strings"
"sync"
"time"

Expand Down Expand Up @@ -56,8 +57,16 @@ func runConfig(oldConf *config.Config, wg *sync.WaitGroup, logger *tl.Logger,
defer cfgLock.Unlock()
var err error

sargs := make([]string, 0, len(args))
// this sanitizes the args from -test flags, which can cause issues with unit tests relying on cli args
for _, v := range args {
if !strings.HasPrefix(v, "-test.") {
sargs = append(sargs, v)
}
}

// load the config
conf, flags, err := config.Load(runtime.ApplicationName, runtime.ApplicationVersion, args)
conf, flags, err := config.Load(runtime.ApplicationName, runtime.ApplicationVersion, sargs)
if err != nil {
fmt.Println("\nERROR: Could not load configuration:", err.Error())
if flags != nil && !flags.ValidateConfig {
Expand Down
16 changes: 16 additions & 0 deletions cmd/trickster/config/defaults.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2018 Comcast Cable Communications Management, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package config

const (
Expand Down
8 changes: 4 additions & 4 deletions cmd/trickster/listeners.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func applyListenerConfigs(conf, oldConf *config.Config,
tracerFlusherSet = true
go lg.StartListener("tlsListener",
conf.Frontend.TLSListenAddress, conf.Frontend.TLSListenPort,
conf.Frontend.ConnectionsLimit, tlsConfig, router, wg, tracers, true,
conf.Frontend.ConnectionsLimit, tlsConfig, router, wg, tracers, exitFunc,
time.Duration(conf.ReloadConfig.DrainTimeoutMS)*time.Millisecond, log)
}
} else if !conf.Frontend.ServeTLS && hasOldFC && oldConf.Frontend.ServeTLS {
Expand Down Expand Up @@ -125,7 +125,7 @@ func applyListenerConfigs(conf, oldConf *config.Config,
}
go lg.StartListener("httpListener",
conf.Frontend.ListenAddress, conf.Frontend.ListenPort,
conf.Frontend.ConnectionsLimit, nil, router, wg, t2, true, 0, log)
conf.Frontend.ConnectionsLimit, nil, router, wg, t2, exitFunc, 0, log)
}

// if the Metrics HTTP port is configured, then set up the http listener instance
Expand All @@ -141,7 +141,7 @@ func applyListenerConfigs(conf, oldConf *config.Config,
wg.Add(1)
go lg.StartListener("metricsListener",
conf.Metrics.ListenAddress, conf.Metrics.ListenPort,
conf.Frontend.ConnectionsLimit, nil, metricsRouter, wg, nil, true, 0, log)
conf.Frontend.ConnectionsLimit, nil, metricsRouter, wg, nil, exitFunc, 0, log)
} else {
metricsRouter.Handle("/metrics", metrics.Handler())
metricsRouter.HandleFunc(conf.Main.ConfigHandlerPath, ph.ConfigHandleFunc(conf))
Expand All @@ -163,7 +163,7 @@ func applyListenerConfigs(conf, oldConf *config.Config,
}
go lg.StartListener("reloadListener",
conf.ReloadConfig.ListenAddress, conf.ReloadConfig.ListenPort,
conf.Frontend.ConnectionsLimit, nil, rr, wg, nil, true, 0, log)
conf.Frontend.ConnectionsLimit, nil, rr, wg, nil, exitFunc, 0, log)
} else {
rr.HandleFunc(conf.Main.ConfigHandlerPath, ph.ConfigHandleFunc(conf))
rr.Handle(conf.ReloadConfig.HandlerPath, reloadHandler)
Expand Down
Loading

0 comments on commit a095094

Please sign in to comment.