Skip to content

Commit

Permalink
Merge pull request #489 from veho-technologies/fix/metrics-missing-na…
Browse files Browse the repository at this point in the history
…mespace

fix: Metrics not including Namespace
  • Loading branch information
Michael O'Brien committed Jul 31, 2023
2 parents 330779d + 5aae448 commit 6c67f6c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,19 +186,19 @@ export class Metrics {

emitMetrics(timestamp, rec) {
let {dimensionValues, dimensions, properties, totals} = rec
let metrics = this.metrics
let metricsParams = this.metrics

let requests = totals.requests
totals.latency = totals.latency / requests
totals.count = totals.count / requests
totals.scanned = totals.scanned / requests

if (this.log.metrics) {
let chan = metrics.chan || 'dbmetrics'
let chan = metricsParams.chan || 'dbmetrics'
this.log.metrics(
chan,
`OneTable Custom Metrics ${dimensions}`,
metrics.namespace,
metricsParams.namespace,
totals,
dimensions,
{latency: 'Milliseconds', default: 'Count'},
Expand All @@ -215,7 +215,7 @@ export class Metrics {
CloudWatchMetrics: [
{
Dimensions: [dimensions],
Namespace: metrics.namespace,
Namespace: metricsParams.namespace,
Metrics: metrics,
},
],
Expand Down

0 comments on commit 6c67f6c

Please sign in to comment.