Skip to content

Commit

Permalink
Standardize Metrics In GRPC 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 0fd8360 commit f7547da
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions plugin/storage/grpc/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,14 @@ func (f *Factory) newRemoteStorage(

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

// CreateSpanWriter implements storage.Factory
Expand Down Expand Up @@ -198,7 +205,14 @@ func (f *Factory) CreateArchiveSpanReader() (spanstore.Reader, error) {
if capabilities == nil || !capabilities.ArchiveSpanReader {
return nil, storage.ErrArchiveStorageNotSupported
}
return f.services.ArchiveStore.ArchiveSpanReader(), nil
archiveMetricsFactory := f.telset.Metrics.Namespace(
metrics.NSOptions{
Tags: map[string]string{
"role": "archive",
},
},
)
return spanstoremetrics.NewReaderDecorator(f.services.ArchiveStore.ArchiveSpanReader(), archiveMetricsFactory), nil
}

// CreateArchiveSpanWriter implements storage.ArchiveFactory
Expand Down

0 comments on commit f7547da

Please sign in to comment.