Skip to content

Commit

Permalink
Standardize Metrics In Memory Storage
Browse files Browse the repository at this point in the history
Signed-off-by: Mahad Zaryab <[email protected]>
  • Loading branch information
mahadzaryab1 committed Nov 30, 2024
1 parent 6744399 commit 0fd8360
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions plugin/storage/memory/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,14 @@ func (f *Factory) Initialize(metricsFactory metrics.Factory, logger *zap.Logger)

// CreateSpanReader implements storage.Factory
func (f *Factory) CreateSpanReader() (spanstore.Reader, error) {
return spanstoremetrics.NewReaderDecorator(f.store, f.metricsFactory), nil
primaryMetricsFactory := f.metricsFactory.Namespace(
metrics.NSOptions{
Tags: map[string]string{
"role": "primary",
},
},
)
return spanstoremetrics.NewReaderDecorator(f.store, primaryMetricsFactory), nil
}

// CreateSpanWriter implements storage.Factory
Expand All @@ -92,7 +99,14 @@ func (f *Factory) CreateSpanWriter() (spanstore.Writer, error) {

// CreateArchiveSpanReader implements storage.ArchiveFactory
func (f *Factory) CreateArchiveSpanReader() (spanstore.Reader, error) {
return f.store, nil
archiveMetricsFactory := f.metricsFactory.Namespace(
metrics.NSOptions{
Tags: map[string]string{
"role": "archive",
},
},
)
return spanstoremetrics.NewReaderDecorator(f.store, archiveMetricsFactory), nil
}

// CreateArchiveSpanWriter implements storage.ArchiveFactory
Expand Down

0 comments on commit 0fd8360

Please sign in to comment.