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

Move the metric prefix string to a label #1047

Merged
merged 1 commit into from
Jun 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/sour-adults-worry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@eth-optimism/batch-submitter': patch
'@eth-optimism/common-ts': patch
'@eth-optimism/data-transport-layer': patch
---

Move the metric prefix string to a label #1047
4 changes: 2 additions & 2 deletions packages/batch-submitter/src/exec/run-batch-submitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export const run = async () => {
const env = process.env
const environment = config.str('node-env', env.NODE_ENV)
const network = config.str('eth-network-name', env.ETH_NETWORK_NAME)
const service = `batch-submitter`
const release = `batch-submitter@${env.npm_package_version}`
const sentryDsn = config.str('sentry-dsn', env.SENTRY_DSN)
const sentryTraceRate = config.ufloat(
Expand Down Expand Up @@ -181,8 +182,7 @@ export const run = async () => {

/* Metrics */
const metrics = new Metrics({
prefix: name,
labels: { environment, release, network },
labels: { environment, release, network, service },
})

const FRAUD_SUBMISSION_ADDRESS = config.str(
Expand Down
2 changes: 1 addition & 1 deletion packages/common-ts/src/common/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Server } from 'net'
import { Logger } from './logger'

export interface MetricsOptions {
prefix: string
prefix?: string
labels?: Object
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,11 @@ export class L1TransportServer extends BaseService<L1TransportServerOptions> {
*/
private _initMetrics() {
this.metrics = new Metrics({
prefix: this.name,
labels: {
environment: this.options.nodeEnv,
network: this.options.ethNetworkName,
release: this.options.release,
service: this.name,
},
})
const metricsMiddleware = promBundle({
Expand Down