Skip to content

Commit 3e75d70

Browse files
authored
Merge branch 'main' into BG
2 parents c2a42fd + ec71bca commit 3e75d70

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

doc-site/docs/gettingstarted/setup_env.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Global Flags:
8484
-d, --database string Database type to use. Options are: [sqlite3 postgres] (default "sqlite3")
8585
-e, --external int Manage a number of FireFly core processes outside of the docker-compose stack - useful for development and debugging
8686
-p, --firefly-base-port int Mapped port base of FireFly core API (1 added for each member) (default 5000)
87-
--ipfs-mode string Set the mode in which IFPS operates. Options are: [private public] (default "private")
87+
--ipfs-mode string Set the mode in which IPFS operates. Options are: [private public] (default "private")
8888
-m, --manifest string Path to a manifest.json file containing the versions of each FireFly microservice to use. Overrides the --release flag.
8989
--multiparty Enable or disable multiparty mode (default true)
9090
--node-name stringArray Node name

doc-site/docs/reference/config.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ title: Configuration Reference
450450
|Key|Description|Type|Default Value|
451451
|---|-----------|----|-------------|
452452
|address|The IP address on which the metrics HTTP API should listen|`int`|`127.0.0.1`
453-
|enabled|Enables the metrics API|`boolean`|`true`
453+
|enabled|Enables the metrics API|`boolean`|`false`
454454
|metricsPath|The path from which to serve the Prometheus metrics|`string`|`/metrics`
455455
|port|The port on which the metrics HTTP API should listen|`int`|`6000`
456456
|publicURL|The fully qualified public URL for the metrics API. This is used for building URLs in HTTP responses and in OpenAPI Spec generation|URL `string`|`<nil>`

internal/apiserver/metrics_server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ func initDeprecatedMetricsConfig(config config.Section) {
3232
}
3333

3434
func initMonitoringConfig(config config.Section) {
35-
config.AddKnownKey(Enabled, true)
35+
config.AddKnownKey(Enabled, false)
3636
config.AddKnownKey(MetricsPath, "/metrics")
3737
}

internal/apiserver/server.go

+11-10
Original file line numberDiff line numberDiff line change
@@ -115,17 +115,18 @@ func (as *apiServer) Serve(ctx context.Context, mgr namespace.Manager) (err erro
115115
} else if config.GetBool(coreconfig.LegacyAdminEnabled) {
116116
log.L(ctx).Warnf("Your config includes an 'admin' section, which should be renamed to 'spi' - SPI server will not be enabled until this is corrected")
117117
}
118-
serverName := "metrics"
119-
mConfig := deprecatedMetricsConfig
120-
if as.monitoringEnabled {
121-
serverName = "monitoring"
122-
mConfig = monitoringConfig
123-
}
124-
125118
if as.deprecatedMetricsEnabled || as.monitoringEnabled {
126-
monitoringServer, err := httpserver.NewHTTPServer(ctx, serverName, as.createMonitoringMuxRouter(), metricsErrChan, mConfig, corsConfig, &httpserver.ServerOptions{
127-
MaximumRequestTimeout: as.apiMaxTimeout,
128-
})
119+
var monitoringServer httpserver.HTTPServer
120+
var err error
121+
if as.monitoringEnabled {
122+
monitoringServer, err = httpserver.NewHTTPServer(ctx, "monitoring", as.createMonitoringMuxRouter(), metricsErrChan, monitoringConfig, corsConfig, &httpserver.ServerOptions{
123+
MaximumRequestTimeout: as.apiMaxTimeout,
124+
})
125+
} else {
126+
monitoringServer, err = httpserver.NewHTTPServer(ctx, "metrics", as.createMonitoringMuxRouter(), metricsErrChan, deprecatedMetricsConfig, corsConfig, &httpserver.ServerOptions{
127+
MaximumRequestTimeout: as.apiMaxTimeout,
128+
})
129+
}
129130
if err != nil {
130131
return err
131132
}

0 commit comments

Comments
 (0)