Skip to content

Commit

Permalink
Merge branch 'main' into raft_default_v3
Browse files Browse the repository at this point in the history
  • Loading branch information
jrasell committed Nov 25, 2021
2 parents 6343fa6 + de85e58 commit efb8f38
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 6 deletions.
2 changes: 1 addition & 1 deletion client/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ type Config struct {
// LogOutput is the destination for logs
LogOutput io.Writer

// Logger provides a logger to thhe client
// Logger provides a logger to the client
Logger log.InterceptLogger

// Region is the clients region
Expand Down
12 changes: 7 additions & 5 deletions command/agent/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -944,11 +944,6 @@ func TestHTTPServer_Limits_Error(t *testing.T) {
t.Run(name, func(t *testing.T) {
t.Parallel()

// Use a fake agent since the HTTP server should never start
agent := &Agent{
logger: testlog.HCLogger(t),
}

conf := &Config{
normalizedAddrs: &Addresses{
HTTP: "localhost:0", // port is never used
Expand All @@ -962,6 +957,13 @@ func TestHTTPServer_Limits_Error(t *testing.T) {
},
}

// Use a fake agent since the HTTP server should never start
agent := &Agent{
logger: testlog.HCLogger(t),
httpLogger: testlog.HCLogger(t),
config: conf,
}

srv, err := NewHTTPServer(agent, conf)
require.Error(t, err)
require.Nil(t, srv)
Expand Down
27 changes: 27 additions & 0 deletions website/content/docs/autoscaling/agent/source.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
layout: docs
page_title: source Stanza - Nomad Autoscaler Agent Configuration
description: >-
The "source" block is used to configure scaling target sources.
---

# `source` Block

<Placement groups={['policy', 'source']} />

The `source` block is used to configure scaling target sources.

```hcl
policy {
source "nomad" {
enabled = false
}
}
```

Supported sources are `file` and `nomad`.

### `source` Parameters

- `enabled` `(bool: true)` - Defines if the scaling policy source should be
enabled or disabled.
5 changes: 5 additions & 0 deletions website/content/docs/autoscaling/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ passed in via CLI arguments. The `agent` command accepts the following arguments
`cluster` and `horizontal` queues. Nomad Autoscaler Enterprise supports additional
`vertical_mem` and `vertical_cpu` queues.

- `-policy-source-disable-file`: Disable the sourcing of policies from disk.

- `-policy-source-disable-nomad`: Disable the sourcing of policies from the
Nomad API.

- `-telemetry-disable-hostname`: Specifies whether gauge values should be prefixed
with the local hostname.

Expand Down
5 changes: 5 additions & 0 deletions website/content/docs/autoscaling/plugins/apm/datadog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ apm "datadog" {
config = {
dd_api_key = "<api key>"
dd_app_key = "<app key>"
site = "app.datadoghq.eu"
}
}
```
Expand All @@ -28,6 +30,8 @@ apm "datadog" {
- `dd_app_key` `(string: <required>)` - The Datadog application key to use for
authentication.

- `site` `(string: "")` - The [Datadog site][datadog_sites] to connect to.

The Datadog plugin can also read its configuration options via environment
variables. The accepted keys are `DD_API_KEY` and `DD_APP_KEY`. The agent
configuration parameters take precedence over the environment variables.
Expand All @@ -43,4 +47,5 @@ check {
```

[datadog_homepage]: https://www.datadoghq.com/
[datadog_sites]: https://docs.datadoghq.com/getting_started/site/
[datadog_timeseries]: https://docs.datadoghq.com/api/v1/metrics/#query-timeseries-points
24 changes: 24 additions & 0 deletions website/content/docs/autoscaling/plugins/apm/prometheus.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,37 @@ apm "prometheus" {
config = {
address = "http://prometheus.my.endpoint.io:9090"
ca_cert = "/path/to/ca.crt"
basic_auth_user = "user"
basic_auth_password = "secret"
header_X-Scope-OrgID = "my-org"
header_X-Custom-Header = "custom-header"
}
}
```

- `address` `(string: "http://127.0.0.1:9090")` - The address of the Prometheus
endpoint used to perform queries.

- `basic_auth_user` `(string: "")` - The HTTP basic auth user to use when
making requests to Prometheus.

- `basic_auth_password` `(string: "")` - The HTTP basic auth password to use
when making requests to Prometheus.

- `ca_cert` `(string: "")` - Path to a PEM encoded CA cert file to use to
connect to the Prometheus server.

- `header_*` `(string: "")` - Additional HTTP headers to set when making
requests to Prometheus. Several headers may be specified and the final header
name will be set as the key with the `header_` prefix removed.

- `skip_verify` `(bool: false)` - Do not verify TLS certificates when
connecting to the Prometheus server. This is strongly discouraged.

## Policy Configuration Options

```hcl
Expand Down
4 changes: 4 additions & 0 deletions website/data/docs-nav-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -1531,6 +1531,10 @@
"title": "policy_eval",
"path": "autoscaling/agent/policy_eval"
},
{
"title": "source",
"path": "autoscaling/agent/source"
},
{
"title": "strategy",
"path": "autoscaling/agent/strategy"
Expand Down

0 comments on commit efb8f38

Please sign in to comment.