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

Fix: Use topology name for message and exception tags #134

Merged
merged 1 commit into from
Apr 11, 2022
Merged

Fix: Use topology name for message and exception tags #134

merged 1 commit into from
Apr 11, 2022

Conversation

tmartin8080
Copy link
Collaborator

@tmartin8080 tmartin8080 commented Apr 10, 2022

What problem does this solve?

While using BroadwayRabbitMQ.Producerfor Broadway, we were not able to override the message acknowledger according to the docs as there is a unique :delivery_tag required to ack messages to RMQ. When we tried, this was empty and our messages were not being acked.

Second, the metrics were not showing up for the RabbitMQ backed pipeline, but they were for a pipeline using a normal GenStage producer and after some digging around, I noticed that the :name tag/label on the /metrics were different:

GenStage Producer Metric

broadway_process_message_duration_milliseconds_count{batcher="local",name="Prom.Pipelines.LocalPipeline"}

RabbitMQ Producer Metric

broadway_process_message_duration_milliseconds_count{batcher="rabbit",name="BroadwayRabbitMQ.Producer"}

Changes

After switching the tag_values function to use :topology_name, the metrics for both Pipelines started to show up accurately in Grafana.

Curious if there was a reason to use the message acknowledger for the name tags? BroadwayRabbitMQ emits different events for acking/ rejecting.

I'd be happy to add those in a separate PR. Wanted to keep this one short.

Issue number: N/A

Example usage

  • I created an app with two pipelines, one with a GenStage Producer and one with a RabbitMQ Producer both with a 10% error rates.
  • After making these changes, the metrics started to show up accurately in the Grafana dashboard, including exception rates and batch failures.

Additional details and screenshots

GenStage Pipeline

genstage-pipeline

RabbitMQ Pipeline

rabbit-pipeline

Checklist

  • I have added unit tests to cover my changes.
  • I have added documentation to cover my changes.
  • My changes have passed unit tests and have been tested E2E in an example project.

@coveralls
Copy link

coveralls commented Apr 10, 2022

Coverage Status

Coverage increased (+1.5%) to 80.928% when pulling 2bf9e93 on tmartin8080:feature/rabbitmq-support into ad2c47e on akoutmos:master.

Copy link
Owner

@akoutmos akoutmos left a comment

Choose a reason for hiding this comment

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

Great work! Thanks for the contribution :)

@akoutmos akoutmos merged commit d769563 into akoutmos:master Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants