Skip to content

Register metrics where possible.#544

Merged
blt merged 1 commit into
mainfrom
register_metrics
Apr 13, 2023
Merged

Register metrics where possible.#544
blt merged 1 commit into
mainfrom
register_metrics

Conversation

@blt

@blt blt commented Apr 13, 2023

Copy link
Copy Markdown
Collaborator

What does this PR do?

This is an extraction from #539. The use of the metrics-rs macros are cheap but not free and we have been using them in hot loops. This commit pre-registers metrics with their labels before use, reducing that cost.

Related issues

REF SMP-463

This is an extraction from #539. The use of the metrics-rs macros are cheap but
not free and we have been using them in hot loops. This commit pre-registers
metrics with their labels before use, reducing that cost.

REF SMP-463

Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
@blt blt requested a review from a team April 13, 2023 14:37
@blt blt merged commit f30a2fe into main Apr 13, 2023
@blt blt deleted the register_metrics branch April 13, 2023 15:09
blt added a commit that referenced this pull request Apr 14, 2023
This commit pre-registers metrics in our blackholes, a peer to #544. I have made
use of OnceCell in situations where a registered metrics needs to cross task
boundaries. Fortunately in our blackholes we do not use labels in our metrics so
this was a fairly total conversion.

Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
blt added a commit that referenced this pull request Apr 17, 2023
This commit pre-registers metrics in our blackholes, a peer to #544. I have made
use of OnceCell in situations where a registered metrics needs to cross task
boundaries. Fortunately in our blackholes we do not use labels in our metrics so
this was a fairly total conversion.

Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
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.

2 participants