From 7085767fa09ffa34aef72727c05110d12f61ccc2 Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Wed, 21 Feb 2024 14:04:44 +0100 Subject: [PATCH] Fix context propagation in APM transaction for index watcher --- CHANGELOG.md | 2 ++ storage/indexer.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46534c142..db231e636 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Bugfixes +* Fix context propagation in APM transaction for watcher backend process. [#1150](https://github.com/elastic/package-registry/issues/1150) + ### Added ### Deprecated diff --git a/storage/indexer.go b/storage/indexer.go index e31539b58..c18800b5e 100644 --- a/storage/indexer.go +++ b/storage/indexer.go @@ -123,7 +123,7 @@ func (i *Indexer) watchIndices(ctx context.Context) { tx := i.options.APMTracer.StartTransaction("updateIndex", "backend.watcher") defer tx.End() - err = i.updateIndex(ctx) + err = i.updateIndex(apm.ContextWithTransaction(ctx, tx)) if err != nil { i.logger.Error("can't update index file", zap.Error(err)) }