Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

fix: update metric names to follow prometheus naming guide #228

Merged
merged 2 commits into from
Nov 17, 2022
Merged
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
6 changes: 3 additions & 3 deletions src/listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,22 @@ export class TCPListener extends EventEmitter<ListenerEvents> implements Listene
addr = `${address.address}:${address.port}`
}

context.metrics?.registerMetric(`libp2p_tcp_connections_${addr}_count`, {
context.metrics?.registerMetric(`libp2p_tcp_connections_${addr}_total`, {
help: 'Current active connections in TCP listener',
calculate: () => {
return this.connections.size
}
})

this.metrics = {
status: context.metrics.registerMetric(`libp2p_tcp_${addr}_server_status`, {
status: context.metrics.registerMetric(`libp2p_tcp_${addr}_server_status_info`, {
help: 'Current status of the TCP server'
}),
errors: context.metrics.registerCounterGroup(`libp2p_tcp_${addr}_server_errors_total`, {
label: 'error',
help: 'Total count of TCP listener errors by error type'
}),
events: context.metrics.registerCounterGroup(`libp2p_tcp_$${addr}_socket_events`, {
events: context.metrics.registerCounterGroup(`libp2p_tcp_${addr}_socket_events_total`, {
label: 'event',
help: 'Total count of TCP socket events by event'
})
Expand Down