Skip to content

feat(traffic-graph): add trafficType prop to TrafficGraphWithDaySelect#25235

Merged
laura-b-g merged 7 commits intoinputLicensefrom
feat/13243/traffic-graphs
Mar 31, 2026
Merged

feat(traffic-graph): add trafficType prop to TrafficGraphWithDaySelect#25235
laura-b-g merged 7 commits intoinputLicensefrom
feat/13243/traffic-graphs

Conversation

@laura-b-g
Copy link
Copy Markdown
Contributor

@laura-b-g laura-b-g commented Mar 5, 2026

Description

closes https://github.com/Graylog2/graylog-plugin-enterprise/issues/13243
/nocl
/jpd Graylog2/graylog-plugin-enterprise#13438

Add a trafficType prop ('input' | 'output') to TrafficGraphWithDaySelect so callers can control which traffic direction is displayed. The component derives its title and telemetry section from this prop, defaulting to 'output' for backward compatibility.

The cluster overview graph is switched to show input traffic. Enterprise plugin type definitions are updated to match component renames in the companion PR.

Motivation and Context

The traffic graph previously hardcoded output traffic. Different license types measure usage against different directions, so the component needs to be configurable. The companion enterprise PR (/jpd) uses this to show the correct graph per license type.

How can this be tested?

  • Setup: Both this PR and the /jpd enterprise PR must be applied together
  • Happy path: Cluster overview shows "Incoming traffic"; day selector fires correct telemetry section
  • Edge cases: Empty traffic data, custom title override, traffic limit line
  • Unit tests: TrafficGraphWithDaySelect.test.tsx expanded to cover both traffic types; GraylogClusterOverview.test.tsx updated

Screenshots (if appropriate):

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.

@laura-b-g laura-b-g requested review from a team and dennisoelkers as code owners March 5, 2026 14:21
@laura-b-g laura-b-g changed the base branch from master to inputLicense March 5, 2026 14:22
@bernd bernd removed the request for review from a team March 5, 2026 14:28
@laura-b-g laura-b-g changed the title Feat/13243/traffic graphs feat(traffic-graph): add trafficType prop to TrafficGraphWithDaySelect Mar 5, 2026
Update the License plugin type definition to use new component names:
- EnterpriseTrafficGraph → TrafficGraph
- LicenseGraphWithMetrics → TrafficGraphWithLicenseMetrics

Update GraylogClusterOverview.tsx to reference the new plugin export names.

These changes mirror the enterprise plugin refactoring that renames the
components to better reflect their responsibility and unifies draw-down
behavior across all pages.

Validation: GraylogClusterOverview tests passing, no type errors.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@laura-b-g laura-b-g removed the request for review from dennisoelkers March 6, 2026 09:28
@laura-b-g laura-b-g requested a review from a team March 10, 2026 15:03
Copy link
Copy Markdown
Contributor

@gally47 gally47 left a comment

Choose a reason for hiding this comment

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

LGTM.

@laura-b-g laura-b-g merged commit 15f204b into inputLicense Mar 31, 2026
12 of 21 checks passed
@laura-b-g laura-b-g deleted the feat/13243/traffic-graphs branch March 31, 2026 15:05
AntonEbel added a commit that referenced this pull request Apr 8, 2026
* add index mapping for gl2_input_message_size field
* add inputMessageSize field to JournalMessages
* feat(traffic-graph): add trafficType prop to TrafficGraphWithDaySelect (#25235)
* Add input-indexed traffic counter for license accounting (#25501)

---------

Co-authored-by: Laura Bergenthal-Grotlüschen <197286649+laura-b-g@users.noreply.github.com>
Co-authored-by: Florian Petersen <188503754+fpetersen-gl@users.noreply.github.com>
Co-authored-by: Maxwell Anipah <maxwell.anipah@graylog.com>
Co-authored-by: Anton Ebel <anton.ebel@graylog.com>
Co-authored-by: Ismail Belkacim <ismail.belkacim@graylog.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