Skip to content

Conversation

@ptodev
Copy link
Contributor

@ptodev ptodev commented Jan 29, 2026

Pull Request Details

It's possible to send loki.source.file the same file target multiple times. This PR adds logs and a metric to help us identify whether this has happened. It is currently very hard to debug this - you'd have to open the Alloy UI and check the targets passed to loki.source.file to see if any file paths have been listed multiple times with differing non-internal labels (labels which don't start with __).

A common way to encounter this problem is if you pair loki.source.file with discovery.kubernetes and then make a label with a pod port number prior to loki.source.file. If the pod has multiple ports, you'd end up tailing the file twice.

Issue(s) fixed by this Pull Request

Related to this comment.

PR Checklist

  • Documentation added
  • Tests updated
  • Config converters updated

@ptodev ptodev requested review from a team and clayton-cornell as code owners January 29, 2026 18:35
@github-actions
Copy link
Contributor

github-actions bot commented Jan 29, 2026

💻 Deploy preview available (feat(loki.source.file): Track duplicate targets with a metric and logs):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant