Skip to content

Support log attribute alert filters - #457

Open
arseniycodes wants to merge 7 commits into
mainfrom
ash/alert-log-attributes
Open

Support log attribute alert filters#457
arseniycodes wants to merge 7 commits into
mainfrom
ash/alert-log-attributes

Conversation

@arseniycodes

@arseniycodes arseniycodes commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • let log alerts filter and group by event-level log attributes
  • keep metric, trace, and resource-attribute alert behavior unchanged
  • expose separate resource and log attribute controls in the alert editor
  • make worktree URLs follow the active local proxy TLD

Why

Log queries already support event attributes, but alert evaluation only applied resource attributes. That made source-specific fields such as gcp.http_request.status unavailable to alerts even when the logs explorer could query them.

Validation

  • API test suite (619 tests)
  • worker alert suite (28 tests)
  • telemetry query filter tests
  • typechecks for database, telemetry query, API, worker, and web packages
  • production web build
  • portless stack tests
  • local runtime preview against a GCP-shaped Nginx log matched the expected event

Summary by cubic

Adds per-log attribute filtering and grouping for log alerts, with strict group-by scope validation and consistently scoped group keys across API, UI, and backend. Preserves span-scoped group keys for trace alerts, and the dev server host allowlist follows the active proxy TLD.

  • New Features

    • API: Add filter.logAttrs for logs; reject on non-log sources. Enforce scoped groupBy (log.<key> for logs, span.<key> for traces). MCP help text now includes resource/log examples. alertInputToFilter passes logAttrs through to evaluation and preview.
    • Grouping: Support groupBy on log.<key> and span.<key> only on matching sources; ignore incompatible scoped groups. Preserve span group scopes and normalize resource groupBy keys so metrics strip resource.. UI prefixes bare keys to resource.<key> and clears incompatible scoped groups on source change.
    • Backend: apps/worker counts and groups logs by per-record attributes; passes logAttrs to ClickHouse; disables rollup when logAttrs exist; preserves span grouping only for traces and avoids reinterpretation of incompatible groups. packages/telemetry-query accepts logAttrs in SeriesFilter, applies them in countSeries, and strips resource. in metric grouping. Tests cover event filters, scoped grouping, and metric resource key normalization.
    • UI: apps/web alert editor splits Resource and Log filters, shows prefixed chips, and fetches attribute keys per source; AddFilter respects source="logs" and hideFacets. Types include logAttrs in AlertFilter.
  • Dev tooling

    • Portless stack: scripts/portless-stack.sh reads and validates ~/.portless/proxy.tld, writes VITE_PORTLESS_TLD, and updates URLs. apps/web/vite.config.ts allows .${env.VITE_PORTLESS_TLD}. Tests verify TLD propagation.

Written for commit f1c941b. Summary will update on new commits.

Review in cubic

@arseniycodes

Copy link
Copy Markdown
Contributor Author

@codex review

@superlog-app superlog-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Observability review

All clear — no observability concerns found.

All signal, no noise. Ship it!

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

Copy link
Copy Markdown

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: 0b2120f3f9

ℹ️ 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".

Comment thread apps/api/src/alerts-service.ts
@arseniycodes

Copy link
Copy Markdown
Contributor Author

@codex review

@superlog-app superlog-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Observability review

All clear — no observability concerns found.

This PR understood the assignment.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/worker/src/alerts/metrics-repository.ts
Comment thread apps/api/src/alerts-service.ts

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

Copy link
Copy Markdown

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: 48a0fab2d7

ℹ️ 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".

Comment thread scripts/portless-stack.sh
@arseniycodes

Copy link
Copy Markdown
Contributor Author

@codex review

@superlog-app superlog-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Observability review

  • 1 warning

Comment thread apps/api/src/alerts-service.ts

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

Copy link
Copy Markdown

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: 80494b2c00

ℹ️ 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".

Comment thread apps/web/src/alerts/AlertEdit.tsx
@arseniycodes

Copy link
Copy Markdown
Contributor Author

@codex review

@superlog-app superlog-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Observability review

  • 1 warning

Comment thread apps/api/src/alerts-service.ts

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

Copy link
Copy Markdown

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: 7eb8fc3a33

ℹ️ 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".

Comment thread apps/web/src/alerts/AlertEdit.tsx Outdated
@arseniycodes

Copy link
Copy Markdown
Contributor Author

@codex review

@superlog-app superlog-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Observability review

All clear — no observability concerns found.

This PR understood the assignment.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 65bf11993e

ℹ️ 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".

@arseniycodes

Copy link
Copy Markdown
Contributor Author

@codex review

# Conflicts:
#	scripts/portless-stack.sh
#	scripts/portless-stack.test.sh
@arseniycodes

Copy link
Copy Markdown
Contributor Author

@codex review

@superlog-app superlog-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Observability review

All clear — no observability concerns found.

Send us some more PRs. We really like them!

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

Copy link
Copy Markdown

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: b364449956

ℹ️ 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".

Comment thread apps/web/src/alerts/AlertEdit.tsx
@arseniycodes

Copy link
Copy Markdown
Contributor Author

@codex review

@superlog-app superlog-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Observability review

  • 1 warning

Comment thread packages/telemetry-query/src/index.ts
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: f1c941b539

ℹ️ 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".

@arseniycodes

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: f1c941b539

ℹ️ 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".

@arseniycodes

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: f1c941b539

ℹ️ 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".

@arseniycodes

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: f1c941b539

ℹ️ 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".

@arseniycodes

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: f1c941b539

ℹ️ 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".

@arseniycodes

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: f1c941b539

ℹ️ 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".

@arseniycodes

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: f1c941b539

ℹ️ 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".

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