Skip to content

Commit 970700f

Browse files
authored
Merge branch 'main' into main
2 parents 0a5b860 + 7b7dbb0 commit 970700f

File tree

5 files changed

+108
-15
lines changed

5 files changed

+108
-15
lines changed
Lines changed: 95 additions & 1 deletion
Loading

doc-site/docs/reference/config.md

Lines changed: 1 addition & 1 deletion
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>`

doc-site/docs/tutorials/custom_contracts/index.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ Like the rest of FireFly, custom onchain logic support are implemented with an a
4949
- The transaction itself happens asynchronously from the HTTP request that initiated it
5050
- Blockchain events emitted by the custom onchain logic (Ethereum smart contracts, Fabric chaincodes, Corda flows, etc.) will be stored in FireFly's database if FireFly has a **Event Listener** set up for that specific type of event. FireFly will also emit an event of type `blockchain_event_received` when this happens.
5151

52-
<!-- TODO: Update this diagram -->
53-
5452
![Smart Contracts Async Flow](../../images/smart_contracts_async_flow.svg "Smart Contracts Async Flow")
5553

5654
<!--nav-->

internal/apiserver/metrics_server.go

Lines changed: 1 addition & 1 deletion
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

Lines changed: 11 additions & 10 deletions
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)