Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rabbit_feature_flags: Improve logging #12444

Merged
merged 3 commits into from
Oct 4, 2024

Conversation

dumbbell
Copy link
Member

@dumbbell dumbbell commented Oct 3, 2024

Here are the changes to the logging in the Feature flags subsystem:

  • Showing that required feature flags are enabled over and over is not useful and only adds noise to the logs. Required feature flags and removed deprecated features are not lists explicitly anymore. We just log their respective numbers to still be clear that they exist.

    Before:

    list of feature flags found:
      [x] classic_mirrored_queue_version
      [x] classic_queue_type_delivery_support
      [x] direct_exchange_routing_v2
      [x] feature_flags_v2
      [x] implicit_default_bindings
      [ ] khepri_db
      [x] message_containers_deaths_v2
      [x] quorum_queue_non_voters
      [~] rabbit_exchange_type_local_random
      [x] rabbitmq_4.0.0
      ...
    list of deprecated features found:
      [ ] amqp_address_v1
      [x] classic_queue_mirroring
      [ ] global_qos
      [ ] queue_master_locator
      [ ] ram_node_type
      [ ] transient_nonexcl_queues
    

    After:

    list of feature flags found:
      [ ] khepri_db
      [x] message_containers_deaths_v2
      [x] quorum_queue_non_voters
      [~] rabbit_exchange_type_local_random
      [x] rabbitmq_4.0.0
    list of deprecated features found:
      [ ] amqp_address_v1
      [ ] global_qos
      [ ] queue_master_locator
      [ ] ram_node_type
      [ ] transient_nonexcl_queues
    required feature flags not listed above: 18
    removed deprecated features not listed above: 1
    
  • The inventory map is huge and difficult to read when it is logged as is. Logging a matrix is much more compact and to the point.

    Before:

    inventory of node `rabbit-1@giotto`:
    #{feature_flags =>
          #{rabbit_exchange_type_local_random =>
                #{name => rabbit_exchange_type_local_random,
                  desc => "Local random exchange",stability => stable,
                  provided_by => rabbit},
            message_containers_deaths_v2 =>
                #{name => message_containers_deaths_v2,
                  desc => "Bug fix for dead letter cycle detection",
    ...
    

    After:

    inventory queried from node `rabbit-1@giotto`:
                                           ,-- rabbit-1@giotto
                                           |  ,-- rabbit-2@giotto
                                           |  |
                         amqp_address_v1:
          classic_mirrored_queue_version:  x  x
                 classic_queue_mirroring:  x  x
     classic_queue_type_delivery_support:  x  x
    ...
    

…nit logged list

[Why]
Showing that required feature flags are enabled over and over is not
useful and only adds noise to the logs.

[How]
Required feature flags and removed deprecated features are not lists
explicitly. We just log their respective numbers to still be clear that
they exist.

Before:
    list of feature flags found:
      [x] classic_mirrored_queue_version
      [x] classic_queue_type_delivery_support
      [x] direct_exchange_routing_v2
      [x] feature_flags_v2
      [x] implicit_default_bindings
      [ ] khepri_db
      [x] message_containers_deaths_v2
      [x] quorum_queue_non_voters
      [~] rabbit_exchange_type_local_random
      [x] rabbitmq_4.0.0
      ...
    list of deprecated features found:
      [ ] amqp_address_v1
      [x] classic_queue_mirroring
      [ ] global_qos
      [ ] queue_master_locator
      [ ] ram_node_type
      [ ] transient_nonexcl_queues

After:
    list of feature flags found:
      [ ] khepri_db
      [x] message_containers_deaths_v2
      [x] quorum_queue_non_voters
      [~] rabbit_exchange_type_local_random
      [x] rabbitmq_4.0.0
    list of deprecated features found:
      [ ] amqp_address_v1
      [ ] global_qos
      [ ] queue_master_locator
      [ ] ram_node_type
      [ ] transient_nonexcl_queues
    required feature flags not listed above: 18
    removed deprecated features not listed above: 1
[Why]
The inventory map is huge and difficult to read when it is logged as
is.

[How]
Logging a matrix is much more compact and to the point.

Before:
    Feature flags: inventory of node `rabbit-1@giotto`:
    #{feature_flags =>
          #{rabbit_exchange_type_local_random =>
                #{name => rabbit_exchange_type_local_random,
                  desc => "Local random exchange",stability => stable,
                  provided_by => rabbit},
            message_containers_deaths_v2 =>
                #{name => message_containers_deaths_v2,
                  desc => "Bug fix for dead letter cycle detection",
    ...

After:
    Feature flags: inventory queried from node `rabbit-2@giotto`:
                                           ,-- rabbit-2@giotto
                                           |
                         amqp_address_v1:
          classic_mirrored_queue_version:  x
                 classic_queue_mirroring:  x
     classic_queue_type_delivery_support:  x
    ...
@dumbbell dumbbell added this to the 4.1.0 milestone Oct 3, 2024
@dumbbell dumbbell self-assigned this Oct 3, 2024
@dumbbell dumbbell changed the title Improve the Feature flags subsystem logging rabbit_feature_flags: Improve logging Oct 3, 2024
@dumbbell dumbbell marked this pull request as ready for review October 4, 2024 08:55
@dumbbell dumbbell merged commit 9645c81 into main Oct 4, 2024
450 checks passed
@dumbbell dumbbell deleted the improve-feature-flags-subsystem-logging branch October 4, 2024 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

1 participant