Compare commits

...

3 commits

Author SHA1 Message Date
92368d0221 m
Some checks failed
DCO action / DCO (pull_request) Failing after 5m11s
Tests and linters / Staticcheck (pull_request) Failing after 5m3s
Vulncheck / Vulncheck (pull_request) Failing after 5m7s
Build / Build Components (1.21) (pull_request) Failing after 5m52s
Build / Build Components (1.20) (pull_request) Failing after 6m6s
Tests and linters / Lint (pull_request) Failing after 6m43s
Tests and linters / Tests (1.21) (pull_request) Failing after 8m1s
Tests and linters / Tests (1.20) (pull_request) Failing after 8m16s
Tests and linters / Tests with -race (pull_request) Failing after 8m17s
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-02-01 15:37:42 +03:00
ee5feba0e1 Makefile: Add target to regenerate metrics description
Some checks failed
DCO action / DCO (pull_request) Failing after 1m39s
Vulncheck / Vulncheck (pull_request) Successful in 1m38s
Build / Build Components (1.20) (pull_request) Successful in 3m50s
Build / Build Components (1.21) (pull_request) Successful in 4m17s
Tests and linters / Tests (1.20) (pull_request) Successful in 5m37s
Tests and linters / Staticcheck (pull_request) Successful in 5m28s
Tests and linters / Lint (pull_request) Successful in 6m10s
Tests and linters / Tests (1.21) (pull_request) Successful in 6m1s
Tests and linters / Tests with -race (pull_request) Successful in 7m4s
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-01-31 10:29:42 +03:00
cb08bc85a9 scripts: Allow to export metrics in markdorn
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-01-31 10:28:14 +03:00
7 changed files with 184 additions and 47 deletions

View file

@ -94,6 +94,10 @@ export-metrics: dep
CGO_ENABLED=0 \
go build -v -trimpath -o bin/export-metrics ./scripts/export-metrics
docs: export-metrics
@./bin/export-metrics -node ./docs/node-metrics.md -format md
@./bin/export-metrics -ir ./docs/ir-metrics.md -format md
# Regenerate proto files:
protoc:
@if [ ! -d "$(PROTOC_DIR)" ] || [ ! -d "$(PROTOC_GEN_GO_DIR)" ] || [ ! -d "$(PROTOGEN_FROSTFS_DIR)" ]; then \
@ -259,4 +263,4 @@ env-down:
docker volume rm -f frostfs-node_neo-go
rm -f ./.cache/.frostfs-ir-state
rm -f ./.cache/.frostfs-node-state
rm -rf ./.cache/storage
rm -rf ./.cache/storage

8
docs/ir-metrics.md Normal file
View file

@ -0,0 +1,8 @@
# FrostFS Node prometheus metrics
Name | Description | Constant labels | Variable labels
-- | -- | -- | --
`frostfs_ir_ir_epoch` | Current epoch as seen by inner-ring node. | |
`frostfs_ir_ir_event_duration_seconds` | Duration of processing of inner-ring events | | `type`<br>`success`
`frostfs_ir_ir_health` | Current inner-ring node state. | |
`frostfs_ir_logger_entry_count` | Total log entries emitted or dropped by severity level | | `level`<br>`dropped`
`frostfs_ir_morphcache_request_duration_seconds` | Morph cache request process duration | | `success`<br>`method`

59
docs/node-metrics.md Normal file
View file

@ -0,0 +1,59 @@
# FrostFS Node prometheus metrics
Name | Description | Constant labels | Variable labels
-- | -- | -- | --
`frostfs_node_blobovnicza_tree_get_bytes` | Accumulated payload size read from Blobovnicza tree | | `shard_id`<br>`path`
`frostfs_node_blobovnicza_tree_mode` | Blobovnicza tree mode | | `shard_id`<br>`path`<br>`mode`
`frostfs_node_blobovnicza_tree_object_move_duration_seconds` | Accumulated Blobovnicza tree object move duration | | `shard_id`<br>`path`
`frostfs_node_blobovnicza_tree_open_blobovnicza_count` | Count of opened blobovniczas of Blobovnicza tree | | `shard_id`<br>`path`
`frostfs_node_blobovnicza_tree_open_blobovnicza_items_total` | Count of items in opened blobovniczas of Blobovnicza tree | | `shard_id`<br>`path`
`frostfs_node_blobovnicza_tree_open_blobovnicza_size_bytes` | Size of opened blobovniczas of Blobovnicza tree | | `shard_id`<br>`path`
`frostfs_node_blobovnicza_tree_put_bytes` | Accumulated payload size written to Blobovnicza tree | | `shard_id`<br>`path`
`frostfs_node_blobovnicza_tree_rebuild_complete_percent` | Percent of rebuild completeness | | `shard_id`<br>`path`
`frostfs_node_blobovnicza_tree_rebuild_status` | Blobovnicza tree rebuild status | | `shard_id`<br>`path`<br>`mode`
`frostfs_node_blobovnicza_tree_request_duration_seconds` | Accumulated Blobovnicza tree request process duration | | `shard_id`<br>`path`<br>`success`<br>`method`<br>`with_storage_id`
`frostfs_node_blobstore_get_bytes` | Accumulated payload size read from Blobstore | | `shard_id`
`frostfs_node_blobstore_mode` | Blobstore mode value | | `shard_id`<br>`mode`
`frostfs_node_blobstore_put_bytes` | Accumulated payload size written to Blobstore | | `shard_id`
`frostfs_node_blobstore_request_duration_seconds` | Accumulated Blobstore request process duration | | `shard_id`<br>`success`<br>`method`<br>`with_storage_id`
`frostfs_node_engine_container_objects_total` | Count of objects for each container | | `shard_id`<br>`cid`<br>`type`
`frostfs_node_engine_container_size_bytes` | Accumulated size of all objects in a container | | `cid`
`frostfs_node_engine_errors_total` | Shard's error counter | | `shard_id`
`frostfs_node_engine_mode_info` | Shard mode | | `shard_id`<br>`mode`
`frostfs_node_engine_objects_total` | Objects counters per shards. DEPRECATED: Will be deleted in next releasese, use frostfs_node_engine_container_objects_total metric. | | `shard_id`<br>`type`
`frostfs_node_engine_payload_size_bytes` | Accumulated size of all objects in a shard | | `shard_id`
`frostfs_node_engine_request_duration_seconds` | Duration of Engine requests | | `method`
`frostfs_node_fstree_get_bytes` | Accumulated payload size read from FSTree | | `shard_id`<br>`path`
`frostfs_node_fstree_mode` | FSTree mode value | | `shard_id`<br>`path`<br>`mode`
`frostfs_node_fstree_put_bytes` | Accumulated payload size written to FSTree | | `shard_id`<br>`path`
`frostfs_node_fstree_request_duration_seconds` | Accumulated FSTree request process duration | | `shard_id`<br>`success`<br>`path`<br>`method`
`frostfs_node_garbage_collector_delete_duration_seconds` | The total time of GC runs to delete objects from disk | | `shard_id`<br>`success`
`frostfs_node_garbage_collector_deleted_objects_total` | Total count of objects GC deleted or failed to delete from disk | | `shard_id`<br>`status`
`frostfs_node_garbage_collector_marked_for_removal_objects_total` | Total count of expired objects GC marked to remove | | `shard_id`<br>`object_type`
`frostfs_node_garbage_collector_marking_duration_seconds` | The total time of GC runs to mark expired objects as removed | | `shard_id`<br>`success`<br>`object_type`
`frostfs_node_grpc_server_health` | GRPC Server Endpoint health | | `endpoint`
`frostfs_node_ir_epoch` | Current epoch as seen by inner-ring node. | |
`frostfs_node_logger_entry_count` | Total log entries emitted or dropped by severity level | | `level`<br>`dropped`
`frostfs_node_metabase_mode` | Metabase mode | | `shard_id`<br>`path`<br>`mode`
`frostfs_node_metabase_request_duration_seconds` | Accumulated Metabase request process duration | | `shard_id`<br>`success`<br>`path`<br>`method`
`frostfs_node_morph_invoke_duration_seconds` | Cummulative duration of contract invocations | | `invoke_type`<br>`contract`<br>`method`<br>`success`
`frostfs_node_morph_last_block` | Index of the last received block | |
`frostfs_node_morph_notifications_total` | Number of notifications received by notification type | | `notification_type`
`frostfs_node_morph_switches_total` | Number of endpoint switches | |
`frostfs_node_morphcache_request_duration_seconds` | Morph cache request process duration | | `success`<br>`method`
`frostfs_node_object_request_duration_seconds` | Object Service request process duration | | `method`<br>`success`
`frostfs_node_object_request_payload_bytes` | Object Service request payload | | `method`
`frostfs_node_pilorama_mode` | Pilorama mode | | `shard_id`<br>`mode`
`frostfs_node_pilorama_request_duration_seconds` | Accumulated Pilorama request process duration | | `shard_id`<br>`success`<br>`method`
`frostfs_node_policer_processed_objects_total` | Total number of objects processed by policer | |
`frostfs_node_replicator_in_flight_requests_total` | Number of in-flight requests | |
`frostfs_node_replicator_processed_objects_total` | Number of objects processed since the node startup | |
`frostfs_node_replicator_total_replicated_payload_size_bytes` | Total size of payloads replicated | |
`frostfs_node_state_health` | Current Node state | |
`frostfs_node_treeservice_replicate_task_duration_seconds` | Duration of individual replication tasks executed as part of replication loops | | `success`
`frostfs_node_treeservice_replicate_wait_duration_seconds` | Duration of overall waiting time for replication loops | | `success`
`frostfs_node_treeservice_sync_duration_seconds` | Duration of synchronization operations | | `success`
`frostfs_node_writecache_actual_objects_total` | Actual objects count in writecache | | `shard_id`<br>`storage`
`frostfs_node_writecache_estimated_size_bytes` | Estimated writecache size | | `shard_id`<br>`storage`
`frostfs_node_writecache_mode_info` | Writecache mode value | | `shard_id`<br>`mode`
`frostfs_node_writecache_operations_total` | The number of writecache operations processed | | `shard_id`<br>`storage`<br>`success`<br>`operation`
`frostfs_node_writecache_request_duration_seconds` | Writecache request process duration | | `shard_id`<br>`success`<br>`storage`<br>`method`

28
go.mod
View file

@ -3,27 +3,27 @@ module git.frostfs.info/TrueCloudLab/frostfs-node
go 1.20
require (
git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240112150928-72885aae835c
git.frostfs.info/TrueCloudLab/frostfs-contract v0.18.1-0.20240115082915-f2a82aa635aa
git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240126091953-d60ce83e4271
git.frostfs.info/TrueCloudLab/frostfs-contract v0.18.1-0.20240130133737-6e72d0b3b405
git.frostfs.info/TrueCloudLab/frostfs-observability v0.0.0-20231101111734-b3ad3335ff65
git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20240117145620-110b7e41706e
git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20240126141009-65b4525b3bf0
git.frostfs.info/TrueCloudLab/hrw v1.2.1
git.frostfs.info/TrueCloudLab/policy-engine v0.0.0-20240122104724-06cbfe8691ad
git.frostfs.info/TrueCloudLab/policy-engine v0.0.0-20240129064140-8d21ab2d99d9
git.frostfs.info/TrueCloudLab/tzhash v1.8.0
github.com/cheggaaa/pb v1.0.29
github.com/chzyer/readline v1.5.1
github.com/flynn-archive/go-shlex v0.0.0-20150515145356-3f9db97f8568
github.com/google/uuid v1.6.0
github.com/hashicorp/golang-lru/v2 v2.0.7
github.com/klauspost/compress v1.17.4
github.com/klauspost/compress v1.17.5
github.com/mitchellh/go-homedir v1.1.0
github.com/mr-tron/base58 v1.2.0
github.com/multiformats/go-multiaddr v0.12.1
github.com/multiformats/go-multiaddr v0.12.2
github.com/nats-io/nats.go v1.32.0
github.com/nspcc-dev/neo-go v0.105.1
github.com/olekukonko/tablewriter v0.0.5
github.com/panjf2000/ants/v2 v2.9.0
github.com/paulmach/orb v0.11.0
github.com/paulmach/orb v0.11.1
github.com/prometheus/client_golang v1.18.0
github.com/spf13/cast v1.6.0
github.com/spf13/cobra v1.8.0
@ -58,7 +58,7 @@ require (
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/gnark-crypto v0.12.2-0.20231222162921-eb75782795d2 // indirect
github.com/consensys/gnark-crypto v0.12.2-0.20240124182927-2e4aaaaefdbf // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
@ -70,14 +70,16 @@ require (
github.com/gorilla/websocket v1.5.1 // indirect
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.1 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/holiman/uint256 v1.2.4 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/ipfs/go-cid v0.4.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
@ -90,14 +92,14 @@ require (
github.com/nats-io/nkeys v0.4.7 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
github.com/nspcc-dev/go-ordered-json v0.0.0-20240112074137-296698a162ae // indirect
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20240122090917-ef99a7a9e33f // indirect
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20240127082647-51ac153a7b00 // indirect
github.com/nspcc-dev/rfc6979 v0.2.0 // indirect
github.com/pelletier/go-toml/v2 v2.1.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.46.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/rivo/uniseg v0.4.6 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
@ -116,8 +118,8 @@ require (
golang.org/x/net v0.20.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
lukechampine.com/blake3 v1.2.1 // indirect
rsc.io/tmplfunc v0.0.3 // indirect

56
go.sum
View file

@ -1,17 +1,17 @@
git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240112150928-72885aae835c h1:dO2VLtoTQre4W28i1gSuW1MO80qFd0Lq9Q46Pu3q3TA=
git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240112150928-72885aae835c/go.mod h1:uY0AYmCznjZdghDnAk7THFIe1Vlg531IxUcus7ZfUJI=
git.frostfs.info/TrueCloudLab/frostfs-contract v0.18.1-0.20240115082915-f2a82aa635aa h1:uuN90s74idThHXi/jF/IlTdFimOIs+IBU44rdTE/Zdo=
git.frostfs.info/TrueCloudLab/frostfs-contract v0.18.1-0.20240115082915-f2a82aa635aa/go.mod h1:F/fe1OoIDKr5Bz99q4sriuHDuf3aZefZy9ZsCqEtgxc=
git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240126091953-d60ce83e4271 h1:8Ul3c0FmmfxJ4xBmFXuWizqjjuMruSnngVmeNl5yKuo=
git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240126091953-d60ce83e4271/go.mod h1:uY0AYmCznjZdghDnAk7THFIe1Vlg531IxUcus7ZfUJI=
git.frostfs.info/TrueCloudLab/frostfs-contract v0.18.1-0.20240130133737-6e72d0b3b405 h1:IL6S+KTRCs7v/nsBkni0EmagJfVGhm+Y+eOZHQJ2NHM=
git.frostfs.info/TrueCloudLab/frostfs-contract v0.18.1-0.20240130133737-6e72d0b3b405/go.mod h1:F/fe1OoIDKr5Bz99q4sriuHDuf3aZefZy9ZsCqEtgxc=
git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSVCB8JNSfPG7Uk4r2oSk=
git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0/go.mod h1:RUIKZATQLJ+TaYQa60X2fTDwfuhMfm8Ar60bQ5fr+vU=
git.frostfs.info/TrueCloudLab/frostfs-observability v0.0.0-20231101111734-b3ad3335ff65 h1:PaZ8GpnUoXxUoNsc1qp36bT2u7FU+neU4Jn9cl8AWqI=
git.frostfs.info/TrueCloudLab/frostfs-observability v0.0.0-20231101111734-b3ad3335ff65/go.mod h1:6aAX80dvJ3r5fjN9CzzPglRptoiPgIC9KFGGsUA+1Hw=
git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20240117145620-110b7e41706e h1:0t+3iEb2wFJjJryqGnh5wkr9DEiwRNb61KaxC27U+po=
git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20240117145620-110b7e41706e/go.mod h1:t1akKcUH7iBrFHX8rSXScYMP17k2kYQXMbZooiL5Juw=
git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20240126141009-65b4525b3bf0 h1:jp/Cg6CF3ip0IVRCjt48qKyv1cbMUmNYTn2z1jFLWqc=
git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20240126141009-65b4525b3bf0/go.mod h1:t1akKcUH7iBrFHX8rSXScYMP17k2kYQXMbZooiL5Juw=
git.frostfs.info/TrueCloudLab/hrw v1.2.1 h1:ccBRK21rFvY5R1WotI6LNoPlizk7qSvdfD8lNIRudVc=
git.frostfs.info/TrueCloudLab/hrw v1.2.1/go.mod h1:C1Ygde2n843yTZEQ0FP69jYiuaYV0kriLvP4zm8JuvM=
git.frostfs.info/TrueCloudLab/policy-engine v0.0.0-20240122104724-06cbfe8691ad h1:+D96Uu0Pw+55CrxP+srazthtZAh0Q19BtJo1Pm4hOP0=
git.frostfs.info/TrueCloudLab/policy-engine v0.0.0-20240122104724-06cbfe8691ad/go.mod h1:ps6oKO0mxaPJzK3admTB3iwoBXKkHnS73n4PCrqpHBg=
git.frostfs.info/TrueCloudLab/policy-engine v0.0.0-20240129064140-8d21ab2d99d9 h1:hkDIg6vzV1c1pyt5uj9EiBikHqKczfoNpPhwWvXaNf8=
git.frostfs.info/TrueCloudLab/policy-engine v0.0.0-20240129064140-8d21ab2d99d9/go.mod h1:YVL7yFaT0QNSpA0z+RHudLvrLwT+lsFYGyBSVc1ustI=
git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0 h1:M2KR3iBj7WpY3hP10IevfIB9MURr4O9mwVfJ+SjT3HA=
git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0/go.mod h1:okpbKfVYf/BpejtfFTfhZqFP+sZ8rsHrP8Rr/jYPNRc=
git.frostfs.info/TrueCloudLab/tzhash v1.8.0 h1:UFMnUIk0Zh17m8rjGHJMqku2hCgaXDqjqZzS4gsb4UA=
@ -40,8 +40,8 @@ github.com/chzyer/test v1.0.0 h1:p3BQDXSxOhOG0P9z6/hGnII4LGiEPOYBhs8asl/fC04=
github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8=
github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ=
github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI=
github.com/consensys/gnark-crypto v0.12.2-0.20231222162921-eb75782795d2 h1:tYj5Ydh5D7Xg2R1tJnoG36Yta7NVB8C0vx36oPA3Bbw=
github.com/consensys/gnark-crypto v0.12.2-0.20231222162921-eb75782795d2/go.mod h1:wKqwsieaKPThcFkHe0d0zMsbHEUWFmZcG7KBCse210o=
github.com/consensys/gnark-crypto v0.12.2-0.20240124182927-2e4aaaaefdbf h1:3y6Uh3BGyjNbgGXSptxV3sPefHJ5r0enJ7Fn0Uoc8jY=
github.com/consensys/gnark-crypto v0.12.2-0.20240124182927-2e4aaaaefdbf/go.mod h1:wKqwsieaKPThcFkHe0d0zMsbHEUWFmZcG7KBCse210o=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM=
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
@ -98,8 +98,8 @@ github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.0 h1:f4tg
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.0/go.mod h1:hKAkSgNkL0FII46ZkJcpVEAai4KV+swlIWCKfekd1pA=
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.1 h1:HcUWd006luQPljE73d5sk+/VgYPGUReEVz2y1/qylwY=
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.1/go.mod h1:w9Y7gY31krpLmrVU5ZPG9H7l9fZuRu5/3R3S3FMtVQ4=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0/go.mod h1:qmOFXW2epJhM0qSnUUYpldc7gVz2KMQwJ/QYCDIa7XU=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 h1:/c3QmbOGMGTOumP2iT/rCwB7b0QDGLKzqOmktBjT+Is=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1/go.mod h1:5SN9VR2LTsRFsrEC6FHgRbTWrTHu6tqPeKxEQv15giM=
github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c=
github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
@ -114,11 +114,13 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s=
github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4=
github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
github.com/klauspost/compress v1.17.5 h1:d4vBd+7CHydUqpFBgUEKkSdtSugf9YFmSkvUYPquI5E=
github.com/klauspost/compress v1.17.5/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc=
github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
@ -129,6 +131,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
@ -154,8 +158,8 @@ github.com/multiformats/go-base32 v0.1.0 h1:pVx9xoSPqEIQG8o+UbAe7DNi51oej1NtK+aG
github.com/multiformats/go-base32 v0.1.0/go.mod h1:Kj3tFY6zNr+ABYMqeUNeGvkIC/UYgtWibDcT0rExnbI=
github.com/multiformats/go-base36 v0.2.0 h1:lFsAbNOGeKtuKozrtBsAkSVhv1p9D0/qedU9rQyccr0=
github.com/multiformats/go-base36 v0.2.0/go.mod h1:qvnKE++v+2MWCfePClUEjE78Z7P2a1UV0xHgWc0hkp4=
github.com/multiformats/go-multiaddr v0.12.1 h1:vm+BA/WZA8QZDp1pF1FWhi5CT3g1tbi5GJmqpb6wnlk=
github.com/multiformats/go-multiaddr v0.12.1/go.mod h1:7mPkiBMmLeFipt+nNSq9pHZUeJSt8lHBgH6yhj0YQzE=
github.com/multiformats/go-multiaddr v0.12.2 h1:9G9sTY/wCYajKa9lyfWPmpZAwe6oV+Wb1zcmMS1HG24=
github.com/multiformats/go-multiaddr v0.12.2/go.mod h1:GKyaTYjZRdcUhyOetrxTk9z0cW+jA/YrnqTOvKgi44M=
github.com/multiformats/go-multibase v0.2.0 h1:isdYCVLvksgWlMW9OZRYJEa9pZETFivncJHmHnnd87g=
github.com/multiformats/go-multibase v0.2.0/go.mod h1:bFBZX4lKCA/2lyOFSAoKH5SS6oPyjtnzK/XTFDPkNuk=
github.com/multiformats/go-multihash v0.2.3 h1:7Lyc8XfX/IY2jWb/gI7JP+o7JEq9hOa7BFvVU9RSh+U=
@ -172,8 +176,8 @@ github.com/nspcc-dev/go-ordered-json v0.0.0-20240112074137-296698a162ae h1:UFgMX
github.com/nspcc-dev/go-ordered-json v0.0.0-20240112074137-296698a162ae/go.mod h1:79bEUDEviBHJMFV6Iq6in57FEOCMcRhfQnfaf0ETA5U=
github.com/nspcc-dev/neo-go v0.105.1 h1:r0b2yIwLBi+ARBKU94gHL9oTFEB/XMJ0YlS2HN9Qw34=
github.com/nspcc-dev/neo-go v0.105.1/go.mod h1:GNh0cRALV/cuj+/xg2ZHDsrFbqcInqG7jjhqsLEnlNc=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20240122090917-ef99a7a9e33f h1:6h0zgQGKdStROXRlWhz2dZmrKkSmOJ4oiDs06nO39XI=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20240122090917-ef99a7a9e33f/go.mod h1:J/Mk6+nKeKSW4wygkZQFLQ6SkLOSGX5Ga0RuuuktEag=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20240127082647-51ac153a7b00 h1:xIlMk3yhB2kXIbN3ZN6W1VVG/7xN1Re863Nnrgj7FgI=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20240127082647-51ac153a7b00/go.mod h1:J/Mk6+nKeKSW4wygkZQFLQ6SkLOSGX5Ga0RuuuktEag=
github.com/nspcc-dev/rfc6979 v0.2.0 h1:3e1WNxrN60/6N0DW7+UYisLeZJyfqZTNOjeV/toYvOE=
github.com/nspcc-dev/rfc6979 v0.2.0/go.mod h1:exhIh1PdpDC5vQmyEsGvc4YDM/lyQp/452QxGq/UEso=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
@ -194,8 +198,8 @@ github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw=
github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro=
github.com/panjf2000/ants/v2 v2.9.0 h1:SztCLkVxBRigbg+vt0S5QvF5vxAbxbKt09/YfAJ0tEo=
github.com/panjf2000/ants/v2 v2.9.0/go.mod h1:7ZxyxsqE4vvW0M7LSD8aI3cKwgFhBHbxnlN8mDqHa1I=
github.com/paulmach/orb v0.11.0 h1:JfVXJUBeH9ifc/OrhBY0lL16QsmPgpCHMlqSSYhcgAA=
github.com/paulmach/orb v0.11.0/go.mod h1:5mULz1xQfs3bmQm63QEJA6lNGujuRafwA5S/EnuLaLU=
github.com/paulmach/orb v0.11.1 h1:3koVegMC4X/WeiXYz9iswopaTwMem53NzTJuTF20JzU=
github.com/paulmach/orb v0.11.1/go.mod h1:5mULz1xQfs3bmQm63QEJA6lNGujuRafwA5S/EnuLaLU=
github.com/paulmach/protoscan v0.2.1/go.mod h1:SpcSwydNLrxUGSDvXvO0P7g7AuhJ7lcKfDlhJCDw2gY=
github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI=
github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
@ -212,8 +216,8 @@ github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1B
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rivo/uniseg v0.4.6 h1:Sovz9sDSwbOz9tgUy8JpT+KgCkPYJEN/oYzlJiYTNLg=
github.com/rivo/uniseg v0.4.6/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
@ -378,10 +382,10 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac h1:ZL/Teoy/ZGnzyrqK/Optxxp2pmVh+fmJ97slxSRyzUg=
google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 h1:Lj5rbfG876hIAYFjqiJnPHfhXbv+nzTWfm04Fg/XSVU=
google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s=
google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe h1:0poefMBYvYbs7g5UkjS6HcxBPaTRAmznle9jnxYoAI8=
google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe h1:bQnxqljG/wqi4NTXu2+DJ3n7APcEA882QZ1JvhQAq9o=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s=
google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0=
google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=

View file

@ -0,0 +1,27 @@
#!/bin/bash
FROM="$1"
OLD_FILE="$(mktemp)"
NEW_FILE="$(mktemp)"
declare -A old
git show "$FROM:go.mod" \
| sed -n -e '6 { /require/ b x; :x { p; n; /)/ q; b x} }' > "$OLD_FILE"
while IFS= read -r line; do
x=( $line )
old[${x[0]}]=${x[1]}
done < "$OLD_FILE"
declare -A new
cat go.mod \
| sed -n -e '6 { /require/ b x; :x { p; n; /)/ q; b x} }' > "$NEW_FILE"
while IFS= read -r line; do
x=( $line )
new[${x[0]}]=${x[1]}
done < "$NEW_FILE"
for index in ${!new[@]}; do
if [[ -n $old[$index] ]] && [[ ${old[$index]} != ${new[$index]} ]]; then
echo "- \`$index\` from ${old[$index]} to ${new[$index]}"
fi
done

View file

@ -1,18 +1,22 @@
package main
import (
"bytes"
"encoding/json"
"flag"
"fmt"
"os"
"sort"
"strings"
local_metrics "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/metrics"
"git.frostfs.info/TrueCloudLab/frostfs-observability/metrics"
)
var (
node = flag.String("node", "", "File to export storage node metrics to.")
ir = flag.String("ir", "", "File to export innerring node metrics to.")
node = flag.String("node", "", "File to export storage node metrics to.")
ir = flag.String("ir", "", "File to export innerring node metrics to.")
format = flag.String("format", "json", "Format to export in. Supported formats: json (default), md.")
)
func main() {
@ -37,12 +41,41 @@ func main() {
os.Exit(1)
}
ds := metrics.DescribeAll()
var data []byte
var err error
data, err := json.Marshal(ds)
if err != nil {
fmt.Fprintf(os.Stderr, "Could not parse marshal: %v\n", err)
os.Exit(1)
ds := metrics.DescribeAll()
switch *format {
case "md":
sort.Slice(ds, func(i, j int) bool {
return ds[i].Name < ds[j].Name
})
b := bytes.NewBuffer(nil)
b.WriteString("# FrostFS Node prometheus metrics\n")
b.WriteString("Name | Description | Constant labels | Variable labels\n")
b.WriteString("-- | -- | -- | --\n")
for i := range ds {
constLabels := make([]string, 0, len(ds[i].ConstantLabels))
for key, value := range ds[i].ConstantLabels {
constLabels = append(constLabels, fmt.Sprintf("`%s=%s`", key, value))
}
// FIXME omg do it better
ss := make([]string, len(ds[i].VariableLabels))
copy(ss, ds[i].VariableLabels)
for i := range ss {
ss[i] = fmt.Sprintf("`%s`", ss[i])
}
varLabels := strings.Join(ss, "<br>")
fmt.Fprintf(b, "`%s` | %s | %s | %s\n", ds[i].Name, ds[i].Help, strings.Join(constLabels, "<br>"), varLabels)
}
data = b.Bytes()
default:
data, err = json.Marshal(ds)
if err != nil {
fmt.Fprintf(os.Stderr, "Could not parse marshal: %v\n", err)
os.Exit(1)
}
}
if err := os.WriteFile(filename, data, 0o644); err != nil {