Skip to content

Create provider fo output-type frequency#23940

Merged
fpetersen-gl merged 22 commits intomasterfrom
feature/outputs_metrics
Nov 6, 2025
Merged

Create provider fo output-type frequency#23940
fpetersen-gl merged 22 commits intomasterfrom
feature/outputs_metrics

Conversation

@fpetersen-gl
Copy link
Contributor

Keep track of the output-types' frequency, in case telemetry is enabled. So we count how many outputs of each type are used by the system and report that.

Description

This PR simply calls an already existing method in the OutputService (which I made a bit more readable), converts it into a TelemetryEvent and returns that to the TelemetrySubmissionPeriodical.
Fixes Graylog2/graylog-plugin-enterprise#12203

Motivation and Context

How Has This Been Tested?

There's a test and the code also ran on a local instance, the metric does end up in posthog.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have requested a documentation update.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@fpetersen-gl fpetersen-gl requested a review from a team October 16, 2025 14:20
@fpetersen-gl fpetersen-gl marked this pull request as draft October 17, 2025 15:47
@fpetersen-gl fpetersen-gl removed the request for review from a team October 17, 2025 15:47
@fpetersen-gl fpetersen-gl marked this pull request as ready for review November 6, 2025 10:15
@fpetersen-gl fpetersen-gl requested a review from xd4rker November 6, 2025 10:15
Copy link
Contributor

@xd4rker xd4rker left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@fpetersen-gl fpetersen-gl merged commit 525ed23 into master Nov 6, 2025
23 checks passed
@fpetersen-gl fpetersen-gl deleted the feature/outputs_metrics branch November 6, 2025 15:45
garybot2 pushed a commit that referenced this pull request Dec 1, 2025
* Initial version of OutputsMetricsSupplier

* Added test

* Added license-header to test

* Added cl

* Simplify code a bit

* Filter out empty TelemetryEvents centrally to not report them. That simplifies the code in each supplier a bit.

* Add license-header

* Adjust test

* Formatting the outputs-class names

* Move method for formatting all keys of the map to the TypeFormatter to have it centrally accessible.

* Move OutputsMetricsSupplier to telemetry-package

* Add outputs package to TypeFormatter

---------

Co-authored-by: Ismail Belkacim <[email protected]>
(cherry picked from commit 525ed23)
garybot2 pushed a commit that referenced this pull request Dec 1, 2025
* Initial version of OutputsMetricsSupplier

* Added test

* Added license-header to test

* Added cl

* Simplify code a bit

* Filter out empty TelemetryEvents centrally to not report them. That simplifies the code in each supplier a bit.

* Add license-header

* Adjust test

* Formatting the outputs-class names

* Move method for formatting all keys of the map to the TypeFormatter to have it centrally accessible.

* Move OutputsMetricsSupplier to telemetry-package

* Add outputs package to TypeFormatter

---------

Co-authored-by: Ismail Belkacim <[email protected]>
(cherry picked from commit 525ed23)
garybot2 pushed a commit that referenced this pull request Dec 1, 2025
* Initial version of OutputsMetricsSupplier

* Added test

* Added license-header to test

* Added cl

* Simplify code a bit

* Filter out empty TelemetryEvents centrally to not report them. That simplifies the code in each supplier a bit.

* Add license-header

* Adjust test

* Formatting the outputs-class names

* Move method for formatting all keys of the map to the TypeFormatter to have it centrally accessible.

* Move OutputsMetricsSupplier to telemetry-package

* Add outputs package to TypeFormatter

---------

Co-authored-by: Ismail Belkacim <[email protected]>
(cherry picked from commit 525ed23)
xd4rker added a commit that referenced this pull request Dec 1, 2025
* Initial version of OutputsMetricsSupplier

* Added test

* Added license-header to test

* Added cl

* Simplify code a bit

* Filter out empty TelemetryEvents centrally to not report them. That simplifies the code in each supplier a bit.

* Add license-header

* Adjust test

* Formatting the outputs-class names

* Move method for formatting all keys of the map to the TypeFormatter to have it centrally accessible.

* Move OutputsMetricsSupplier to telemetry-package

* Add outputs package to TypeFormatter

---------


(cherry picked from commit 525ed23)

Co-authored-by: Florian Petersen <[email protected]>
Co-authored-by: Ismail Belkacim <[email protected]>
xd4rker added a commit that referenced this pull request Dec 2, 2025
* Initial version of OutputsMetricsSupplier

* Added test

* Added license-header to test

* Added cl

* Simplify code a bit

* Filter out empty TelemetryEvents centrally to not report them. That simplifies the code in each supplier a bit.

* Add license-header

* Adjust test

* Formatting the outputs-class names

* Move method for formatting all keys of the map to the TypeFormatter to have it centrally accessible.

* Move OutputsMetricsSupplier to telemetry-package

* Add outputs package to TypeFormatter

---------


(cherry picked from commit 525ed23)

Co-authored-by: Florian Petersen <[email protected]>
Co-authored-by: Ismail Belkacim <[email protected]>
xd4rker added a commit that referenced this pull request Dec 2, 2025
* Initial version of OutputsMetricsSupplier

* Added test

* Added license-header to test

* Added cl

* Simplify code a bit

* Filter out empty TelemetryEvents centrally to not report them. That simplifies the code in each supplier a bit.

* Add license-header

* Adjust test

* Formatting the outputs-class names

* Move method for formatting all keys of the map to the TypeFormatter to have it centrally accessible.

* Move OutputsMetricsSupplier to telemetry-package

* Add outputs package to TypeFormatter

---------


(cherry picked from commit 525ed23)

Co-authored-by: Florian Petersen <[email protected]>
Co-authored-by: Ismail Belkacim <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants