Skip to content
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/api-v4": Upcoming Features
---

Update types for network load balancer integration with `CloudPulse Metrics` ([#13387](https://github.com/linode/manager/pull/13387))
2 changes: 2 additions & 0 deletions packages/api-v4/src/cloudpulse/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export type CloudPulseServiceType =
| 'firewall'
| 'linode'
| 'lke'
| 'netloadbalancer'
| 'nodebalancer'
| 'objectstorage';
export type AlertClass = 'dedicated' | 'shared';
Expand Down Expand Up @@ -428,6 +429,7 @@ export const capabilityServiceTypeMapping: Record<
objectstorage: 'Object Storage',
blockstorage: 'Block Storage',
lke: 'Kubernetes',
netloadbalancer: 'Network LoadBalancer',
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In CM Navigation, i see this as "Network Load Balancer", Can we cross check and see if this is consistent with other services

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is capability coming as part of regions api and it is
Network LoadBalancer

};

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Upcoming Features
---

Integrate Network Load Balancer service in `CloudPulse metrics` ([#13387](https://github.com/linode/manager/pull/13387))
79 changes: 79 additions & 0 deletions packages/manager/src/factories/cloudpulse/alerts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -652,3 +652,82 @@ export const firewallNodebalancerMetricCriteria =
},
],
});

const networkLoadBalancerDimensions: Dimension[] = [
{
label: 'Port',
dimension_label: 'port',
values: [],
},
{
label: 'Protocol',
dimension_label: 'protocol',
values: ['tcp', 'udp'],
},
{
label: 'IP Version',
dimension_label: 'ip_version',
values: ['v6', 'v4'],
},
{
label: 'VIP',
dimension_label: 'ip',
values: [],
},
];
export const networkLoadBalancerMetricCriteria: MetricDefinition[] = [
{
label: 'Ingress Traffic Rate',
metric: 'nlb_ingress_traffic',
unit: 'Bps',
metric_type: 'gauge',
scrape_interval: '60s',
is_alertable: true,
available_aggregate_functions: ['sum'],
dimensions: networkLoadBalancerDimensions,
},
{
label: 'Ingress Packets Rate',
metric: 'nlb_ingress_packets',
unit: 'packets/s',
metric_type: 'gauge',
scrape_interval: '60s',
is_alertable: true,
available_aggregate_functions: ['sum'],
dimensions: networkLoadBalancerDimensions,
},
{
label: 'Ingress Traffic Rate Per backend',
metric: 'nlb_backend_ingress_traffic',
unit: 'Bps',
metric_type: 'gauge',
scrape_interval: '60s',
is_alertable: true,
available_aggregate_functions: ['sum'],
dimensions: [
...networkLoadBalancerDimensions,
{
label: 'Node ID',
dimension_label: 'node_id',
values: [],
},
],
},
{
label: 'Ingress Packets Rate Per backend',
metric: 'nlb_backend_ingress_packets',
unit: 'packets/s',
metric_type: 'gauge',
scrape_interval: '60s',
is_alertable: true,
available_aggregate_functions: ['sum'],
dimensions: [
...networkLoadBalancerDimensions,
{
label: 'Node ID',
dimension_label: 'node_id',
values: [],
},
],
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ import {
CONFIGS_HELPER_TEXT,
CONFIGS_ID_PLACEHOLDER_TEXT,
INTERFACE_ID_HELPER_TEXT,
NODE_ID_HELPER_TEXT,
NODE_ID_PLACEHOLDER_TEXT,
PORT_HELPER_TEXT,
PORT_PLACEHOLDER_TEXT,
PORTS_PLACEHOLDER_TEXT,
VIP_HELPER_TEXT,
VIP_PLACEHOLDER_TEXT,
} from '../../../constants';

import type { Item } from '../../../constants';
Expand Down Expand Up @@ -157,6 +161,52 @@ export const valueFieldConfig: ValueFieldConfigMap = {
inputType: 'number',
},
},
ip: {
eq_neq: {
type: 'textfield',
inputType: 'text',
placeholder: VIP_PLACEHOLDER_TEXT,
},
startswith_endswith: {
type: 'textfield',
inputType: 'text',
placeholder: VIP_PLACEHOLDER_TEXT,
},
in: {
type: 'textfield',
inputType: 'text',
placeholder: VIP_PLACEHOLDER_TEXT,
helperText: VIP_HELPER_TEXT,
},
'*': {
type: 'textfield',
inputType: 'text',
placeholder: VIP_PLACEHOLDER_TEXT,
},
},
node_id: {
eq_neq: {
type: 'textfield',
inputType: 'text',
placeholder: NODE_ID_PLACEHOLDER_TEXT,
},
startswith_endswith: {
type: 'textfield',
inputType: 'text',
placeholder: NODE_ID_PLACEHOLDER_TEXT,
},
in: {
type: 'textfield',
inputType: 'text',
placeholder: NODE_ID_PLACEHOLDER_TEXT,
helperText: NODE_ID_HELPER_TEXT,
},
'*': {
type: 'textfield',
inputType: 'text',
placeholder: NODE_ID_PLACEHOLDER_TEXT,
},
},
linode_id: {
eq_neq: {
type: 'autocomplete',
Expand Down
7 changes: 7 additions & 0 deletions packages/manager/src/features/CloudPulse/Alerts/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,13 @@ export const PORTS_PLACEHOLDER_TEXT = 'e.g., 80,443,3000';

export const PORT_PLACEHOLDER_TEXT = 'e.g., 80';

export const VIP_PLACEHOLDER_TEXT = 'Enter VIP address';
export const NODE_ID_PLACEHOLDER_TEXT = 'Enter Node ID';
export const NODE_ID_HELPER_TEXT =
'Enter one or more Node IDs separated by commas.';
export const VIP_HELPER_TEXT =
'Enter one or more VIP addresses separated by commas.';

export const CONFIGS_HELPER_TEXT =
'Enter one or more configuration IDs separated by commas.';

Expand Down
98 changes: 98 additions & 0 deletions packages/manager/src/features/CloudPulse/Utils/FilterConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -560,13 +560,111 @@ export const LKE_CONFIG: Readonly<CloudPulseServiceTypeFilterMap> = {
],
serviceType: 'lke',
};
export const NETLOADBALANCER_CONFIG: Readonly<CloudPulseServiceTypeFilterMap> =
{
capability: capabilityServiceTypeMapping['netloadbalancer'],
filters: [
{
configuration: {
filterKey: 'region',
children: ['resource_id'],
filterType: 'string',
isFilterable: false,
isMetricsFilter: false,
name: 'Region',
priority: 1,
neededInViews: [CloudPulseAvailableViews.central],
},
name: 'Region',
},
{
configuration: {
dependency: ['region'],
filterKey: 'resource_id',
filterType: 'string',
isFilterable: true,
isMetricsFilter: true,
isMultiSelect: true,
name: 'Network Load Balancers',
neededInViews: [CloudPulseAvailableViews.central],
placeholder: 'Select Network Load Balancers',
priority: 2,
},
name: 'Network Load Balancers',
},
{
configuration: {
filterKey: 'ip_version',
filterType: 'string',
isFilterable: true,
isMetricsFilter: false,
isOptional: true,
isMultiSelect: true,
name: 'IP Versions',
neededInViews: [
CloudPulseAvailableViews.central,
CloudPulseAvailableViews.service,
],
options: [
{
id: 'v6',
label: 'IPv6',
},
{
id: 'v4',
label: 'IPv4',
},
],
placeholder: 'Select IP Versions',
priority: 2,
type: CloudPulseSelectTypes.static,
dimensionKey: 'ip_version',
},
name: 'IP Versions',
},
{
configuration: {
filterKey: 'port',
filterType: 'string',
isFilterable: true,
isMetricsFilter: false,
isOptional: true,
name: 'Ports',
dimensionKey: 'port',
neededInViews: [
CloudPulseAvailableViews.central,
CloudPulseAvailableViews.service,
],
placeholder: 'e.g., 80,443,3000',
priority: 4,
},
name: 'Ports',
},
{
configuration: {
filterKey: 'relative_time_duration',
filterType: 'string',
isFilterable: true,
isMetricsFilter: true,
isMultiSelect: false,
name: TIME_DURATION,
neededInViews: [], // we will have a static time duration component, no need render from filter builder
placeholder: 'Select a Duration',
priority: 4,
},
name: TIME_DURATION,
},
],
serviceType: 'netloadbalancer',
};
export const FILTER_CONFIG: Readonly<
Map<number, CloudPulseServiceTypeFilterMap>
> = new Map([
[1, DBAAS_CONFIG],
[2, LINODE_CONFIG],
[3, NODEBALANCER_CONFIG],
[4, FIREWALL_CONFIG],
[5, NETLOADBALANCER_CONFIG],
[6, OBJECTSTORAGE_CONFIG_BUCKET],
[7, BLOCKSTORAGE_CONFIG],
[8, FIREWALL_NODEBALANCER_CONFIG],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export const NO_REGION_MESSAGE: Record<number, string> = {
7: 'No volumes configured in any regions.',
8: 'No firewalls configured in any Nodebalancer regions.',
9: 'No LKE clusters configured in any regions.',
5: 'No Network Load Balancers configured in any regions.',
};

export const HELPER_TEXT: Record<string, string> = {
Expand Down
2 changes: 2 additions & 0 deletions packages/manager/src/features/CloudPulse/Utils/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type {
Firewall,
KubernetesCluster,
Linode,
NetworkLoadBalancer,
NodeBalancer,
ObjectStorageBucket,
Volume,
Expand Down Expand Up @@ -64,6 +65,7 @@ export type QueryFunctionType =
| Firewall[]
| KubernetesCluster[]
| Linode[]
| NetworkLoadBalancer[]
| NodeBalancer[]
| ObjectStorageBucket[]
| Volume[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,7 @@ export const DIMENSION_TRANSFORM_CONFIG: Partial<
blockstorage: {
linode_id: TRANSFORMS.original,
},
netloadbalancer: {
protocol: TRANSFORMS.uppercase,
},
};
Loading