Skip to content

Conversation

@matanl-starkware
Copy link
Collaborator

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Collaborator Author

matanl-starkware commented Oct 30, 2025

@matanl-starkware matanl-starkware force-pushed the 10-30-apollo_dashboard_add_new_module_queries_builder branch from 4ce48ed to ccbac5a Compare October 30, 2025 10:56
@matanl-starkware matanl-starkware force-pushed the 10-29-apollo_dashboard_create_metriccommon_trait branch from e4e8ade to 5897c62 Compare October 30, 2025 10:56
@matanl-starkware matanl-starkware force-pushed the 10-30-apollo_dashboard_add_new_module_queries_builder branch from ccbac5a to df4d8bb Compare October 30, 2025 11:07
@matanl-starkware matanl-starkware force-pushed the 10-29-apollo_dashboard_create_metriccommon_trait branch from 5897c62 to 2bdb8f9 Compare October 30, 2025 11:07
@matanl-starkware matanl-starkware marked this pull request as ready for review October 30, 2025 11:09
Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion


crates/apollo_dashboard/src/lib.rs line 9 at r1 (raw file):

mod metric_definitions_test;
mod panels;
mod queries_builder;

Please annotate this with #[cfg(test)], and remove the inner-file annotations
(it seems like the entire module is just for testing)

Code quote:

mod queries_builder;

Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 2 files reviewed, 2 unresolved discussions (waiting on @matanl-starkware)


crates/apollo_dashboard/src/queries_builder.rs line 3 at r1 (raw file):

pub(crate) mod queries {
    #[cfg(test)]
    use apollo_metrics::metrics::MetricCommon;

Move to the top

Code quote:

use apollo_metrics::metrics::MetricCommon;

Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 2 files reviewed, 3 unresolved discussions (waiting on @matanl-starkware)


crates/apollo_dashboard/src/queries_builder.rs line 13 at r1 (raw file):

#[cfg(test)]
mod tests {
    use apollo_metrics::metrics::{MetricGauge, MetricScope};

Move to the top

Code quote:

use apollo_metrics::metrics::{MetricGauge, MetricScope};

Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 2 files reviewed, 4 unresolved discussions (waiting on @matanl-starkware)


crates/apollo_dashboard/src/queries_builder.rs line 1 at r1 (raw file):

pub(crate) mod queries {

Remove this, and instead define fn increase as a fn of this module; no need for pub(crate) as well.

Code quote:

pub(crate) mod queries {

Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 2 files reviewed, 5 unresolved discussions (waiting on @matanl-starkware)


crates/apollo_dashboard/src/queries_builder.rs line 22 at r1 (raw file):

        let q = queries::increase(&m, "5m");
        assert_eq!(q, r#"increase(testing{cluster=~"$cluster", namespace=~"$namespace"}[5m])"#);
    }

Move outside of mod teststo the top hierachy of the queries_build module , and then delete mod tests

Code quote:

