Skip to content

chore: Add loki processing integration test#5957

Open
kalleep wants to merge 13 commits intomainfrom
kalleep/loki-process-integration-test
Open

chore: Add loki processing integration test#5957
kalleep wants to merge 13 commits intomainfrom
kalleep/loki-process-integration-test

Conversation

@kalleep
Copy link
Copy Markdown
Contributor

@kalleep kalleep commented Mar 31, 2026

Pull Request Details

Add a new integration test for loki-process that tests several loki.process stages against different inputs.

I tried to mix different kind of parser and stages and draw inspiration from what we have in our docs. Also all the test fixtures are written when test run so that timestamps are not stale and get to old to be ingested into loki.

Issue(s) fixed by this Pull Request

Part of: #4953

Notes to the Reviewer

I added the ability to verify structured metedata. For this to work we have to pass a special header to loki:
X-Loki-Response-Encoding-Flags: categorize-labels. This will change the response so I had to update the json parsing logic for it.

PR Checklist

  • Documentation added
  • Tests updated
  • Config converters updated

@kalleep kalleep marked this pull request as ready for review April 1, 2026 10:18
@kalleep kalleep requested a review from a team as a code owner April 1, 2026 10:18
@kalleep
Copy link
Copy Markdown
Contributor Author

kalleep commented Apr 1, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7383868504

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

common.ExpectedLogResult{
Labels: map[string]string{
"detected_level": "info",
"filename": "/etc/alloy/logs.txt",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can no longer check detected_level as a labels because we now tell loki to categorize our labels, meaning detected_level is not treated as label but a parsed value.

Parsed seems to be similar to structured_metadata but is "metadata" that loki can derive from requests.

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