diff --git a/CHANGELOG.md b/CHANGELOG.md index 0aa7602676f..c85784209fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,21 +2,14 @@ ## Upcoming Breaking Changes -- Next release will introduce a breaking change to Teku's metrics. This is due to some metrics changing names after a library upgrade. -We recommend all users of the `Teku - Detailed` dashboard to upgrade to version [Revision 12](https://grafana.com/api/dashboards/16737/revisions/12/download) -as soon as possible. Documentation with all metrics that have been renamed will be provided. -- Next release will require Java 21. The current release is compatible, please consider upgrading before the next release. -- From the next release, you will need to explicitly set `--data-storage-mode=(prune|archive)` unless you're using minimal data-storage-mode (which is the default behaviour). - ## Current Releases -For information on changes in released versions of Teku, see -the [releases page](https://github.com/Consensys/teku/releases). - ## Unreleased Changes ### Breaking Changes +- Updated counter metrics to incorporate the suffix `_total`. If you are using a custom dashboard to monitor Teku metrics, you might need to update the metrics manually when breaking changes are introduced. For more information, see [Update metrics](../../how-to/monitor/update-metrics.md). + ### Additions and Improvements ### Bug Fixes diff --git a/ethereum/executionlayer/src/main/java/tech/pegasys/teku/ethereum/executionlayer/ExecutionLayerManagerImpl.java b/ethereum/executionlayer/src/main/java/tech/pegasys/teku/ethereum/executionlayer/ExecutionLayerManagerImpl.java index bc39a96f870..0db98028879 100644 --- a/ethereum/executionlayer/src/main/java/tech/pegasys/teku/ethereum/executionlayer/ExecutionLayerManagerImpl.java +++ b/ethereum/executionlayer/src/main/java/tech/pegasys/teku/ethereum/executionlayer/ExecutionLayerManagerImpl.java @@ -85,7 +85,7 @@ public static ExecutionLayerManagerImpl create( final LabelledMetric executionPayloadSourceCounter = metricsSystem.createLabelledCounter( TekuMetricCategory.BEACON, - "execution_payload_source", + "execution_payload_source_total", "Counter recording the source of the execution payload during block production", "source", "fallback_reason"); diff --git a/ethereum/executionlayer/src/test/java/tech/pegasys/teku/ethereum/executionlayer/ExecutionLayerBlockProductionManagerImplTest.java b/ethereum/executionlayer/src/test/java/tech/pegasys/teku/ethereum/executionlayer/ExecutionLayerBlockProductionManagerImplTest.java index 32f5bfe1c70..20ec6bbb795 100644 --- a/ethereum/executionlayer/src/test/java/tech/pegasys/teku/ethereum/executionlayer/ExecutionLayerBlockProductionManagerImplTest.java +++ b/ethereum/executionlayer/src/test/java/tech/pegasys/teku/ethereum/executionlayer/ExecutionLayerBlockProductionManagerImplTest.java @@ -569,7 +569,7 @@ private void verifyEngineCalled( private void verifySourceCounter(final Source source, final FallbackReason reason) { final long actualCount = stubMetricsSystem - .getCounter(TekuMetricCategory.BEACON, "execution_payload_source") + .getCounter(TekuMetricCategory.BEACON, "execution_payload_source_total") .getValue(source.toString(), reason.toString()); assertThat(actualCount).isOne(); } diff --git a/ethereum/executionlayer/src/test/java/tech/pegasys/teku/ethereum/executionlayer/ExecutionLayerManagerImplTest.java b/ethereum/executionlayer/src/test/java/tech/pegasys/teku/ethereum/executionlayer/ExecutionLayerManagerImplTest.java index febaebd5bbc..14b96b79bc2 100644 --- a/ethereum/executionlayer/src/test/java/tech/pegasys/teku/ethereum/executionlayer/ExecutionLayerManagerImplTest.java +++ b/ethereum/executionlayer/src/test/java/tech/pegasys/teku/ethereum/executionlayer/ExecutionLayerManagerImplTest.java @@ -858,7 +858,7 @@ private void verifyEngineCalled( private void verifySourceCounter(final Source source, final FallbackReason reason) { final long actualCount = stubMetricsSystem - .getCounter(TekuMetricCategory.BEACON, "execution_payload_source") + .getCounter(TekuMetricCategory.BEACON, "execution_payload_source_total") .getValue(source.toString(), reason.toString()); assertThat(actualCount).isOne(); } diff --git a/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/datastructures/interop/MergedGenesisTestBuilder.java b/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/datastructures/interop/MergedGenesisTestBuilder.java index 4067ce24f24..33296e8a3be 100644 --- a/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/datastructures/interop/MergedGenesisTestBuilder.java +++ b/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/datastructures/interop/MergedGenesisTestBuilder.java @@ -17,9 +17,11 @@ import org.hyperledger.besu.config.GenesisConfigFile; import org.hyperledger.besu.config.GenesisConfigOptions; import org.hyperledger.besu.datatypes.Wei; +import org.hyperledger.besu.ethereum.chain.BadBlockManager; import org.hyperledger.besu.ethereum.chain.GenesisState; import org.hyperledger.besu.ethereum.core.Block; import org.hyperledger.besu.ethereum.core.BlockHeader; +import org.hyperledger.besu.ethereum.core.MiningParameters; import org.hyperledger.besu.ethereum.mainnet.MainnetProtocolSchedule; import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule; import tech.pegasys.teku.infrastructure.bytes.Bytes20; @@ -35,8 +37,10 @@ public static ExecutionPayloadHeader createPayloadForBesuGenesis( final GenesisConfigFile configFile = GenesisConfigFile.fromConfig(genesisConfigFile); final GenesisConfigOptions genesisConfigOptions = configFile.getConfigOptions(Collections.emptyMap()); + final BadBlockManager badBlockManager = new BadBlockManager(); final ProtocolSchedule protocolSchedule = - MainnetProtocolSchedule.fromConfig(genesisConfigOptions); + MainnetProtocolSchedule.fromConfig( + genesisConfigOptions, MiningParameters.MINING_DISABLED, badBlockManager); final GenesisState genesisState = GenesisState.fromConfig(configFile, protocolSchedule); final Block genesisBlock = genesisState.getBlock(); final BlockHeader header = genesisBlock.getHeader(); diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/MappedOperationPool.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/MappedOperationPool.java index 27f9df86004..657003f7e8b 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/MappedOperationPool.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/MappedOperationPool.java @@ -98,7 +98,7 @@ public MappedOperationPool( validationReasonCounter = metricsSystem.createLabelledCounter( TekuMetricCategory.BEACON, - OPERATION_POOL_SIZE_VALIDATION_REASON + metricType, + OPERATION_POOL_SIZE_VALIDATION_REASON + metricType + "_total", "Total number of attempts to add an operation to the pool, broken down by validation result", "result"); diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/SimpleOperationPool.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/SimpleOperationPool.java index 6b35f3ec99c..5193668bf06 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/SimpleOperationPool.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/SimpleOperationPool.java @@ -113,7 +113,7 @@ private SimpleOperationPool( validationReasonCounter = metricsSystem.createLabelledCounter( TekuMetricCategory.BEACON, - OPERATION_POOL_SIZE_VALIDATION_REASON + metricType, + OPERATION_POOL_SIZE_VALIDATION_REASON + metricType + "_total", "Total number of attempts to add an operation to the pool, broken down by validation result", "result"); } diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/util/PoolFactory.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/util/PoolFactory.java index baf75f2d03a..2978ddce72c 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/util/PoolFactory.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/util/PoolFactory.java @@ -63,7 +63,7 @@ public PoolFactory(final MetricsSystem metricsSystem) { this.blockBlobSidecarsTrackersPoolStats = metricsSystem.createLabelledCounter( TekuMetricCategory.BEACON, - "block_blobs_trackers_pool_stats", + "block_blobs_trackers_pool_stats_total", "Block-blobs trackers pool statistics", "type", "subtype"); diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/signatures/AggregatingSignatureVerificationService.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/signatures/AggregatingSignatureVerificationService.java index 69795725bfb..15f3597a76e 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/signatures/AggregatingSignatureVerificationService.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/validation/signatures/AggregatingSignatureVerificationService.java @@ -81,12 +81,12 @@ public class AggregatingSignatureVerificationService extends SignatureVerificati batchCounter = metricsSystem.createCounter( TekuMetricCategory.EXECUTOR, - "signature_verifications_batch_count", + "signature_verifications_batch_count_total", "Reports the number of verification batches processed"); taskCounter = metricsSystem.createCounter( TekuMetricCategory.EXECUTOR, - "signature_verifications_task_count", + "signature_verifications_task_count_total", "Reports the number of individual verification tasks processed"); batchSizeHistogram = MetricsHistogram.create( diff --git a/ethereum/statetransition/src/test/java/tech/pegasys/teku/statetransition/util/BlockBlobSidecarsTrackersPoolImplTest.java b/ethereum/statetransition/src/test/java/tech/pegasys/teku/statetransition/util/BlockBlobSidecarsTrackersPoolImplTest.java index cfe7cae31ec..4e592b1c314 100644 --- a/ethereum/statetransition/src/test/java/tech/pegasys/teku/statetransition/util/BlockBlobSidecarsTrackersPoolImplTest.java +++ b/ethereum/statetransition/src/test/java/tech/pegasys/teku/statetransition/util/BlockBlobSidecarsTrackersPoolImplTest.java @@ -1066,7 +1066,8 @@ private static BlobIdentifier blobIdentifierFromBlobSidecar(final BlobSidecar bl } private void assertStats(final String type, final String subType, final double count) { - assertThat(getMetricsValues("block_blobs_trackers_pool_stats").get(List.of(type, subType))) + assertThat( + getMetricsValues("block_blobs_trackers_pool_stats_total").get(List.of(type, subType))) .isEqualTo(count); } diff --git a/gradle/versions.gradle b/gradle/versions.gradle index 820b094d001..1a624299ee5 100644 --- a/gradle/versions.gradle +++ b/gradle/versions.gradle @@ -137,14 +137,14 @@ dependencyManagement { dependency 'org.xerial.snappy:snappy-java:1.1.10.5' - dependency 'io.prometheus:simpleclient:0.9.0' + dependency 'io.prometheus:simpleclient:0.16.0' - dependencySet(group: 'org.hyperledger.besu.internal', version: '24.1.2') { + dependencySet(group: 'org.hyperledger.besu.internal', version: '24.5.2') { entry('metrics-core') entry('core') entry('config') } - dependencySet(group: 'org.hyperledger.besu', version: '24.1.2') { + dependencySet(group: 'org.hyperledger.besu', version: '24.5.2') { entry('besu-datatypes') entry('evm') entry('plugin-api') diff --git a/infrastructure/events/src/main/java/tech/pegasys/teku/infrastructure/events/DirectEventDeliverer.java b/infrastructure/events/src/main/java/tech/pegasys/teku/infrastructure/events/DirectEventDeliverer.java index b8a8e80fbf8..69bd0cbe152 100644 --- a/infrastructure/events/src/main/java/tech/pegasys/teku/infrastructure/events/DirectEventDeliverer.java +++ b/infrastructure/events/src/main/java/tech/pegasys/teku/infrastructure/events/DirectEventDeliverer.java @@ -35,14 +35,14 @@ class DirectEventDeliverer extends EventDeliverer { consumedEventCounter = metricsSystem.createLabelledCounter( EVENTBUS, - "event_consumed_count", + "event_consumed_count_total", "Total number of events consumed", "channel", "subscriber"); failedEventCounter = metricsSystem.createLabelledCounter( EVENTBUS, - "event_failed_count", + "event_failed_count_total", "Number of events which failed to be processed", "channel", "subscriber"); diff --git a/infrastructure/events/src/main/java/tech/pegasys/teku/infrastructure/events/EventDeliverer.java b/infrastructure/events/src/main/java/tech/pegasys/teku/infrastructure/events/EventDeliverer.java index f5167a8bcf3..3a1c0ee1976 100644 --- a/infrastructure/events/src/main/java/tech/pegasys/teku/infrastructure/events/EventDeliverer.java +++ b/infrastructure/events/src/main/java/tech/pegasys/teku/infrastructure/events/EventDeliverer.java @@ -32,7 +32,7 @@ protected EventDeliverer(final MetricsSystem metricsSystem) { publishedEventCounter = metricsSystem.createLabelledCounter( TekuMetricCategory.EVENTBUS, - "event_published_count", + "event_published_count_total", "Total number of events published", "channel"); } diff --git a/infrastructure/metrics/src/test/java/tech/pegasys/teku/infrastructure/metrics/MetricsCountersByIntervalsTest.java b/infrastructure/metrics/src/test/java/tech/pegasys/teku/infrastructure/metrics/MetricsCountersByIntervalsTest.java index 6b9f8c3f4a7..8b8615d7847 100644 --- a/infrastructure/metrics/src/test/java/tech/pegasys/teku/infrastructure/metrics/MetricsCountersByIntervalsTest.java +++ b/infrastructure/metrics/src/test/java/tech/pegasys/teku/infrastructure/metrics/MetricsCountersByIntervalsTest.java @@ -73,6 +73,7 @@ void shouldCountWithDefault() { metricsSystem .streamObservations(CATEGORY) .filter(ob -> ob.getMetricName().equals(COUNTER_NAME)) + .filter(ob -> !ob.getLabels().contains("created")) .collect(Collectors.toMap(Observation::getLabels, Observation::getValue)); assertThat(values) @@ -117,6 +118,7 @@ void shouldNotCountNonMatching() { metricsSystem .streamObservations(CATEGORY) .filter(ob -> ob.getMetricName().equals(COUNTER_NAME)) + .filter(ob -> !ob.getLabels().contains("created")) .collect(Collectors.toMap(Observation::getLabels, Observation::getValue)); assertThat(values).containsOnly(entry(List.of("label1Val1", "label2UnknownVal", "[0,∞)"), 1d)); @@ -141,6 +143,7 @@ void shouldInitCounters() { metricsSystem .streamObservations(CATEGORY) .filter(ob -> ob.getMetricName().equals(COUNTER_NAME)) + .filter(ob -> !ob.getLabels().contains("created")) .collect(Collectors.toMap(Observation::getLabels, Observation::getValue)); assertThat(values).containsOnly(entry(List.of("a", "b", "[0,∞)"), 0d)); diff --git a/networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/peers/PeerChainValidator.java b/networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/peers/PeerChainValidator.java index 4a5d0e0e786..ee30fe881ab 100644 --- a/networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/peers/PeerChainValidator.java +++ b/networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/peers/PeerChainValidator.java @@ -59,7 +59,7 @@ private PeerChainValidator( final LabelledMetric validationCounter = metricsSystem.createLabelledCounter( TekuMetricCategory.NETWORK, - "peer_chain_validation_attempts", + "peer_chain_validation_attempts_total", "Number of peers chain verification has been performed on", "status"); validationStartedCounter = validationCounter.labels("started"); diff --git a/networking/p2p/src/main/java/tech/pegasys/teku/networking/p2p/connection/ConnectionManager.java b/networking/p2p/src/main/java/tech/pegasys/teku/networking/p2p/connection/ConnectionManager.java index a1d3296d3c7..ac485309a4c 100644 --- a/networking/p2p/src/main/java/tech/pegasys/teku/networking/p2p/connection/ConnectionManager.java +++ b/networking/p2p/src/main/java/tech/pegasys/teku/networking/p2p/connection/ConnectionManager.java @@ -78,7 +78,7 @@ public ConnectionManager( final LabelledMetric connectionAttemptCounter = metricsSystem.createLabelledCounter( TekuMetricCategory.NETWORK, - "peer_connection_attempt_count", + "peer_connection_attempt_count_total", "Total number of outbound connection attempts made", "status"); attemptedConnectionCounter = connectionAttemptCounter.labels("attempted"); diff --git a/services/beaconchain/src/main/java/tech/pegasys/teku/services/beaconchain/BeaconChainMetrics.java b/services/beaconchain/src/main/java/tech/pegasys/teku/services/beaconchain/BeaconChainMetrics.java index 8767ddcdd4f..843b74c5e68 100644 --- a/services/beaconchain/src/main/java/tech/pegasys/teku/services/beaconchain/BeaconChainMetrics.java +++ b/services/beaconchain/src/main/java/tech/pegasys/teku/services/beaconchain/BeaconChainMetrics.java @@ -197,7 +197,7 @@ public BeaconChainMetrics( final LabelledMetric versionCounter = metricsSystem.createLabelledCounter( TekuMetricCategory.BEACON, - VersionProvider.CLIENT_IDENTITY + "_version", + VersionProvider.CLIENT_IDENTITY + "_version_total", "Teku version in use", "version"); versionCounter.labels(version).inc(); diff --git a/storage/src/main/java/tech/pegasys/teku/storage/server/kvstore/dataaccess/V4FinalizedStateTreeStorageLogic.java b/storage/src/main/java/tech/pegasys/teku/storage/server/kvstore/dataaccess/V4FinalizedStateTreeStorageLogic.java index c92af7a2bd7..a53ca7f0338 100644 --- a/storage/src/main/java/tech/pegasys/teku/storage/server/kvstore/dataaccess/V4FinalizedStateTreeStorageLogic.java +++ b/storage/src/main/java/tech/pegasys/teku/storage/server/kvstore/dataaccess/V4FinalizedStateTreeStorageLogic.java @@ -49,18 +49,18 @@ public V4FinalizedStateTreeStorageLogic( this.branchNodeStoredCounter = metricsSystem.createLabelledCounter( TekuMetricCategory.STORAGE_FINALIZED_DB, - "state_branch_nodes", + "state_branch_nodes_total", "Number of finalized state tree branch nodes stored vs skipped", "type"); this.leafNodeStoredCounter = metricsSystem.createCounter( TekuMetricCategory.STORAGE_FINALIZED_DB, - "state_leaf_nodes", + "state_leaf_nodes_total", "Number of finalized state tree leaf nodes stored"); statesStoredCounter = metricsSystem.createCounter( TekuMetricCategory.STORAGE_FINALIZED_DB, - "states_stored", + "states_stored_total", "Number of finalized states stored"); } diff --git a/validator/client/src/integration-test/java/tech/pegasys/teku/validator/client/signer/ExternalSignerTestUtil.java b/validator/client/src/integration-test/java/tech/pegasys/teku/validator/client/signer/ExternalSignerTestUtil.java index 3c3867d6b1f..0a0e055b1b9 100644 --- a/validator/client/src/integration-test/java/tech/pegasys/teku/validator/client/signer/ExternalSignerTestUtil.java +++ b/validator/client/src/integration-test/java/tech/pegasys/teku/validator/client/signer/ExternalSignerTestUtil.java @@ -59,7 +59,7 @@ static void validateMetrics( final long failCount, final long timeoutCount) { final StubCounter labelledCounter = - metricsSystem.getCounter(TekuMetricCategory.VALIDATOR, "external_signer_requests"); + metricsSystem.getCounter(TekuMetricCategory.VALIDATOR, "external_signer_requests_total"); assertThat(labelledCounter.getValue("success")).isEqualTo(successCount); assertThat(labelledCounter.getValue("failed")).isEqualTo(failCount); assertThat(labelledCounter.getValue("timeout")).isEqualTo(timeoutCount); diff --git a/validator/client/src/main/java/tech/pegasys/teku/validator/client/PendingDuties.java b/validator/client/src/main/java/tech/pegasys/teku/validator/client/PendingDuties.java index 8384845f185..efe650fe585 100644 --- a/validator/client/src/main/java/tech/pegasys/teku/validator/client/PendingDuties.java +++ b/validator/client/src/main/java/tech/pegasys/teku/validator/client/PendingDuties.java @@ -54,7 +54,7 @@ private PendingDuties( dutiesPerformedCounter = metricsSystem.createLabelledCounter( TekuMetricCategory.VALIDATOR, - "duties_performed", + "duties_performed_total", "Count of the failed duties, by duty type", "type", "result"); diff --git a/validator/client/src/main/java/tech/pegasys/teku/validator/client/signer/ExternalSigner.java b/validator/client/src/main/java/tech/pegasys/teku/validator/client/signer/ExternalSigner.java index ad66438de1a..b0334dee62b 100644 --- a/validator/client/src/main/java/tech/pegasys/teku/validator/client/signer/ExternalSigner.java +++ b/validator/client/src/main/java/tech/pegasys/teku/validator/client/signer/ExternalSigner.java @@ -93,7 +93,7 @@ public ExternalSigner( final LabelledMetric labelledCounter = metricsSystem.createLabelledCounter( TekuMetricCategory.VALIDATOR, - "external_signer_requests", + "external_signer_requests_total", "Completed external signer counts", "result"); successCounter = labelledCounter.labels("success"); diff --git a/validator/client/src/test/java/tech/pegasys/teku/validator/client/PendingDutiesTest.java b/validator/client/src/test/java/tech/pegasys/teku/validator/client/PendingDutiesTest.java index a71afd6fa8f..3617b474885 100644 --- a/validator/client/src/test/java/tech/pegasys/teku/validator/client/PendingDutiesTest.java +++ b/validator/client/src/test/java/tech/pegasys/teku/validator/client/PendingDutiesTest.java @@ -245,7 +245,7 @@ void shouldReportTotalNumberOfSuccessesAndFailuresToMetrics() { private void validateMetrics(final String duty, final long successCount, final long failCount) { final StubCounter labelledCounter = - metricsSystem.getCounter(TekuMetricCategory.VALIDATOR, "duties_performed"); + metricsSystem.getCounter(TekuMetricCategory.VALIDATOR, "duties_performed_total"); assertThat(labelledCounter.getValue(duty, "success")).isEqualTo(successCount); assertThat(labelledCounter.getValue(duty, "failed")).isEqualTo(failCount); }