Skip to content

feat(canary): Support passing arbitrary set of labels to use for the query #17008

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

iNoahNothing
Copy link

What this PR does / why we need it:
Loki Canary logs are collected and parsed by logging agents whose configuration is controlled by users. Since Loki does not parse logs directly, the set of labels for each log line is up to users and extremely variable.

The current approach only allows for two labels to be used for the query sent to Loki which can impact the canary's ability to find the logs it is looking for. By adding a -labels flag, we are able to pass an arbitrary set of labels to be used in the query. Combined with -query-append, you can craft a full LogQL query to correctly and efficiently return the logs it is looking for.

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • Title matches the required conventional commits format, see here
    • Note that Promtail is considered to be feature complete, and future development for logs collection will be in Grafana Alloy. As such, feat PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR
Signed-off-by: Noah Krause <krausenoah@gmail.com>
@iNoahNothing iNoahNothing requested a review from a team as a code owner April 2, 2025 20:54
@CLAassistant
Copy link

CLAassistant commented Apr 2, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories label Apr 2, 2025
Signed-off-by: Noah Krause <krausenoah@gmail.com>
@iNoahNothing
Copy link
Author

@MasslessParticle Sorry for the ping but you seem to be the last person whose looked at the canary stuff #14287

Is there anything I can do to get this over the line?

@iNoahNothing
Copy link
Author

@paul1r Sorry for the ping. Any chance we can get eyes on this or should I expect to need to fork the project to make this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/S type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories
2 participants