fix(loki.enrich): Use shared loki functions and fix locking#5821
Conversation
|
TruffleHog Scan Results Summary: Found 1 potential secrets (0 verified, 1 unverified)
Review: Check if unverified secrets are false positives. Ignoring False Positives: This works for files that support line numbers (most source files). After adding the comment, push your changes and the scan will re-run. |
There was a problem hiding this comment.
Pull request overview
This PR migrates log consumption/draining helpers from the loki/source area into the shared internal/component/common/loki package, and refactors loki.enrich to use the shared Loki fanout/consume utilities while fixing a potential race by locking around reads of stored arguments.
Changes:
- Move/standardize
Consume*andDrainhelpers underinternal/component/common/lokiand update call sites across Loki sources/process. - Refactor
loki.enrichto useloki.Fanout+loki.ConsumeAndProcessand to hold locks when reading component args/cache. - Update/enhance tests for the new shared helper locations and the
loki.enrichrefactor.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/component/loki/source/kubernetes_events/kubernetes_events.go | Switch drain/consume usage to shared common/loki helpers. |
| internal/component/loki/source/journal/journal.go | Switch drain/consume usage to shared common/loki helpers. |
| internal/component/loki/source/gcplog/gcplog.go | Replace source.Consume with loki.Consume and drop source import. |
| internal/component/loki/source/file/file.go | Replace source.Consume with loki.Consume. |
| internal/component/loki/source/docker/docker.go | Replace source.Drain/source.Consume with loki.Drain/loki.Consume. |
| internal/component/loki/source/cloudflare/cloudflare.go | Replace source.Drain/source.Consume with loki.Drain/loki.Consume and drop source import. |
| internal/component/loki/source/aws_firehose/component.go | Replace source.Consume with loki.Consume and drop source import. |
| internal/component/loki/source/api/api.go | Replace source.ConsumeBatch with loki.ConsumeBatch and drop source import. |
| internal/component/loki/process/process.go | Replace source.* helper usage with loki.* shared helpers and drop source import. |
| internal/component/loki/enrich/enrich.go | Refactor to use shared consume/fanout; fix locking for args/cache reads. |
| internal/component/loki/enrich/enrich_test.go | Update tests to drive component via exported receiver and collecting handler. |
| internal/component/common/loki/drain.go | Define Drain in shared Loki package. |
| internal/component/common/loki/drain_test.go | Update tests to new shared package/location. |
| internal/component/common/loki/consume.go | Define Consume, ConsumeAndProcess, and ConsumeBatch in shared Loki package. |
| internal/component/common/loki/consume_test.go | Update tests to new shared package/location. |
Comments suppressed due to low confidence (2)
internal/component/common/loki/consume.go:41
- In
consume, the loop later reads fromrecv.Chan()without checking the ok result. If the channel is ever closed, it will spin receiving the zeroEntryvalue and repeatedly attempting to fan out. Consider receiving withentry, ok := <-recv.Chan()and returning when!ok(similar toDrain).
internal/component/common/loki/consume.go:69 ConsumeBatchreads fromrecv.Chan()without checking the ok result. If the batch channel is closed, this will loop forever receiving a nil/zero batch and repeatedly callingSendBatch. Consider usingbatch, ok := <-recv.Chan()and returning when!ok.
There was a problem hiding this comment.
Pull request overview
This PR migrates Loki component run-loop helpers (consume/drain) into the shared internal/component/common/loki package and refactors loki.enrich to use the shared fanout/consume utilities while fixing concurrent access to stored arguments/target cache.
Changes:
- Move/standardize log consumption and draining helpers under
common/lokiand update Loki components to callloki.Consume*/loki.Drain. - Refactor
loki.enrichto useloki.ConsumeAndProcess+loki.Fanout, and guard reads/writes with a RW lock to avoid data races. - Update/adjust tests to match the new shared helper locations and the new
loki.enrichruntime flow.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| internal/component/loki/source/kubernetes_events/kubernetes_events.go | Switch shutdown drain + run-loop consumption to shared loki.Drain/loki.Consume. |
| internal/component/loki/source/journal/journal.go | Use shared loki.Drain/loki.Consume and drop the old source helper import. |
| internal/component/loki/source/gcplog/gcplog.go | Use shared loki.Consume. |
| internal/component/loki/source/file/file.go | Use shared loki.Consume in the consume/fanout loop. |
| internal/component/loki/source/docker/docker.go | Use shared loki.Drain/loki.Consume during shutdown and run loop. |
| internal/component/loki/source/cloudflare/cloudflare.go | Use shared loki.Drain/loki.Consume and remove the old source helper import. |
| internal/component/loki/source/aws_firehose/component.go | Use shared loki.Consume and remove the old source helper import. |
| internal/component/loki/source/api/api.go | Use shared loki.ConsumeBatch and remove the old source helper import. |
| internal/component/loki/process/process.go | Use shared loki.Drain and loki.ConsumeAndProcess. |
| internal/component/loki/enrich/enrich.go | Refactor to shared consume/fanout utilities; add locking around args/cache reads and updates. |
| internal/component/loki/enrich/enrich_test.go | Update enrichment test to exercise the component via receiver + shared collecting handler. |
| internal/component/common/loki/consume.go | Relocate/standardize consume helpers into the loki package API surface. |
| internal/component/common/loki/consume_test.go | Update consume tests to new package location/types. |
| internal/component/common/loki/drain.go | Relocate/standardize drain helper into the loki package API surface. |
| internal/component/common/loki/drain_test.go | Update drain test to new package location/types. |
Comments suppressed due to low confidence (2)
internal/component/common/loki/consume.go:52
consumereads fromrecv.Chan()without checking whether the channel has been closed. If the receiver channel is ever closed (some tests do this, and CollectingHandler.Stop() closes its channel), the receive will return the zero Entry immediately and the loop will spin, repeatedly forwarding zero values and burning CPU. Handle theokvalue from the receive and return when the channel is closed (similar to howDrainhandles it).
internal/component/common/loki/consume.go:73ConsumeBatchalso receives fromrecv.Chan()without checking theokresult. If the batch channel is closed, the loop will continuously receive a nil/zero batch and callSendBatch, causing a tight loop and potentially unexpected forwarding. Please checkokon receive and return when the channel is closed.
🤖 I have created a release *beep* *boop* --- ## [1.15.0](v1.14.0...v1.15.0) (2026-03-26) ### ⚠ BREAKING CHANGES * **otelcol:** Upgrade to OTel Collector v0.147.0 ([#5784](#5784)) * Renamed undocumented metrics that was previously prefixed with <component_id>_<metric_name> to loki_source_awsfirehose_<metric_name> ### Features 🌟 * **alloy-mixin:** Add filters, groupBy, and multi-select dashboard variables ([#5611](#5611)) ([3ef714e](3ef714e)) * **beyla.ebpf:** Add support for Prometheus native histograms ([#5812](#5812)) ([7d806fb](7d806fb)) * **beyla.ebpf:** Bump Beyla to v3.6 ([#5833](#5833)) ([cd878d5](cd878d5)) * **converters:** Support converting Promtail limits_config ([#5777](#5777)) ([9491385](9491385)) * **database_observability.mysql:** Add filtering of query samples and wait events by minimum duration ([#5678](#5678)) ([5a4d03b](5a4d03b)) * **database_observability.mysql:** Embed prometheus exporter within db-o11y component ([#5711](#5711)) ([88bffb0](88bffb0)) * **database_observability.postgres:** Add configurable limit to `pg_stat_statements` query ([#5639](#5639)) ([0de0a3f](0de0a3f)) * **database_observability.postgres:** Embed prometheus exporter within db-o11y component ([#5714](#5714)) ([9dc2e83](9dc2e83)) * **database_observability:** Add scaffolding for db-o11y integration tests ([#5575](#5575)) ([ca637d8](ca637d8)) * **database_observability:** Promote components to stable ([#5736](#5736)) ([21a9af6](21a9af6)) * Expose Functionality to Handle syslogs with Empty MSG Field ([#5687](#5687)) ([178b1e6](178b1e6)) * **helm:** Allow setting `revisionHistoryLimit` in the helm chart ([#5847](#5847)) ([9713ad4](9713ad4)) * **loki.process:** Support structured metadata as source type of stage.labels for loki.process ([#5055](#5055)) ([eda3152](eda3152)) * **loki.secretfilter:** Add sampling for secretfilter entries ([#5663](#5663)) ([9997802](9997802)) * **loki.source.gcplog:** Add alloy config for MaxOutstandingBytes and MaxOutstandingMessages ([#5760](#5760)) ([c2b9f0b](c2b9f0b)) * **loki.write:** Add loki pipeline latency metric ([#5702](#5702)) ([cc744a1](cc744a1)) * **mixin:** Update loki dashboard ([#5848](#5848)) ([b616d58](b616d58)) * **otelcol.receiver.datadog:** Expose intake proxy and trace_id_cache_size settings ([#5776](#5776)) ([0384ad4](0384ad4)) * **otelcol:** Upgrade to OTel Collector v0.147.0 ([#5784](#5784)) ([a9b5396](a9b5396)) * **prometheus.exporter.cloudwatch:** Use aws-sdk-go-v2 by default ([#5768](#5768)) ([a2f3489](a2f3489)) * **pyroscope.ebpf:** Add comm, pid labels and kernel frame options ([#5769](#5769)) ([4fa7068](4fa7068)) * **pyroscope.ebpf:** Expose OTel eBPF profiler internal metrics to Prometheus ([#5774](#5774)) ([e713392](e713392)) * **pyroscope:** Copy prometheus common/config HTTP client into promhttp2 package ([#5810](#5810)) ([0b31aaa](0b31aaa)) ### Bug Fixes 🐛 * **beyla:** Inject Beyla version into binary via ldflags ([#5735](#5735)) ([71c03ec](71c03ec)) * Correctly handle the deprecated topic field in otelcol.receiver.kafka configuration ([#5726](#5726)) ([538ac75](538ac75)) * **database_observability.mysql:** Ensure result sets are properly closed ([#5893](#5893)) ([f28f91c](f28f91c)) * **database_observability:** Ensure all collectors are properly stopped ([#5796](#5796)) ([6bfa2a7](6bfa2a7)) * **database_observability:** Ensure that `connection_info` metric is only emitted for a given DB instance when it is available ([#5707](#5707)) ([bf0c3dc](bf0c3dc)) * **database_observability:** Solve test flakiness in MySQL and Postgres sample collectors ([#5130](#5130)) ([a7590d1](a7590d1)) * **deps:** Update module github.com/buger/jsonparser to v1.1.2 [SECURITY] ([#5834](#5834)) ([b2fee8a](b2fee8a)) * **deps:** Update module github.com/buger/jsonparser to v1.1.2 [SECURITY] ([#5870](#5870)) ([698b4e7](698b4e7)) * **deps:** Update module google.golang.org/grpc to v1.79.3 [SECURITY] ([#5825](#5825)) ([5cfbcc4](5cfbcc4)) * **deps:** Update module google.golang.org/grpc to v1.79.3 [SECURITY] ([#5871](#5871)) ([259152d](259152d)) * **deps:** Update npm dependencies ([#5876](#5876)) ([f0f6a11](f0f6a11)) * **deps:** Update npm deps across repo to address CVE-2026-26996 and CVE-2026-22029 ([#5872](#5872)) ([df518dd](df518dd)) * **go:** Update build image to go v1.25.8 ([#5832](#5832)) ([f9b3043](f9b3043)) * **go:** Update go to 1.25.8 ([#5844](#5844)) ([534e7db](534e7db)) * Helm: alloy.extraPorts not working with service.type=NodePort [COPY] ([#5892](#5892)) ([162c6f7](162c6f7)) * **loki.enrich:** Use shared loki functions and fix locking ([#5821](#5821)) ([f916c72](f916c72)) * **loki.process:** Multiline no longer pass empty entry if start was flushed ([#5746](#5746)) ([7bdedf1](7bdedf1)) * **loki.process:** Protect against json that does not look like docker json format ([#5761](#5761)) ([0af6eaa](0af6eaa)) * **loki.secretfilter:** Fix bug where entries were being shadow dropped ([#5786](#5786)) ([90243f9](90243f9)) * **loki.source.file:** Fix position tracking when component stops ([#5800](#5800)) ([9762946](9762946)) * **loki.source.file:** Keep positions for compressed files when reading is finished ([#5723](#5723)) ([fb41d0a](fb41d0a)) * **loki.source.gcplog:** Update to pubsub v2 and fix shutdown semantics ([#5713](#5713)) ([e9d9b69](e9d9b69)) * **loki.source.heroku:** Fix shutdown semantics and consume logs in batches ([#5804](#5804)) ([deda452](deda452)) * **loki.write:** Remove noisy log ([#5837](#5837)) ([8e28f35](8e28f35)) * **loki:** Make drain forward entries with fallback timeout ([#5830](#5830)) ([cfbca90](cfbca90)) * **prometheus.scrape:** Update arguments and targets even if `scrape_native_histograms` and `extra_metrics` are updated ([#5787](#5787)) ([dc4cb0a](dc4cb0a)) * **pyroscope.ebpf:** Update opentelemetry-ebpf-profiler ([#5904](#5904)) ([dfaec47](dfaec47)) * Stop components in a deterministic order ([#5613](#5613)) ([00cd371](00cd371)) ### Chores * Use shared source structures for aws firehose ([#5739](#5739)) ([aef19dc](aef19dc)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: grafana-alloybot[bot] <167359181+grafana-alloybot[bot]@users.noreply.github.com>
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [grafana/alloy](https://github.com/grafana/alloy) | minor | `v1.14.2` → `v1.15.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>grafana/alloy (grafana/alloy)</summary> ### [`v1.15.0`](https://github.com/grafana/alloy/releases/tag/v1.15.0) [Compare Source](grafana/alloy@v1.14.2...v1.15.0) ##### ⚠ BREAKING CHANGES - **otelcol:** Upgrade to OTel Collector v0.147.0 ([#​5784](grafana/alloy#5784)) - Renamed undocumented metrics that was previously prefixed with \<component\_id>*\<metric\_name> to loki\_source\_awsfirehose*\<metric\_name> ##### Features 🌟 - **alloy-mixin:** Add filters, groupBy, and multi-select dashboard variables ([#​5611](grafana/alloy#5611)) ([3ef714e](grafana/alloy@3ef714e)) ([@​thampiotr](https://github.com/thampiotr), [@​cursoragent](https://github.com/cursoragent)) - **beyla.ebpf:** Add support for Prometheus native histograms ([#​5812](grafana/alloy#5812)) ([7d806fb](grafana/alloy@7d806fb)) ([@​fstab](https://github.com/fstab)) - **beyla.ebpf:** Bump Beyla to v3.6 ([#​5833](grafana/alloy#5833)) ([cd878d5](grafana/alloy@cd878d5)) ([@​marctc](https://github.com/marctc), [@​tpaschalis](https://github.com/tpaschalis)) - **converters:** Support converting Promtail limits\_config ([#​5777](grafana/alloy#5777)) ([9491385](grafana/alloy@9491385)) ([@​ptodev](https://github.com/ptodev)) - **database\_observability.mysql:** Add filtering of query samples and wait events by minimum duration ([#​5678](grafana/alloy#5678)) ([5a4d03b](grafana/alloy@5a4d03b)) ([@​cristiangreco](https://github.com/cristiangreco), [@​clayton-cornell](https://github.com/clayton-cornell)) - **database\_observability.mysql:** Embed prometheus exporter within db-o11y component ([#​5711](grafana/alloy#5711)) ([88bffb0](grafana/alloy@88bffb0)) ([@​matthewnolf](https://github.com/matthewnolf)) - **database\_observability.postgres:** Add configurable limit to `pg_stat_statements` query ([#​5639](grafana/alloy#5639)) ([0de0a3f](grafana/alloy@0de0a3f)) ([@​cristiangreco](https://github.com/cristiangreco)) - **database\_observability.postgres:** Embed prometheus exporter within db-o11y component ([#​5714](grafana/alloy#5714)) ([9dc2e83](grafana/alloy@9dc2e83)) ([@​matthewnolf](https://github.com/matthewnolf)) - **database\_observability:** Add scaffolding for db-o11y integration tests ([#​5575](grafana/alloy#5575)) ([ca637d8](grafana/alloy@ca637d8)) ([@​matthewnolf](https://github.com/matthewnolf)) - **database\_observability:** Promote components to stable ([#​5736](grafana/alloy#5736)) ([21a9af6](grafana/alloy@21a9af6)) ([@​matthewnolf](https://github.com/matthewnolf), [@​clayton-cornell](https://github.com/clayton-cornell)) - Expose Functionality to Handle syslogs with Empty MSG Field ([#​5687](grafana/alloy#5687)) ([178b1e6](grafana/alloy@178b1e6)) ([@​blewis12](https://github.com/blewis12), [@​clayton-cornell](https://github.com/clayton-cornell), [@​x1unix](https://github.com/x1unix)) - **helm:** Allow setting `revisionHistoryLimit` in the helm chart ([#​5847](grafana/alloy#5847)) ([9713ad4](grafana/alloy@9713ad4)) ([@​hegerdes](https://github.com/hegerdes)) - **loki.process:** Support structured metadata as source type of stage.labels for loki.process ([#​5055](grafana/alloy#5055)) ([eda3152](grafana/alloy@eda3152)) ([@​baurmatt](https://github.com/baurmatt)) - **loki.secretfilter:** Add sampling for secretfilter entries ([#​5663](grafana/alloy#5663)) ([9997802](grafana/alloy@9997802)) ([@​mikefat](https://github.com/mikefat), [@​clayton-cornell](https://github.com/clayton-cornell)) - **loki.source.gcplog:** Add alloy config for MaxOutstandingBytes and MaxOutstandingMessages ([#​5760](grafana/alloy#5760)) ([c2b9f0b](grafana/alloy@c2b9f0b)) ([@​kalleep](https://github.com/kalleep)) - **loki.write:** Add loki pipeline latency metric ([#​5702](grafana/alloy#5702)) ([cc744a1](grafana/alloy@cc744a1)) ([@​kalleep](https://github.com/kalleep), [@​thampiotr](https://github.com/thampiotr)) - **mixin:** Update loki dashboard ([#​5848](grafana/alloy#5848)) ([b616d58](grafana/alloy@b616d58)) ([@​kalleep](https://github.com/kalleep)) - **otelcol.receiver.datadog:** Expose intake proxy and trace\_id\_cache\_size settings ([#​5776](grafana/alloy#5776)) ([0384ad4](grafana/alloy@0384ad4)) ([@​thampiotr](https://github.com/thampiotr)) - **otelcol:** Upgrade to OTel Collector v0.147.0 ([#​5784](grafana/alloy#5784)) ([a9b5396](grafana/alloy@a9b5396)) ([@​kalleep](https://github.com/kalleep), [@​blewis12](https://github.com/blewis12), [@​clayton-cornell](https://github.com/clayton-cornell)) - **prometheus.exporter.cloudwatch:** Use aws-sdk-go-v2 by default ([#​5768](grafana/alloy#5768)) ([a2f3489](grafana/alloy@a2f3489)) ([@​x1unix](https://github.com/x1unix)) - **pyroscope.ebpf:** Add comm, pid labels and kernel frame options ([#​5769](grafana/alloy#5769)) ([4fa7068](grafana/alloy@4fa7068)) ([@​korniltsev-grafanista](https://github.com/korniltsev-grafanista)) - **pyroscope.ebpf:** Expose OTel eBPF profiler internal metrics to Prometheus ([#​5774](grafana/alloy#5774)) ([e713392](grafana/alloy@e713392)) ([@​korniltsev-grafanista-yolo-vibecoder239](https://github.com/korniltsev-grafanista-yolo-vibecoder239), [@​korniltsev-grafanista](https://github.com/korniltsev-grafanista)) - **pyroscope:** Copy prometheus common/config HTTP client into promhttp2 package ([#​5810](grafana/alloy#5810)) ([0b31aaa](grafana/alloy@0b31aaa)) ([@​korniltsev-grafanista](https://github.com/korniltsev-grafanista)) ##### Bug Fixes 🐛 - **beyla:** Inject Beyla version into binary via ldflags ([#​5735](grafana/alloy#5735)) ([71c03ec](grafana/alloy@71c03ec)) ([@​pratik50](https://github.com/pratik50)) - Correctly handle the deprecated topic field in otelcol.receiver.kafka configuration ([#​5726](grafana/alloy#5726)) ([538ac75](grafana/alloy@538ac75)) ([@​thampiotr](https://github.com/thampiotr)) - **database\_observability.mysql:** Ensure result sets are properly closed ([#​5893](grafana/alloy#5893)) ([f28f91c](grafana/alloy@f28f91c)) ([@​cristiangreco](https://github.com/cristiangreco)) - **database\_observability:** Ensure all collectors are properly stopped ([#​5796](grafana/alloy#5796)) ([6bfa2a7](grafana/alloy@6bfa2a7)) ([@​cristiangreco](https://github.com/cristiangreco)) - **database\_observability:** Ensure that `connection_info` metric is only emitted for a given DB instance when it is available ([#​5707](grafana/alloy#5707)) ([bf0c3dc](grafana/alloy@bf0c3dc)) ([@​rgeyer](https://github.com/rgeyer)) - **database\_observability:** Solve test flakiness in MySQL and Postgres sample collectors ([#​5130](grafana/alloy#5130)) ([a7590d1](grafana/alloy@a7590d1)) ([@​gaantunes](https://github.com/gaantunes), [@​cursoragent](https://github.com/cursoragent), [@​cristiangreco](https://github.com/cristiangreco)) - **deps:** Update module github.com/buger/jsonparser to v1.1.2 \[SECURITY] ([#​5834](grafana/alloy#5834)) ([b2fee8a](grafana/alloy@b2fee8a)) - **deps:** Update module github.com/buger/jsonparser to v1.1.2 \[SECURITY] ([#​5870](grafana/alloy#5870)) ([698b4e7](grafana/alloy@698b4e7)) - **deps:** Update module google.golang.org/grpc to v1.79.3 \[SECURITY] ([#​5825](grafana/alloy#5825)) ([5cfbcc4](grafana/alloy@5cfbcc4)) - **deps:** Update module google.golang.org/grpc to v1.79.3 \[SECURITY] ([#​5871](grafana/alloy#5871)) ([259152d](grafana/alloy@259152d)) - **deps:** Update npm dependencies ([#​5876](grafana/alloy#5876)) ([f0f6a11](grafana/alloy@f0f6a11)) - **deps:** Update npm deps across repo to address CVE-2026-26996 and CVE-2026-22029 ([#​5872](grafana/alloy#5872)) ([df518dd](grafana/alloy@df518dd)) ([@​jharvey10](https://github.com/jharvey10)) - **go:** Update build image to go v1.25.8 ([#​5832](grafana/alloy#5832)) ([f9b3043](grafana/alloy@f9b3043)) ([@​kalleep](https://github.com/kalleep), [@​blewis12](https://github.com/blewis12)) - **go:** Update go to 1.25.8 ([#​5844](grafana/alloy#5844)) ([534e7db](grafana/alloy@534e7db)) ([@​kalleep](https://github.com/kalleep)) - Helm: alloy.extraPorts not working with service.type=NodePort \[COPY] ([#​5892](grafana/alloy#5892)) ([162c6f7](grafana/alloy@162c6f7)) ([@​blewis12](https://github.com/blewis12)) - **loki.enrich:** Use shared loki functions and fix locking ([#​5821](grafana/alloy#5821)) ([f916c72](grafana/alloy@f916c72)) ([@​kalleep](https://github.com/kalleep)) - **loki.process:** Multiline no longer pass empty entry if start was flushed ([#​5746](grafana/alloy#5746)) ([7bdedf1](grafana/alloy@7bdedf1)) ([@​kalleep](https://github.com/kalleep), [@​thampiotr](https://github.com/thampiotr)) - **loki.process:** Protect against json that does not look like docker json format ([#​5761](grafana/alloy#5761)) ([0af6eaa](grafana/alloy@0af6eaa)) ([@​kalleep](https://github.com/kalleep)) - **loki.secretfilter:** Fix bug where entries were being shadow dropped ([#​5786](grafana/alloy#5786)) ([90243f9](grafana/alloy@90243f9)) ([@​mikefat](https://github.com/mikefat)) - **loki.source.file:** Fix position tracking when component stops ([#​5800](grafana/alloy#5800)) ([9762946](grafana/alloy@9762946)) ([@​kalleep](https://github.com/kalleep)) - **loki.source.file:** Keep positions for compressed files when reading is finished ([#​5723](grafana/alloy#5723)) ([fb41d0a](grafana/alloy@fb41d0a)) ([@​kalleep](https://github.com/kalleep)) - **loki.source.gcplog:** Update to pubsub v2 and fix shutdown semantics ([#​5713](grafana/alloy#5713)) ([e9d9b69](grafana/alloy@e9d9b69)) ([@​kalleep](https://github.com/kalleep), [@​kgeckhart](https://github.com/kgeckhart)) - **loki.source.heroku:** Fix shutdown semantics and consume logs in batches ([#​5804](grafana/alloy#5804)) ([deda452](grafana/alloy@deda452)) ([@​kalleep](https://github.com/kalleep)) - **loki.write:** Remove noisy log ([#​5837](grafana/alloy#5837)) ([8e28f35](grafana/alloy@8e28f35)) ([@​kalleep](https://github.com/kalleep)) - **loki:** Make drain forward entries with fallback timeout ([#​5830](grafana/alloy#5830)) ([cfbca90](grafana/alloy@cfbca90)) ([@​kalleep](https://github.com/kalleep), [@​kgeckhart](https://github.com/kgeckhart)) - **prometheus.scrape:** Update arguments and targets even if `scrape_native_histograms` and `extra_metrics` are updated ([#​5787](grafana/alloy#5787)) ([dc4cb0a](grafana/alloy@dc4cb0a)) ([@​ptodev](https://github.com/ptodev)) - **pyroscope.ebpf:** Update opentelemetry-ebpf-profiler ([#​5904](grafana/alloy#5904)) ([dfaec47](grafana/alloy@dfaec47)) ([@​korniltsev-grafanista](https://github.com/korniltsev-grafanista)) - Stop components in a deterministic order ([#​5613](grafana/alloy#5613)) ([00cd371](grafana/alloy@00cd371)) ([@​kalleep](https://github.com/kalleep), [@​kgeckhart](https://github.com/kgeckhart)) ##### Chores - Use shared source structures for aws firehose ([#​5739](grafana/alloy#5739)) ([aef19dc](grafana/alloy@aef19dc)) ([@​kalleep](https://github.com/kalleep)) #### Upgrading Read the [release notes] for specific instructions on upgrading from older versions: [release notes]: https://grafana.com/docs/alloy/v1.15/release-notes/ #### Installation Refer to our [installation guide] for how to install Grafana Alloy. [installation guide]: https://grafana.com/docs/alloy/v1.15/get-started/install/ </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMDIuMTAiLCJ1cGRhdGVkSW5WZXIiOiI0My4xMDIuMTAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbIlJlbm92YXRlIEJvdCIsImF1dG9tYXRpb246Ym90LWF1dGhvcmVkIiwiZGVwZW5kZW5jeS10eXBlOjptaW5vciJdfQ==-->
Pull Request Details
Migrate
loki.enrichto use shared functions and structures for loki components, this is done to make it consistent with other component and to prepare for #4940.Also before we did not use the lock when reading stored args, this could lead to data races if a entry is processed at the same time the component is updated.
Issue(s) fixed by this Pull Request
Notes to the Reviewer
Moved Consume and Drain functions to shared loki package instead of having it in source package, we use them in non source components too.
PR Checklist