Skip to content

Commit

Permalink
fix: append pid to metrics instance identifier (#1227)
Browse files Browse the repository at this point in the history
  • Loading branch information
smrz2001 authored Jun 12, 2024
1 parent 78439da commit 8e9527b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,12 @@ export class CeramicAnchorApp {
this.config.metrics.exportTimeoutMillis
)
Metrics.count('HELLO', 1)
logger.imp('Metrics exporter started')
logger.imp(
`Metrics exporter started for instance "${this.config.metrics.instanceIdentifier}" and process ID ${process.pid}`
)
if (this.config.metrics.instanceIdentifier) {
Metrics.setInstanceIdentifier(this.config.metrics.instanceIdentifier)
// Append the PID to the metrics identifier to ensure uniqueness with clustering
Metrics.setInstanceIdentifier(this.config.metrics.instanceIdentifier + '_' + process.pid)
}
} catch (e: any) {
logger.imp('ERROR: Metrics exporter failed to start. Continuing anyway.')
Expand Down

0 comments on commit 8e9527b

Please sign in to comment.