-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add s3 ops metrics * changes * fix: add event emitter and change metric to Counter
- Loading branch information
Showing
13 changed files
with
135 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,5 @@ docker-compose.yml | |
/ops/docker-publish.sh | ||
|
||
**/.DS_Store | ||
|
||
*.temp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ common/autoinstallers/*/.npmrc | |
|
||
# IDE | ||
.idea | ||
.vscode | ||
|
||
# Built js libs | ||
/*/*/lib |
10 changes: 10 additions & 0 deletions
10
...nges/@subsquid/util-internal-dump-cli/octo-gone-feat-add-s3-metrics_2024-07-22-11-40.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"packageName": "@subsquid/util-internal-dump-cli", | ||
"comment": "add prometheus metrics for S3 file system handler", | ||
"type": "patch" | ||
} | ||
], | ||
"packageName": "@subsquid/util-internal-dump-cli" | ||
} |
10 changes: 10 additions & 0 deletions
10
...on/changes/@subsquid/util-internal-fs/octo-gone-feat-add-s3-metrics_2024-07-22-11-40.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"packageName": "@subsquid/util-internal-fs", | ||
"comment": "add metrics for S3 file system handler", | ||
"type": "patch" | ||
} | ||
], | ||
"packageName": "@subsquid/util-internal-fs" | ||
} |
10 changes: 10 additions & 0 deletions
10
...es/@subsquid/util-internal-ingest-cli/octo-gone-feat-add-s3-metrics_2024-07-22-11-40.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"packageName": "@subsquid/util-internal-ingest-cli", | ||
"comment": "add prometheus metrics", | ||
"type": "minor" | ||
} | ||
], | ||
"packageName": "@subsquid/util-internal-ingest-cli" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import {createPrometheusServer, ListeningServer} from '@subsquid/util-internal-prometheus-server' | ||
import {collectDefaultMetrics, Counter, Registry} from 'prom-client' | ||
|
||
|
||
export class PrometheusServer { | ||
private registry = new Registry() | ||
private s3RequestsCounter: Counter | ||
|
||
constructor( | ||
private port: number, | ||
) { | ||
this.s3RequestsCounter = new Counter({ | ||
name: 'sqd_s3_request_count', | ||
help: 'Number of s3 requests made', | ||
labelNames: ['kind'], | ||
registers: [this.registry], | ||
}) | ||
|
||
collectDefaultMetrics({register: this.registry}) | ||
} | ||
|
||
incS3Requests(kind: string, value?: number) { | ||
this.s3RequestsCounter.inc({kind}, value) | ||
} | ||
|
||
serve(): Promise<ListeningServer> { | ||
return createPrometheusServer(this.registry, this.port) | ||
} | ||
} |