Skip to content

Fix timestamp units in WAF telemetry metrics#5125

Merged
smola merged 1 commit into
masterfrom
smola/fix-telemetry-waf-timestamp-units
Apr 26, 2023
Merged

Fix timestamp units in WAF telemetry metrics#5125
smola merged 1 commit into
masterfrom
smola/fix-telemetry-waf-timestamp-units

Conversation

@smola

@smola smola commented Apr 26, 2023

Copy link
Copy Markdown
Member

What Does This Do

Convert timestamps in WAF telemetry metric points from milliseconds to seconds.

Motivation

Timestamps for telemetry metrics are defined in seconds (as a double). We can just encode it as an integer, since the sub-second resolution seems to be pointless here.

Additional Notes

@smola smola added the comp: asm waf Application Security Management (WAF) label Apr 26, 2023
@smola
smola requested a review from a team as a code owner April 26, 2023 14:40
public WafMetric(String metricName, long counter, final String... tags) {
this.metricName = metricName;
this.timestamp = System.currentTimeMillis();
this.timestamp = System.currentTimeMillis() / 1000;

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.

Same thing happened to me while building IAST metrics 🤦

@smola
smola merged commit 6ca8230 into master Apr 26, 2023
@smola
smola deleted the smola/fix-telemetry-waf-timestamp-units branch April 26, 2023 15:21
@github-actions github-actions Bot added this to the 1.13.0 milestone Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: asm waf Application Security Management (WAF)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants