Skip to content

Commit 6615b0b

Browse files
authored
doc: document entropy.yaml config file (#77)
1 parent 76c16e9 commit 6615b0b

File tree

3 files changed

+58
-48
lines changed

3 files changed

+58
-48
lines changed

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,19 @@ $ entropy version
4646

4747
Entropy typically runs as a service and requires a Postgres to store its state.
4848

49-
## Running locally
49+
Refer [entropy.yaml](./entropy.yaml) for sample configuration values.
50+
51+
* You can override the configurations by directly editing the `entropy.yaml` file or by setting environment variables.
52+
* Environment variable name will be uppercased version of the complete path in YAML along with `.` replaced with `_` character. For example, the `service.host` can be overriden by setting `SERVICE_HOST`.
53+
* It is also possible to create a copy of the sample configuration file with different name and provide that path to entropy.
54+
55+
```shell
56+
$ entropy serve --config ./my_config.yaml
57+
```
58+
59+
## Development
60+
61+
### Running locally
5062

5163
```sh
5264
# Clone the repo
@@ -63,7 +75,7 @@ $ ./dist/entropy serve
6375

6476
```
6577

66-
## Running tests
78+
### Running tests
6779

6880
```sh
6981
# Running all unit tests, excluding extractors

docs/reference/configuration.md

Lines changed: 0 additions & 45 deletions
This file was deleted.

entropy.yaml

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,70 @@
1+
# HTTP/gRPC server configurations.
12
service:
3+
# host forms the bind address along with port. In container environments
4+
# it might be necessary to set this to 0.0.0.0 (leaving this config empty
5+
# has the same effect)
26
host: localhost
7+
8+
# port forms the bind address along with host.
39
port: 8080
410

5-
# Postgres Connection String
11+
# pg_conn_str is the PostgresDB connection string for entropy state storage.
612
# Refer https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING
713
pg_conn_str: 'postgres://postgres@localhost:5432/entropy?sslmode=disable'
814

915
log:
16+
# level can be one of debug, info, warn, error.
17+
# This configuration is case-insensitive.
1018
level: info
1119

1220
worker:
21+
# unique name for the job queue for async jobs. when using postgres-queue
22+
# implementation, this forms the table name.
1323
queue_name: entropy_jobs
24+
25+
# specification of the queuing backend. currently only postgres is supported.
26+
# So this must be a valid PG connection string.
1427
queue_spec: 'postgres://postgres@localhost:5432/entropy?sslmode=disable'
28+
29+
# number of worker threads (goroutines) to launch. each thread will poll the
30+
# queueing backend for pending jobs.
1531
threads: 1
32+
33+
# Interval between successive polls by a single worker thread. be careful when
34+
# reducing this since it can cause contention when combined high threads value
35+
# and lot of entropy instances.
1636
poll_interval: 1s
1737

38+
# instrumentation/metrics related configurations.
1839
telemetry:
40+
# debug_addr is used for exposing the pprof, zpages & `/metrics` endpoints. if
41+
# not set, all of the above are disabled.
1942
debug_addr: "localhost:8081"
43+
44+
# enable_cpu enables collection of runtime CPU metrics. available in `/metrics`.
2045
enable_cpu: true
46+
47+
# enable_memory enables collection of runtime memory metrics. availbale via `/metrics`.
2148
enable_memory: true
49+
50+
# sampling_fraction indicates the sampling rate for tracing. 1 indicates all traces
51+
# are collected and 0 means no traces.
2252
sampling_fraction: 1
53+
54+
# service_name is the identifier used in trace exports, NewRelic, etc for the
55+
# entropy instance.
2356
service_name: "entropy"
57+
58+
# enable_newrelic enables exporting NewRelic instrumentation in addition to the
59+
# OpenCensus.
2460
enable_newrelic: false
61+
62+
# newrelic_api_key must be a valid NewRelic License key.
2563
newrelic_api_key: ""
64+
65+
# enable_otel_agent enables the OpenTelemetry Exporter for both traces and views.
2666
enable_otel_agent: false
67+
68+
# otel_agent_addr is the addr of OpenTelemetry Collector/Agent. This is where the
69+
# opene-telemetry exporter will publish the collected traces/views to.
2770
otel_agent_addr: "localhost:8088"

0 commit comments

Comments
 (0)