Skip to content

Conversation

@pabloem
Copy link
Contributor

@pabloem pabloem commented Jul 11, 2025

No description provided.

@pabloem pabloem marked this pull request as ready for review July 11, 2025 17:21
@pabloem
Copy link
Contributor Author

pabloem commented Jul 11, 2025

r: @dnhatn

@pabloem pabloem requested a review from dnhatn July 11, 2025 17:21
@elasticsearchmachine elasticsearchmachine added the needs:triage Requires assignment of a team area label label Jul 11, 2025
@pabloem pabloem added :StorageEngine/TSDB You know, for Metrics Team:StorageEngine >test Issues or PRs that are addressing/adding tests and removed needs:triage Requires assignment of a team area label labels Jul 11, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

case DOUBLE, COUNTER_DOUBLE -> dataRows.stream().mapToDouble(v -> (Double) v).min().orElse(0.0);
default -> throw new IllegalStateException("Unexpected value: " + fieldTypedData.type());
};
// If the minrate is greater than 0, we need to adjust the maxrate accordingly
Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting.. I would've thought that counters are INTEGER or LONG, and only COUNTER_INTEGER and COUNTER_LONG can be input to rate. Also, I haven't thought about negative values - though OTLP has the notion of up/down counters:

https://opentelemetry.io/docs/specs/otel/metrics/supplementary-guidelines/#instrument-selection

Maybe we should restrict the current rate implementation to non-negative counter values and check for that? @dnhatn for thoughts.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should restrict the current rate implementation to non-negative counter values and check for that?

I think the current rate implementation does not work correctly with up/down counters.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hm there's no check for negative values, though.. Shall we add a check and error out, if a negative counter value is detected?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hi team! how would these address changes to my PR? what should we address here?

Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need to address the issue here.

Copy link
Member

@dnhatn dnhatn left a comment

Choose a reason for hiding this comment

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

LGTM.

@pabloem pabloem merged commit 7331271 into elastic:main Jul 15, 2025
33 checks passed
@pabloem pabloem deleted the pabloem-ratetests branch July 15, 2025 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:StorageEngine/TSDB You know, for Metrics Team:StorageEngine >test Issues or PRs that are addressing/adding tests v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants