Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement dump metrics #200

Merged
merged 8 commits into from
Sep 27, 2023
Merged

feat: implement dump metrics #200

merged 8 commits into from
Sep 27, 2023

Conversation

Igorgro
Copy link
Contributor

@Igorgro Igorgro commented Sep 22, 2023

No description provided.

@Igorgro Igorgro requested a review from eldargab September 22, 2023 08:38
Copy link
Collaborator

@eldargab eldargab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, generate change files with rush change -b origin/master

util/util-internal-archive-layout/src/layout.ts Outdated Show resolved Hide resolved
util/util-internal-archive-layout/src/layout.ts Outdated Show resolved Hide resolved
substrate/substrate-dump/src/prometheus.ts Outdated Show resolved Hide resolved
substrate/substrate-dump/src/dumper.ts Outdated Show resolved Hide resolved
substrate/substrate-dump/package.json Outdated Show resolved Hide resolved
substrate/substrate-dump/src/main.ts Outdated Show resolved Hide resolved
substrate/substrate-dump/src/dumper.ts Outdated Show resolved Hide resolved
substrate/substrate-dump/src/dumper.ts Outdated Show resolved Hide resolved
substrate/substrate-dump/src/prometheus.ts Outdated Show resolved Hide resolved
@Igorgro Igorgro requested a review from eldargab September 25, 2023 11:01
@Igorgro
Copy link
Contributor Author

Igorgro commented Sep 25, 2023

Please, generate change files with rush change -b origin/master

Done

@Igorgro
Copy link
Contributor Author

Igorgro commented Sep 26, 2023

Added rpc requests metrics

Copy link
Collaborator

@eldargab eldargab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, avoid code style changes.

substrate/substrate-dump/src/dumper.ts Outdated Show resolved Hide resolved
substrate/substrate-dump/src/dumper.ts Outdated Show resolved Hide resolved
substrate/substrate-dump/src/dumper.ts Outdated Show resolved Hide resolved
substrate/substrate-dump/src/dumper.ts Outdated Show resolved Hide resolved
substrate/substrate-dump/src/dumper.ts Outdated Show resolved Hide resolved
substrate/substrate-dump/src/main.ts Outdated Show resolved Hide resolved
util/util-internal-archive-layout/src/layout.ts Outdated Show resolved Hide resolved
substrate/substrate-dump/src/dumper.ts Outdated Show resolved Hide resolved
to: assertNotNull(lastBlock)
}
const chunk = getNextChunk(blockRange.from, blockRange.to)
chunk.transactDir('.', async fs => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing await

});

this.rpcRequestsGauge = new Gauge({
name: 'sqd_rpc_requests_count',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General pattern for metric names in the SDK is sqd_{app}_{name}.

Since there could be multiple RPC connections used from a single process, url label should be added as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see currently only one url. But ok, will add this

collect() {
const metrics = rpc.getMetrics();
this.set({
kind: 'successful',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be success | failure instead of successful | failed? Sounds better to me.

@eldargab eldargab merged commit 3c3d0d6 into master Sep 27, 2023
1 check passed
@eldargab eldargab deleted the feat/dump-metrics branch September 27, 2023 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants