Skip to content

Commit

Permalink
limit number of tags on ao metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael-theriault-swi committed Oct 8, 2024
1 parent ecf18ee commit 1aebe31
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/solarwinds-apm/src/appoptics/exporters/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ import {
type Histogram,
} from "@solarwinds-apm/histogram"

const MAX_TAGS = 50

export class AppopticsMetricExporter {
readonly #reporter: oboe.Reporter

Expand Down Expand Up @@ -239,7 +241,8 @@ export class AppopticsMetricExporter {
tags: Record<string, string>,
): [tags: oboe.MetricTags, count: number] {
const entries = Object.entries(tags)
const count = entries.length
const count = Math.max(entries.length, MAX_TAGS)
entries.length = count

const oboeTags = new oboe.MetricTags(count)
for (const [i, [k, v]] of entries.entries()) {
Expand Down

0 comments on commit 1aebe31

Please sign in to comment.