Commit 5c89c45f authored by Ben Wilson's avatar Ben Wilson Committed by GitHub

Move the metric prefix string to a label (#1047)

Added changeset and fixes
Changeset to patch
parent b74b0520
---
'@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
......@@ -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(
......@@ -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(
......
......@@ -9,7 +9,7 @@ import { Server } from 'net'
import { Logger } from './logger'
export interface MetricsOptions {
prefix: string
prefix?: string
labels?: Object
}
......
......@@ -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({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment