Skip to content
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
4 changes: 2 additions & 2 deletions internal/agentcfg/elasticsearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func (f *ElasticsearchFetcher) Run(ctx context.Context) error {
refresh := func() bool {
// refresh returns a bool that indicates whether Run should return
// immediately without error, e.g. due to invalid Elasticsearch config.
ctx, tx := f.tracer.Start(ctx, "ElasticsearchFetcher.refresh")
ctx, tx := f.tracer.Start(ctx, "ElasticsearchFetcher.refresh", trace.WithSpanKind(trace.SpanKindInternal))
defer tx.End()

if err := f.refreshCache(ctx); err != nil {
Expand Down Expand Up @@ -220,7 +220,7 @@ type cacheResult struct {
}

func (f *ElasticsearchFetcher) refreshCache(ctx context.Context) (err error) {
ctx, span := f.tracer.Start(ctx, "ElasticsearchFetcher.refreshCache")
ctx, span := f.tracer.Start(ctx, "ElasticsearchFetcher.refreshCache", trace.WithSpanKind(trace.SpanKindInternal))
defer span.End()

scrollID := ""
Expand Down
2 changes: 1 addition & 1 deletion internal/beater/interceptors/tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func Tracing(tp trace.TracerProvider) grpc.UnaryServerInterceptor {
info *grpc.UnaryServerInfo,
handler grpc.UnaryHandler,
) (any, error) {
ctx, span := tracer.Start(ctx, info.FullMethod)
ctx, span := tracer.Start(ctx, info.FullMethod, trace.WithSpanKind(trace.SpanKindServer))
defer span.End()

resp, err := handler(ctx, req)
Expand Down
2 changes: 1 addition & 1 deletion internal/beater/waitready.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func waitReady(
) error {
tracer := tp.Tracer("github.com/elastic/apm-server/internal/beater")
logger.Info("blocking ingestion until all preconditions are satisfied")
ctx, span := tracer.Start(ctx, "wait_for_preconditions")
ctx, span := tracer.Start(ctx, "wait_for_preconditions", trace.WithSpanKind(trace.SpanKindInternal))
defer span.End()
var ticker *time.Ticker
for {
Expand Down
8 changes: 4 additions & 4 deletions internal/sourcemap/metadata_fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func (s *MetadataESFetcher) startBackgroundSync(ctx context.Context) {
}

func (s *MetadataESFetcher) sync(ctx context.Context) error {
ctx, tx := s.tracer.Start(ctx, "MetadataESFetcher.sync")
ctx, tx := s.tracer.Start(ctx, "MetadataESFetcher.sync", trace.WithSpanKind(trace.SpanKindInternal))
defer tx.End()

sourcemaps := make(map[identifier]string)
Expand Down Expand Up @@ -208,7 +208,7 @@ func (s *MetadataESFetcher) clearScroll(ctx context.Context, scrollID string) {
}

func (s *MetadataESFetcher) update(ctx context.Context, sourcemaps map[identifier]string) {
ctx, span := s.tracer.Start(ctx, "MetadataESFetcher.update")
ctx, span := s.tracer.Start(ctx, "MetadataESFetcher.update", trace.WithSpanKind(trace.SpanKindInternal))
defer span.End()

s.mu.Lock()
Expand Down Expand Up @@ -270,7 +270,7 @@ func (s *MetadataESFetcher) update(ctx context.Context, sourcemaps map[identifie
}

func (s *MetadataESFetcher) initialSearch(ctx context.Context, updates map[identifier]string) (*esSearchSourcemapResponse, error) {
ctx, span := s.tracer.Start(ctx, "MetadataESFetcher.initialSearch")
ctx, span := s.tracer.Start(ctx, "MetadataESFetcher.initialSearch", trace.WithSpanKind(trace.SpanKindInternal))
defer span.End()

resp, err := s.runSearchQuery(ctx)
Expand Down Expand Up @@ -371,7 +371,7 @@ func parseResponse(body io.ReadCloser, logger *logp.Logger) (*esSearchSourcemapR
}

func (s *MetadataESFetcher) scrollsearch(ctx context.Context, scrollID string, updates map[identifier]string) (*esSearchSourcemapResponse, error) {
ctx, span := s.tracer.Start(ctx, "MetadataESFetcher.scrollSearch")
ctx, span := s.tracer.Start(ctx, "MetadataESFetcher.scrollSearch", trace.WithSpanKind(trace.SpanKindInternal))
defer span.End()

resp, err := s.runScrollSearchQuery(ctx, scrollID)
Expand Down