Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing dots from the internal cardinality metric names. '.' is used as a default delimitter for the scope. #261

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions scope_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ var (
scopeRegistryKey = keyForPrefixedStringMaps

// Metrics related.
counterCardinalityName = "tally.internal.counter_cardinality"
gaugeCardinalityName = "tally.internal.gauge_cardinality"
histogramCardinalityName = "tally.internal.histogram_cardinality"
scopeCardinalityName = "tally.internal.num_active_scopes"
counterCardinalityName = "tally_internal_counter_cardinality"
gaugeCardinalityName = "tally_internal_gauge_cardinality"
histogramCardinalityName = "tally_internal_histogram_cardinality"
scopeCardinalityName = "tally_internal_num_active_scopes"
)

const (
Expand Down
14 changes: 14 additions & 0 deletions scope_registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,25 @@ func TestVerifyOmitCardinalityMetricsTags(t *testing.T) {
closer.Close()
r.WaitAll()

assert.NotNil(t, r.gauges[gaugeCardinalityName], "gauge cardinality should not be nil")
assert.NotNil(t, r.gauges[histogramCardinalityName], "histogram cardinality should not be nil")
assert.NotNil(t, r.gauges[counterCardinalityName], "counter cardinality should not be nil")
assert.NotNil(t, r.gauges[scopeCardinalityName], "scope cardinality should not be nil")

assert.Equal(
t, wantOmitCardinalityMetricsTags, r.gauges[counterCardinalityName].tags, "expected tags %v, got tags %v",
wantOmitCardinalityMetricsTags, r.gauges[counterCardinalityName].tags,
)
assert.Equal(t, wantOmitCardinalityMetricsTags, r.gauges[gaugeCardinalityName].tags, "expected tags %v, got tags %v",
wantOmitCardinalityMetricsTags, r.gauges[gaugeCardinalityName].tags,
)
assert.Equal(t, wantOmitCardinalityMetricsTags, r.gauges[histogramCardinalityName].tags, "expected tags %v, got tags %v",
wantOmitCardinalityMetricsTags, r.gauges[histogramCardinalityName].tags,
)
assert.Equal(t, wantOmitCardinalityMetricsTags, r.gauges[scopeCardinalityName].tags, "expected tags %v, got tags %v",
wantOmitCardinalityMetricsTags, r.gauges[scopeCardinalityName].tags,
)

}

func TestNewTestStatsReporterOneScope(t *testing.T) {
Expand Down