    #[test]
    fn increase_formats_correctly() {
        let m = MetricGauge::new(MetricScope::Batcher, "testing", "Fake description");
        let q = queries::increase(&m, "5m");
        assert_eq!(q, r#"increase(testing{cluster=~"$cluster", namespace=~"$namespace"}[5m])"#);
    }

Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion


crates/apollo_dashboard/src/lib.rs line 9 at r1 (raw file):

mod metric_definitions_test;
mod panels;
mod queries_builder;

Saw pr #9866 so retracted all previous comments.

Please:

  1. rename queries_builder to query_builder
  2. create a query_builder_tests module
  3. add query_builder_tests to query_builder with the cfg-test annotation

Code quote:

mod queries_builder;

Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 2 files reviewed, 2 unresolved discussions (waiting on @matanl-starkware)


crates/apollo_dashboard/src/queries_builder.rs line 21 at r1 (raw file):

        let m = MetricGauge::new(MetricScope::Batcher, "testing", "Fake description");
        let q = queries::increase(&m, "5m");
        assert_eq!(q, r#"increase(testing{cluster=~"$cluster", namespace=~"$namespace"}[5m])"#);

We have this defined as a macro, please check metric_label_filter

  1. I'll note that afaiu it doesn't have to be a macro anymore, and can be changed to a normal const instead
  2. We also have a util struct called Template that can be relevant here as well

Code quote:

{cluster=~"$cluster", namespace=~"$namespace"}

@matanl-starkware matanl-starkware force-pushed the 10-29-apollo_dashboard_create_metriccommon_trait branch from 2bdb8f9 to ca12bc4 Compare October 30, 2025 13:14
@matanl-starkware matanl-starkware force-pushed the 10-30-apollo_dashboard_add_new_module_queries_builder branch from df4d8bb to 8b9c102 Compare October 30, 2025 13:14
@matanl-starkware matanl-starkware force-pushed the 10-29-apollo_dashboard_create_metriccommon_trait branch from ca12bc4 to 036a316 Compare October 30, 2025 13:34
@matanl-starkware matanl-starkware force-pushed the 10-30-apollo_dashboard_add_new_module_queries_builder branch 2 times, most recently from 9fe4534 to fb9f2d9 Compare October 30, 2025 15:48
@matanl-starkware matanl-starkware force-pushed the 10-29-apollo_dashboard_create_metriccommon_trait branch from 036a316 to 622dbe7 Compare October 30, 2025 15:48
Copy link
Collaborator Author

@matanl-starkware matanl-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 4 files reviewed, 2 unresolved discussions (waiting on @Itay-Tsabary-Starkware)


crates/apollo_dashboard/src/lib.rs line 9 at r1 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

Saw pr #9866 so retracted all previous comments.

Please:

  1. rename queries_builder to query_builder
  2. create a query_builder_tests module
  3. add query_builder_tests to query_builder with the cfg-test annotation

Done.


crates/apollo_dashboard/src/queries_builder.rs line 1 at r1 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

Remove this, and instead define fn increase as a fn of this module; no need for pub(crate) as well.

Without pub(crate), it becomes private, and unittest can't use it.


crates/apollo_dashboard/src/queries_builder.rs line 21 at r1 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

We have this defined as a macro, please check metric_label_filter

  1. I'll note that afaiu it doesn't have to be a macro anymore, and can be changed to a normal const instead
  2. We also have a util struct called Template that can be relevant here as well

Done.

@matanl-starkware matanl-starkware force-pushed the 10-30-apollo_dashboard_add_new_module_queries_builder branch from fb9f2d9 to 97f9e5f Compare October 30, 2025 17:49
@matanl-starkware matanl-starkware force-pushed the 10-29-apollo_dashboard_create_metriccommon_trait branch from 622dbe7 to 8904928 Compare October 30, 2025 17:49
@matanl-starkware matanl-starkware force-pushed the 10-30-apollo_dashboard_add_new_module_queries_builder branch from 97f9e5f to 0e2f8bb Compare October 30, 2025 18:03
Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

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

:lgtm:

@Itay-Tsabary-Starkware reviewed 3 of 4 files at r2, all commit messages.
Reviewable status: 3 of 4 files reviewed, all discussions resolved


crates/apollo_dashboard/src/query_builder.rs line 1 at r2 (raw file):

use apollo_metrics::metrics::MetricCommon;

Please add a new line after the use section (non-blocking)

Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 3 of 4 files reviewed, all discussions resolved


crates/apollo_dashboard/src/lib.rs line 11 at r2 (raw file):

// TODO(MatanL): Remove cfg(test) when used
#[cfg(test)]

Not requried afaiu

Code quote:

// TODO(MatanL): Remove cfg(test) when used
#[cfg(test)]

Copy link
Collaborator Author

@matanl-starkware matanl-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 3 of 4 files reviewed, all discussions resolved (waiting on @Itay-Tsabary-Starkware)


crates/apollo_dashboard/src/lib.rs line 11 at r2 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

Not requried afaiu

It is required (increase not used in this PR, unless under test)

@matanl-starkware matanl-starkware force-pushed the 10-30-apollo_dashboard_add_new_module_queries_builder branch from 0e2f8bb to 88ee7de Compare November 2, 2025 11:03
@matanl-starkware matanl-starkware force-pushed the 10-29-apollo_dashboard_create_metriccommon_trait branch from 8904928 to 4215e84 Compare November 2, 2025 11:03
@graphite-app graphite-app bot changed the base branch from 10-29-apollo_dashboard_create_metriccommon_trait to graphite-base/9863 November 2, 2025 11:03
Copy link
Collaborator Author

@matanl-starkware matanl-starkware left a comment

Choose a reason for hiding this comment

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

@matanl-starkware reviewed 3 of 4 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @matanl-starkware)

@matanl-starkware matanl-starkware force-pushed the 10-30-apollo_dashboard_add_new_module_queries_builder branch from 88ee7de to bf0a52b Compare November 2, 2025 11:29
@graphite-app graphite-app bot changed the base branch from graphite-base/9863 to main-v0.14.1 November 2, 2025 11:30
@graphite-app
Copy link

graphite-app bot commented Nov 2, 2025

Merge activity

  • Nov 2, 11:30 AM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.

@matanl-starkware matanl-starkware force-pushed the 10-30-apollo_dashboard_add_new_module_queries_builder branch from bf0a52b to 6565a7d Compare November 2, 2025 11:38
Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

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

:lgtm:

@Itay-Tsabary-Starkware reviewed 1 of 4 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @matanl-starkware)

@matanl-starkware matanl-starkware added this pull request to the merge queue Nov 2, 2025
Merged via the queue into main-v0.14.1 with commit 79d4081 Nov 2, 2025
14 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants