Skip to content

Conversation

@npepinpe
Copy link
Member

@npepinpe npepinpe commented Mar 4, 2025

Description

This PR builds the meters once when the class is created. This not only avoids unnecessary allocation when modifying them, but it also ensures we're not re-registering the gauge multiple times.

Note that this was not broken before, as we were always using the same state object 😌 But it still led to ugly warnings about it.

@npepinpe npepinpe added backport stable/8.5 OUTDATED, DON'T USE (Backport a pull request to stable/8.5) backport stable/8.6 Backport a pull request to stable/8.6 backport stable/8.7 Backport a pull request to stable/8.7 labels Mar 4, 2025
@npepinpe npepinpe self-assigned this Mar 4, 2025
@github-actions github-actions bot added the component/zeebe Related to the Zeebe component/team label Mar 4, 2025
@npepinpe
Copy link
Member Author

npepinpe commented Mar 4, 2025

Sample log warning:

11:58:35.663 [Broker-0] [Exporter-1] [zb-fs-workers-0] WARN io.micrometer.core.instrument.MeterRegistry - This Gauge has been already registered (MeterId{name='zeebe.opensearch.exporter.bulk.memory.size', tags=[tag(exporterId=OpensearchExporter),tag(partition=1)]}), the Gauge registration will be ignored. Note that subsequent logs will be logged at debug level.

@npepinpe npepinpe changed the title fix: create meters once to avoid gauge re-registration Create meters once to avoid gauge re-registration Mar 4, 2025
@berkaycanbc berkaycanbc self-requested a review March 4, 2025 11:31
@npepinpe npepinpe force-pushed the np-fix-duplicate-gauge-os-exporter branch from c6d90dc to 4ae5db3 Compare March 4, 2025 11:33
Copy link
Contributor

@berkaycanbc berkaycanbc left a comment

Choose a reason for hiding this comment

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

Nice! 🚀

LGTM 👍

@npepinpe npepinpe enabled auto-merge March 4, 2025 11:42
@npepinpe npepinpe added this pull request to the merge queue Mar 4, 2025
Merged via the queue into main with commit 60ef26c Mar 4, 2025
66 checks passed
@npepinpe npepinpe deleted the np-fix-duplicate-gauge-os-exporter branch March 4, 2025 12:09
@backport-action
Copy link
Collaborator

Successfully created backport PR for stable/8.5:

@backport-action
Copy link
Collaborator

Successfully created backport PR for stable/8.6:

@backport-action
Copy link
Collaborator

Successfully created backport PR for stable/8.7:

github-merge-queue bot pushed a commit that referenced this pull request Mar 4, 2025
…on (#29142)

# Description
Backport of #29136 to `stable/8.6`.

relates to
github-merge-queue bot pushed a commit that referenced this pull request Mar 4, 2025
…on (#29143)

# Description
Backport of #29136 to `stable/8.7`.

relates to
github-merge-queue bot pushed a commit that referenced this pull request Mar 12, 2025
…on (#29141)

# Description
Backport of #29136 to `stable/8.5`.

relates to
@github-actions github-actions bot added the version:8.5.17 Marks an issue as being completely or in parts released in 8.5.17 label Apr 2, 2025
@korthout korthout added the version:8.7.0 Marks an issue as being completely or in parts released in 8.7.0 label Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport stable/8.5 OUTDATED, DON'T USE (Backport a pull request to stable/8.5) backport stable/8.6 Backport a pull request to stable/8.6 backport stable/8.7 Backport a pull request to stable/8.7 component/zeebe Related to the Zeebe component/team version:8.5.17 Marks an issue as being completely or in parts released in 8.5.17 version:8.6.11 version:8.7.0 Marks an issue as being completely or in parts released in 8.7.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants