Skip to content

Commit

Permalink
sets otel to main
Browse files Browse the repository at this point in the history
Signed-off-by: Afzal Ansari <[email protected]>
  • Loading branch information
afzal442 committed Jul 26, 2023
1 parent f0fbead commit bdc5871
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cmd/all-in-one/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (

"github.com/spf13/cobra"
"github.com/spf13/viper"
"go.opentelemetry.io/otel"
_ "go.uber.org/automaxprocs"
"go.uber.org/zap"

Expand Down Expand Up @@ -104,6 +105,7 @@ by default uses only in-memory database.`,
if err != nil {
logger.Fatal("Failed to initialize tracer", zap.Error(err))
}
otel.SetTracerProvider(tracer.OTEL)

storageFactory.InitFromViper(v, logger)
if err := storageFactory.Initialize(metricsFactory, logger); err != nil {
Expand Down
2 changes: 2 additions & 0 deletions cmd/query/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (

"github.com/spf13/cobra"
"github.com/spf13/viper"
"go.opentelemetry.io/otel"
_ "go.uber.org/automaxprocs"
"go.uber.org/zap"

Expand Down Expand Up @@ -76,6 +77,7 @@ func main() {
if err != nil {
logger.Fatal("Failed to create tracer:", zap.Error(err))
}
otel.SetTracerProvider(jtracer.OTEL)
queryOpts, err := new(app.QueryOptions).InitFromViper(v, logger)
if err != nil {
logger.Fatal("Failed to configure query service", zap.Error(err))
Expand Down
2 changes: 1 addition & 1 deletion plugin/storage/es/spanstore/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ func bucketToStringArray(buckets []*elastic.AggregationBucketKeyItem) ([]string,

// FindTraces retrieves traces that match the traceQuery
func (s *SpanReader) FindTraces(ctx context.Context, traceQuery *spanstore.TraceQueryParameters) ([]*model.Trace, error) {
ctx, span := s.tracer.Start(ctx, "GetOperations")
ctx, span := s.tracer.Start(ctx, "FindTraces")
defer span.End()

uniqueTraceIDs, err := s.FindTraceIDs(ctx, traceQuery)
Expand Down

0 comments on commit bdc5871

Please sign in to comment.