Skip to content

fix(engine): parse metrics intervals as decimal - #4047

Merged
poiana merged 1 commit into
falcosecurity:masterfrom
pedramsafaei:fix/prometheus-interval-decimal
Nov 2, 2026
Merged

poiana merged 1 commit into
falcosecurity:masterfrom
pedramsafaei:fix/prometheus-interval-decimal

Conversation

@pedramsafaei

@pedramsafaei pedramsafaei commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

/kind bug
/area engine
/area tests

What changed

Prometheus duration components are now parsed as decimal values. Leading zeros no longer change the configured metrics interval.

Why

The parser accepts decimal digits but used automatic base detection. A leading zero could therefore make a duration parse as octal.

Before and after

010s was read as 8 seconds. It is now read as 10 seconds.

1h08m was read as 1 hour. It is now read as 1 hour 8 minutes.

Testing

Added regression coverage for zero padded milliseconds, seconds, minutes, and combined durations. All 266 Falco unit tests pass.

Limits

Very large duration components can still exceed uint64. This change does not alter existing overflow handling.

Release note

Parse metrics interval components as decimal values

@poiana

poiana commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Welcome @pedramsafaei! It looks like this is your first PR to falcosecurity/falco 🎉

@poiana poiana added the size/XS label Oct 25, 2026
@github-actions

Copy link
Copy Markdown

This PR may bring feature or behavior changes in the Falco engine and may require the engine version to be bumped.

Please double check userspace/engine/falco_engine_version.h file. See versioning for FALCO_ENGINE_VERSION.

/hold

@pedramsafaei
pedramsafaei marked this pull request as ready for review October 26, 2026 00:11
Signed-off-by: Pedram Safaei <34566793+pedramsafaei@users.noreply.github.com>
@pedramsafaei
pedramsafaei force-pushed the fix/prometheus-interval-decimal branch from 11090cb to 2125db0 Compare October 30, 2026 16:15
@pedramsafaei

Copy link
Copy Markdown
Contributor Author

hey @leogr @sgaist could one of you take a look when you get a chance. it's a small fix so leading zeros in the metrics interval like 010s or 1h08m get read as decimal instead of octal. it doesn't change rules syntax or fields so i don't think it needs an engine version bump and the hold can probably be cancelled. thanks

@sgaist sgaist 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.

LGTM but I would like a second opinion around the need for the engine version bump.

@leogr leogr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks! No engine version bump is needed: this only corrects metrics.interval parsing, without changing rule syntax/loading or the engine checksum inputs.

@github-project-automation github-project-automation Bot moved this from Todo to In progress in Falco Roadmap Nov 2, 2026
@poiana poiana added the lgtm label Nov 2, 2026
@poiana

poiana commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: 4c790765629242638097e265d0a7bdf226c8a322

@poiana

poiana commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: leogr, pedramsafaei

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana poiana added the approved label Nov 2, 2026
@leogr

leogr commented Nov 2, 2026

Copy link
Copy Markdown
Member

/hold cancel

@poiana
poiana merged commit b3c37fe into falcosecurity:master Nov 2, 2026
38 checks passed
@github-project-automation github-project-automation Bot moved this from In progress to Done in Falco Roadmap Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants