Skip to content

Commit

Permalink
[INI-1351] feat: INI charts from bank of Brazil (#2176)
Browse files Browse the repository at this point in the history
* [UXE-6127] feat: add chart top waf threat request by ip (#2118)

* feat: add chart top waf threat request by ip

* chore: adjust eslint

* [UXE-6128] feat: add charts status codes (#2125)

* feat: add charts status codes

* refactor: remove double chart functionality from status codes reports

* refactor: update HTTP status codes reports query and configuration

* refactor: remove line-chart-double component from graphs card block

* [UXE-6129] feat: add chart average request time (#2128)

* feat: add chart average request time

* feat: add variation type for average request time chart

* feat: add chart request by scheme (#2138)

* feat: add chart top waf threat requests by country (#2140)

* feat: add chart top waf request by country bar (#2144)

* feat: add chart top waf request by family attack (#2145)

* [UXE-6225] feat: add chart top waf request by host (#2148)

* feat: add chart top waf request by host

* feat: adjust required in validation

* [UXE-6227] feat: add chart top bot traffic (#2151)

* feat: add chart top bot traffic

* chore: adjust eslint

* feat: updated chart request by method (#2152)

* [UXE-6348] feat: updated chart description (#2153)

* feat: updated chart description

* chore: adjust eslint

* chore: upgrade gitHub actions cache to v3

* [UXE-6134] feat: add Requests by Status and Upstream (#2141)

* [UXE-6134] feat:  console real time metrics requests by status and upstream status (#2162)

* [NO-ISSUE] fix: implements filter empty values and filter attack chart label (#2160)

* fix: implements filter empty values and filter attack chart label

* chore: adjust eslint

* feat: expand bot activity map chart to full width

* feat: improve real-time metrics report descriptions

* fix: adjust filter to support contains and not contains metrics filter (#2167)

* feat: add graphic request breakdown table (#2169)

* feat: add new column field (#2174)

* [NO-ISSUE] chore: updated description charts (#2175)

* chore: updated description charts

* chore: adjust eslint

---------

Co-authored-by: Paulo Sobrinho Ferreira <110847590+pauloSF0@users.noreply.github.com>
  • Loading branch information
lucasmendes21 and pauloSF0 authored Feb 18, 2025
1 parent 3596412 commit fd14499
Show file tree
Hide file tree
Showing 18 changed files with 1,328 additions and 154 deletions.
11 changes: 6 additions & 5 deletions src/modules/real-time-metrics/chart/format-c3-graph-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ function generateMeanLineValues(resultChart, mean) {
* @returns {string} - The title case string
*/
export function camelToTitle(text) {
if (!text) return
return text
.replace(/([a-z])([A-Z0-9])/g, '$1 $2')
.replace(/\s+/g, ' ')
Expand Down Expand Up @@ -332,7 +333,7 @@ export function getSeriesInfos(resultChart, chartData, hasMeanLineSeries, hasMea
seriesTotal /= series.length - 1
}
const formattedSeriesTotal = formatYAxisLabels(seriesTotal, chartData)
const seriesName = camelToTitle(series[0])
const seriesName = !chartData?.doNotConvertToCamelCase ? camelToTitle(series[0]) : series[0]
const renamedSeries = `${seriesName} - ${formattedSeriesTotal}`

seriesNames = { ...seriesNames, [series[0]]: renamedSeries }
Expand Down Expand Up @@ -366,10 +367,10 @@ export function getSeriesInfos(resultChart, chartData, hasMeanLineSeries, hasMea
* @param {Array} tooltipData - The tooltip data to reset
* @returns {Array} - The tooltip data with the label reset
*/
function resetTooltipLabel(tooltipData) {
function resetTooltipLabel(tooltipData, chartData) {
return tooltipData.map((item) => ({
...item,
name: camelToTitle(item.id)
name: !chartData?.doNotConvertToCamelCase ? camelToTitle(item.id) : item.id
}))
}

Expand Down Expand Up @@ -535,15 +536,15 @@ export function FormatC3GraphProps({
if (chartData.type === 'ordered-bar') {
const { index } = d[0]
return this.getTooltipContent(
resetTooltipLabel(d),
resetTooltipLabel(d, chartData),
defaultTitleFormat,
defaultValueFormat,
() => CHART_RULES.BASE_COLOR_PATTERNS[index]
)
}

return this.getTooltipContent(
resetTooltipLabel(d),
resetTooltipLabel(d, chartData),
defaultTitleFormat,
defaultValueFormat,
color
Expand Down
10 changes: 9 additions & 1 deletion src/modules/real-time-metrics/constants/chart-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ const SCREEN_XSMALL_BREAKPOINT = 540

const MEAN_LINE_LABEL = 'Mean Line'

const COLUMN_NAMES_FIELD = {
sum: 'Total',
geolocCountryName: 'Country',
geolocAsn: 'ASN',
geolocRegionName: 'Region'
}

const DATA_VOLUME = {
tera: 1e12,
giga: 1073741824,
Expand Down Expand Up @@ -82,7 +89,8 @@ const CHART_RULES = {
BOTTOM_LEGEND_PADDING,
BASE_COLOR_PATTERNS,
MEAN_LINE_PATTERN,
GAUGE_COLOR_SCHEMA
GAUGE_COLOR_SCHEMA,
COLUMN_NAMES_FIELD
}

export default CHART_RULES
20 changes: 20 additions & 0 deletions src/modules/real-time-metrics/constants/dashboards.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ const PAGES_DASHBOARDS = {
label: 'Bandwidth Saving',
path: 'bandwidth-saving',
dataset: 'httpMetrics'
},
{
id: '357549179454620240',
label: 'Request Breakdown',
path: 'request-breakdown',
dataset: 'httpBreakdownMetrics'
}
]
},
Expand Down Expand Up @@ -147,6 +153,20 @@ const PAGES_DASHBOARDS = {
dataset: 'botManagerBreakdownMetrics'
}
]
},
{
id: 10,
label: 'Threats Breakdown',
path: 'threats',
groupId: 2,
dashboards: [
{
id: '357548675837198934',
label: 'Threats Breakdown',
path: 'breakdown',
dataset: 'httpBreakdownMetrics'
}
]
}
],
observe: [
Expand Down
9 changes: 8 additions & 1 deletion src/modules/real-time-metrics/constants/help-center-urls.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ const HELP_CENTER_URLS = {
'/real-time-metrics/edge-applications/requests/missed-requests-per-second',
missedRequests: '/real-time-metrics/edge-applications/requests/missed-requests',
requestsByMethod: '/real-time-metrics/edge-applications/requests/requests-by-method',
averageRequestTime: '/real-time-metrics/edge-applications/requests/average-request-time',
requestByScheme: '/real-time-metrics/edge-applications/requests/request-by-scheme',
requestsOffloaded: '/real-time-metrics/edge-applications/requests/requests-offloaded',
requestsPerSecondOffloaded:
'/real-time-metrics/edge-applications/requests/requests-per-second-offloaded',
Expand All @@ -40,7 +42,8 @@ const HELP_CENTER_URLS = {
httpStatusCodes2xx: '/real-time-metrics/edge-applications/status-codes/http-status-codes-2xx',
httpStatusCodes3xx: '/real-time-metrics/edge-applications/status-codes/http-status-codes-3xx',
httpStatusCodes4xx: '/real-time-metrics/edge-applications/status-codes/http-status-codes-4xx',
httpStatusCodes5xx: '/real-time-metrics/edge-applications/status-codes/http-status-codes-5xx'
httpStatusCodes5xx: '/real-time-metrics/edge-applications/status-codes/http-status-codes-5xx',
statusUpstream: '/real-time-metrics/edge-applications/status-codes/status-upstream'
}
},
edgeFunctions: {
Expand Down Expand Up @@ -84,6 +87,7 @@ const HELP_CENTER_URLS = {
botHits: '/real-time-metrics/bot-manager-advanced/overview/bot-hits',
transactions: '/real-time-metrics/bot-manager-advanced/overview/transactions',
botTraffic: '/real-time-metrics/bot-manager-advanced/overview/bot-traffic',
topBotTraffic: '/real-time-metrics/bot-manager-advanced/overview/top-bot-traffic',
topBotAction: '/real-time-metrics/bot-manager-advanced/overview/top-bot-action',
botCaptchaLine: '/real-time-metrics/bot-manager-advanced/overview/bot-captcha-line-graph',
topBotCaptchaPie:
Expand All @@ -97,6 +101,9 @@ const HELP_CENTER_URLS = {
topBadBotIps: '/real-time-metrics/bot-manager-advanced/breakdown/top-bad-bot-ips',
topImpactedUrls: '/real-time-metrics/bot-manager-advanced/breakdown/top-impacted-urls'
}
},
threatsBreakdown: {
threatsRequestsByIps: '/real-time-metrics/threats/breakdown'
}
}

Expand Down
19 changes: 16 additions & 3 deletions src/modules/real-time-metrics/constants/reports-texts.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ const REPORTS_TEXTS = {
statusCodes: {
httpStatusCodes2xx: {
description:
'Indicates user requests that were received, understood, accepted, and processed by the server. Displays Requests Status Code 200, Requests Status Code 204, Requests Status Code 206, and Requests Status Code 2xx.'
'Indicates successful responses to user requests. Displays Request Status Code 200 and other 2xx status codes.'
},
httpStatusCodes3xx: {
description:
'Indicates user requests that were redirected and had to go through another stage to be delivered. Displays Requests Status Code 301, Requests Status Code 302, Requests Status Code 304, and Requests Status Code 3xx.'
'Indicates redirections that have occurred with user requests. Displays Request Status Code 300 and other 3xx status codes.'
},
httpStatusCodes4xx: {
description:
Expand All @@ -98,6 +98,15 @@ const REPORTS_TEXTS = {
httpStatusCodes5xx: {
description:
'Indicates the server failed to deliver an apparently valid request. Displays Requests Status Code 500, Requests Status Code 502, Requests Status Code 503, and Requests Status Code 5xx.'
},
statusUpstream: {
description: 'Top 10 Status and Upstream Status that had the most requests.'
}
},
requestBreakdown: {
iPAddressInformation: {
description:
'Displays the distribution of requests by region, country, ASN, and individual IP address.'
}
},
waf: {
Expand Down Expand Up @@ -125,7 +134,11 @@ const REPORTS_TEXTS = {
httpMethods: {
requestsByMethod: {
description:
'Total requests made to your domain divided by the HTTP method used. Displays methods Requests Http Method Get, Requests Http Method Post, Requests Http Method Head, and Requests Http Method Others.'
'Sum of requests for each HTTP method during the selected period. Displays the overall request count for each method.'
},
averageRequestTime: {
description:
'Average request duration over time. Displays how long requests take on average, in seconds.'
}
},
bandwidthSaving: {
Expand Down
Loading

0 comments on commit fd14499

Please sign in to comment.