Disable prometheus metrics by default
The HTTP server should only be enabled if a user explicitly sets a port for it.
This commit is contained in:
12
README.md
12
README.md
@@ -100,6 +100,17 @@ dbs:
|
|||||||
- path: /path/to/replica
|
- path: /path/to/replica
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Monitoring replication
|
||||||
|
|
||||||
|
You can also enable a Prometheus metrics endpoint to monitor replication by
|
||||||
|
specifying a bind address with the `addr` field:
|
||||||
|
|
||||||
|
```yml
|
||||||
|
addr: ":9090"
|
||||||
|
```
|
||||||
|
|
||||||
|
This will make metrics available at: http://localhost:9090/metrics
|
||||||
|
|
||||||
|
|
||||||
### Other configuration options
|
### Other configuration options
|
||||||
|
|
||||||
@@ -119,6 +130,7 @@ These replica options are only available for S3 replicas:
|
|||||||
- `sync-interval`—Replication sync frequency.
|
- `sync-interval`—Replication sync frequency.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### Replication
|
### Replication
|
||||||
|
|||||||
@@ -97,11 +97,6 @@ The commands are:
|
|||||||
`[1:])
|
`[1:])
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default configuration settings.
|
|
||||||
const (
|
|
||||||
DefaultAddr = ":9090"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Config represents a configuration file for the litestream daemon.
|
// Config represents a configuration file for the litestream daemon.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
// Bind address for serving metrics.
|
// Bind address for serving metrics.
|
||||||
@@ -129,9 +124,7 @@ func (c *Config) Normalize() error {
|
|||||||
|
|
||||||
// DefaultConfig returns a new instance of Config with defaults set.
|
// DefaultConfig returns a new instance of Config with defaults set.
|
||||||
func DefaultConfig() Config {
|
func DefaultConfig() Config {
|
||||||
return Config{
|
return Config{}
|
||||||
Addr: DefaultAddr,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// DBConfig returns database configuration by path.
|
// DBConfig returns database configuration by path.
|
||||||
|
|||||||
Reference in New Issue
Block a user