Skip to content

Commit

Permalink
Merge branch 'master' into new_hyperloglog
Browse files Browse the repository at this point in the history
  • Loading branch information
seiflotfy authored Jul 11, 2017
2 parents 9aa56db + d22f2d6 commit 4e3d7e5
Show file tree
Hide file tree
Showing 11 changed files with 374 additions and 61 deletions.
4 changes: 4 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ type Config struct {
AwsRegion string `yaml:"aws_region"`
AwsS3Bucket string `yaml:"aws_s3_bucket"`
AwsSecretAccessKey string `yaml:"aws_secret_access_key"`
DatadogAPIHostname string `yaml:"datadog_api_hostname"`
DatadogAPIKey string `yaml:"datadog_api_key"`
DatadogTraceAPIAddress string `yaml:"datadog_trace_api_address"`
Debug bool `yaml:"debug"`
EnableProfiling bool `yaml:"enable_profiling"`
FlushFile string `yaml:"flush_file"`
Expand All @@ -26,6 +29,7 @@ type Config struct {
Percentiles []float64 `yaml:"percentiles"`
ReadBufferSizeBytes int `yaml:"read_buffer_size_bytes"`
SentryDsn string `yaml:"sentry_dsn"`
SsfAddress string `yaml:"ssf_address"`
SsfBufferSize int `yaml:"ssf_buffer_size"`
StatsAddress string `yaml:"stats_address"`
Tags []string `yaml:"tags"`
Expand Down
29 changes: 29 additions & 0 deletions config_parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,35 @@ func readConfig(r io.Reader) (c Config, err error) {
c.ReadBufferSizeBytes = defaultBufferSizeBytes
}

if c.Key != "" {
log.Warn("The config key `key` is deprecated and replaced with `datadog_api_key` and will be removed in 2.0!")
// If they set the DatadogAPIKey, favor it. Otherwise, replace it.
if c.DatadogAPIKey == "" {
c.DatadogAPIKey = c.Key
}
}

if c.APIHostname != "" {
log.Warn("The config key `api_hostname` is deprecated and replaced with `datadog_api_hostname` and will be removed in 2.0!")
if c.DatadogAPIHostname == "" {
c.DatadogAPIHostname = c.APIHostname
}
}

if c.TraceAPIAddress != "" {
log.Warn("The config key `datadog_trace_api_hostname` is deprecated and replaced with `datadog_trace_api_hostname` and will be removed in 2.0!")
if c.DatadogTraceAPIAddress == "" {
c.DatadogTraceAPIAddress = c.TraceAPIAddress
}
}

if c.TraceAddress != "" {
log.Warn("The config key `trace_address` is deprecated and replaced with `ssf_address` and will be removed in 2.0!")
if c.SsfAddress == "" {
c.SsfAddress = c.TraceAddress
}
}

return c, nil
}

Expand Down
164 changes: 164 additions & 0 deletions config_spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
---
metric_max_length: 4096
trace_max_length_bytes: 16384
flush_max_per_body: 25000
enable_profiling: false
interval: "10s"

# == PERFORMANCE ==

# The size of the buffer we'll use to buffer socket reads. Tune this if you
# you think Veneur needs more room to keep up with all packets.
read_buffer_size_bytes: 2097152

# Adjusts the number of workers Veneur will distribute aggregation across.
# More decreases contention but has diminishng returns.
num_workers: 96

# Numbers larger than 1 will enable the use of SO_REUSEPORT, make sure
# this is supported on your platform!
num_readers: 1

# The number of SSF packets that can be processed
# per flush interval
ssf_buffer_size: 16384

# == AGGREGATION ==

# Set to floating point values that you'd like to putput percentiles for from
# histograms.
percentiles:
- 0.5
- 0.75
- 0.99

# Aggregations you'd like to putput for histograms. Possible values can be any
# or all of:
# - `min`: the minimum value in the histogram during the flush period
# - `max`: the maximum value in the histogram during the flush period
# - `median`: the median value in the histogram during the flush period
# - `avg`: the average value in the histogram during the flush period
# - `count`: the number of values added to the histogram during the flush period
# - `sum`: the sum of all values added to the histogram during the flush period
aggregates:
- "min"
- "max"
- "count"

# == DIAGNOSTICS ==

# Enable debug logging
debug: true

# Providing a Sentry DSN here will send internal exceptions to Sentry
sentry_dsn: ""

# Veneur emits it's own metrics, this configures where we send them. It's ok
# to point veneur at itself for metrics consumption!
stats_address: "localhost:8125"

# == FEATURES ==

# Tags supplied here will be added to all metrics ingested by this instance.
tags:
- "foo:bar"
- "baz:quz"

# If absent, defaults to the os.Hostname()!
hostname: foobar
# If true and hostname is "" or absent, don't add the host tag
omit_empty_hostname: false

# The address on which to listen for metrics sent to this instance over UDP,
# leave empty to disable.
udp_address: "localhost:8126"

# The address on which to listen for metrics sent to this instance over TCP,
# leave empty to disable.
tcp_address: ""

# The address on which to listen for HTTP imports and/or healthchecks.
#http_address: "einhorn@0"
http_address: "localhost:8127"

# FORWARDING
# Use a static host for forwarding
forward_address: "http://veneur.example.com"

# SSF
# The address on which we will listen for SSF packets via UDP
ssf_address: "127.0.0.1:8128"

# TRACING
# The address on which we will listen for UDP trace data
trace_address: "127.0.0.1:8128"

# TLS
# This is only useful in conjunction with `tcp_address`

# TLS server private key and certificate for encryption (specify both)
# These are the key/certificate contents, not a file path
tls_key: ""
tls_certificate: ""

# Authority certificate: requires clients to be authenticated
tls_authority_certificate: ""

# == SINKS ==

# == Datadog ==
# Datadog can be a sink for metrics, events, service checks and trace spans.

# This is deprecated and will be removed in 2.0; use datadog_api_key
key: "farts"

# This is deprecated and will be removed in 2.0; use datadog_api_hostname
api_hostname: https://app.datadoghq.com

# This is deprecated and will be removed in 2.0; use datadog_trace_api_address
trace_api_address: "http://localhost:7777"

# Hostname to send Datadog data to.
datadog_api_hostname: https://app.datadoghq.com

# API key for acessing Datadog
datadog_api_key: "farts"

# Hostname to send Datadog trace data to.
datadog_trace_api_address: "http://localhost:7777"

# == InfluxDB ==
# InfluxDB can be a sink for metrics.

# Hostname to send Influx metrics to
influx_address: http://localhost:8086

# Consistency level for writes
influx_consistency: one

# Name of database to which metrics will be written.
influx_db_name: mydb

# == LightStep ==
# LightStep can be a sink for trace spans.

# If present, lightstep will be enabled as a tracing sink
# and this access token will be used
# Access token for accessing LightStep
trace_lightstep_access_token: ""

# Host to send trace data to
trace_lightstep_collector_host: ""

# == PLUGINS ==

# == S3 Output ==
# Include these if you want to archive data to S3
aws_access_key_id: ""
aws_secret_access_key: ""
aws_region: ""
aws_s3_bucket: ""

# == LocalFile Output ==
# Include this if you want to archive data to a local file (which should then be rotated/cleaned)
flush_file: ""
4 changes: 2 additions & 2 deletions config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ func TestReadConfig(t *testing.T) {
t.Fatal(err)
}

assert.Equal(t, "https://app.datadoghq.com", c.APIHostname)
assert.Equal(t, "https://app.datadoghq.com", c.DatadogAPIHostname)
assert.Equal(t, 96, c.NumWorkers)

interval, err := c.ParseInterval()
assert.NoError(t, err)
assert.Equal(t, interval, 10*time.Second)

assert.Equal(t, c.TraceAddress, "127.0.0.1:8128")
assert.Equal(t, "http://localhost:7777", c.DatadogTraceAPIAddress)

}

Expand Down
Loading

0 comments on commit 4e3d7e5

Please sign in to comment.