diff --git a/content/v2.0/visualize-data/visualization-types/gauge.md b/content/v2.0/visualize-data/visualization-types/gauge.md index 62380f824..e1c047c4e 100644 --- a/content/v2.0/visualize-data/visualization-types/gauge.md +++ b/content/v2.0/visualize-data/visualization-types/gauge.md @@ -64,4 +64,4 @@ from(bucket: "example-bucket") ``` ###### Visualization options for pressure gauge -{{< img-hd src="/img/2-0-visualizations-guage-pressure.jpg" alt="Pressure guage example" />}} +{{< img-hd src="/img/2-0-visualizations-guage-pressure.png" alt="Pressure guage example" />}} diff --git a/content/v2.0/visualize-data/visualization-types/graph-single-stat.md b/content/v2.0/visualize-data/visualization-types/graph-single-stat.md index 0c22695f9..61ef0820d 100644 --- a/content/v2.0/visualize-data/visualization-types/graph-single-stat.md +++ b/content/v2.0/visualize-data/visualization-types/graph-single-stat.md @@ -90,4 +90,4 @@ from(bucket: "example-bucket") ) ``` ###### Memory usage visualization -{{< img-hd src="/img/2-0-visualizations-graph-single-stat-mem.jpg" alt="Graph + Single Stat Memory Usage Example" />}} +{{< img-hd src="/img/2-0-visualizations-graph-single-stat-mem.png" alt="Graph + Single Stat Memory Usage Example" />}} diff --git a/content/v2.0/visualize-data/visualization-types/heatmap.md b/content/v2.0/visualize-data/visualization-types/heatmap.md index 755d6b1de..eac4b2878 100644 --- a/content/v2.0/visualize-data/visualization-types/heatmap.md +++ b/content/v2.0/visualize-data/visualization-types/heatmap.md @@ -96,7 +96,7 @@ and `_value_mem` is selected as the [Y Column](#data). The domain for each axis is also customized to account for the scale difference between column values. -{{< img-hd src="/img/2-0-visualizations-heatmap-correlation.jpg" alt="Heatmap correlation example" />}} +{{< img-hd src="/img/2-0-visualizations-heatmap-correlation.png" alt="Heatmap correlation example" />}} ## Important notes @@ -108,7 +108,7 @@ However, in certain cases, heatmaps provide better visibility into point density For example, the dashboard cells below visualize the same query results: -{{< img-hd src="/img/2-0-visualizations-heatmap-vs-scatter.jpg" alt="Heatmap vs Scatter plot" />}} +{{< img-hd src="/img/2-0-visualizations-heatmap-vs-scatter.png" alt="Heatmap vs Scatter plot" />}} The heatmap indicates isolated high point density, which isn't visible in the scatter plot. In the scatter plot visualization, points that share the same X and Y coordinates diff --git a/content/v2.0/visualize-data/visualization-types/histogram.md b/content/v2.0/visualize-data/visualization-types/histogram.md index 3843778f4..0c186e18c 100644 --- a/content/v2.0/visualize-data/visualization-types/histogram.md +++ b/content/v2.0/visualize-data/visualization-types/histogram.md @@ -77,4 +77,4 @@ from(bucket: "example-bucket") In the Histogram visualization options, select `_time` as the [X Column](#data) and `severity` as the [Group By](#data) option: -{{< img-hd src="/img/2-0-visualizations-histogram-errors.jpg" alt="Errors histogram" />}} +{{< img-hd src="/img/2-0-visualizations-histogram-errors.png" alt="Errors histogram" />}} diff --git a/content/v2.0/visualize-data/visualization-types/scatter.md b/content/v2.0/visualize-data/visualization-types/scatter.md index bd45cdbef..ad54dcb0b 100644 --- a/content/v2.0/visualize-data/visualization-types/scatter.md +++ b/content/v2.0/visualize-data/visualization-types/scatter.md @@ -91,7 +91,7 @@ union(tables: [cpu, mem]) ###### Use a scatter plot to visualize correlation In the Scatter visualization controls, points are differentiated based on their group keys. -{{< img-hd src="/img/2-0-visualizations-scatter-correlation.jpg" alt="Heatmap correlation example" />}} +{{< img-hd src="/img/2-0-visualizations-scatter-correlation.png" alt="Heatmap correlation example" />}} ## Important notes @@ -102,7 +102,7 @@ However, in certain cases, scatterplots can "hide" points if they share the same For example, the dashboard cells below visualize the same query results: -{{< img-hd src="/img/2-0-visualizations-heatmap-vs-scatter.jpg" alt="Heatmap vs Scatter plot" />}} +{{< img-hd src="/img/2-0-visualizations-heatmap-vs-scatter.png" alt="Heatmap vs Scatter plot" />}} The heatmap indicates isolated high point density, which isn't visible in the scatter plot. In the scatter plot visualization, points that share the same X and Y coordinates diff --git a/content/v2.0/visualize-data/visualization-types/single-stat.md b/content/v2.0/visualize-data/visualization-types/single-stat.md index ed70c9e01..10c49e303 100644 --- a/content/v2.0/visualize-data/visualization-types/single-stat.md +++ b/content/v2.0/visualize-data/visualization-types/single-stat.md @@ -62,4 +62,4 @@ from(bucket: "example-bucket") ``` ###### Memory usage as a single stat -{{< img-hd src="/img/2-0-visualizations-single-stat-memor.jpg" alt="Graph + Single Stat Memory Usage Example" />}} +{{< img-hd src="/img/2-0-visualizations-single-stat-memor.png" alt="Graph + Single Stat Memory Usage Example" />}} diff --git a/content/v2.0/visualize-data/visualization-types/table.md b/content/v2.0/visualize-data/visualization-types/table.md index 9af961887..d38254257 100644 --- a/content/v2.0/visualize-data/visualization-types/table.md +++ b/content/v2.0/visualize-data/visualization-types/table.md @@ -80,4 +80,4 @@ from(bucket: "example-bucket") ``` ###### Cluster metrics in a table -{{< img-hd src="/img/2-0-visualizations-table-human-readable.jpg" alt="Human readable metrics in a table" />}} +{{< img-hd src="/img/2-0-visualizations-table-human-readable.png" alt="Human readable metrics in a table" />}} diff --git a/deploy/docs-website.yml b/deploy/docs-website.yml index b2fc0a607..ca23dd41f 100644 --- a/deploy/docs-website.yml +++ b/deploy/docs-website.yml @@ -156,55 +156,69 @@ Resources: Description: Lambda function performing request URI rewriting. Code: ZipFile: | - const config = { - suffix: '.html', - appendToDirs: 'index.html', - removeTrailingSlash: false, - }; + 'use strict'; - const regexSuffixless = /\/[a-z0-9]+([0-9\.]+)?$/; // e.g. "/some/page" but not "/", "/some/" or "/some.jpg" - const regexTrailingSlash = /.+\/$/; // e.g. "/some/" or "/some/page/" but not root "/" - - exports.handler = function handler(event, context, callback) { + exports.handler = (event, context, callback) => { const { request } = event.Records[0].cf; - const { uri } = request; - const { suffix, appendToDirs, removeTrailingSlash } = config; + const { uri, headers, origin } = request; + const extension = uri.substr(uri.lastIndexOf('.') + 1); - // Append ".html" to origin request - if (suffix && uri.match(regexSuffixless)) { - request.uri = uri + suffix; - callback(null, request); - return; + const validExtensions = ['.html', '.css', '.js', '.xml', '.png', '.jpg', '.svg', '.otf', '.eot', '.ttf', '.woff']; + const indexPath = 'index.html'; + const defaultPath = '/v2.0/' + + // If path ends with '/', then append 'index.html', otherwise redirect to a + // path with '/' or ignore if the path ends with a valid file extension. + if ((uri == '/') || (uri.length < defaultPath.length)) { + callback(null, { + status: '302', + statusDescription: 'Found', + headers: { + location: [{ + key: 'Location', + value: defaultPath, + }], + } + }); + } else if (uri.endsWith('/')) { + request.uri = uri + indexPath; + } else if (uri.endsWith('/index.html')) { + callback(null, { + status: '302', + statusDescription: 'Found', + headers: { + location: [{ + key: 'Location', + value: uri.substr(0, uri.length - indexPath.length), + }], + } + }); + } else if (validExtensions.filter((ext) => uri.endsWith(ext)) == 0) { + callback(null, { + status: '302', + statusDescription: 'Found', + headers: { + location: [{ + key: 'Location', + value: uri + '/', + }], + } + }); } - // Append "index.html" to origin request - if (appendToDirs && uri.match(regexTrailingSlash)) { - request.uri = uri + appendToDirs; - callback(null, request); - return; - } + const pathsV1 = ['/influxdb', '/telegraf', '/chronograf', '/kapacitor', '/enterprise_influxdb', '/enterprise_kapacitor']; + const originV1 = process.env.ORIGIN_V1; - // Redirect (301) non-root requests ending in "/" to URI without trailing slash - if (removeTrailingSlash && uri.match(/.+\/$/)) { - const response = { - // body: '', - // bodyEncoding: 'text', - headers: { - 'location': [{ - key: 'Location', - value: uri.slice(0, -1) - }] - }, - status: '301', - statusDescription: 'Moved Permanently' - }; - callback(null, response); - return; + // Send to v1 origin if start of path matches + if (pathsV1.filter((path) => uri.startsWith(path)) > 0) { + headers['host'] = [{key: 'host', value: originV1}]; + origin.s3.domainName = originV1; } // If nothing matches, return request unchanged callback(null, request); }; + Handler: index.handler MemorySize: 128 Role: !Sub ${DocsOriginRequestRewriteLambdaRole.Arn} diff --git a/static/img/2-0-visualizations-graph-single-stat-mem.jpg b/static/img/2-0-visualizations-graph-single-stat-mem.jpg deleted file mode 100644 index 1b66d2b93..000000000 Binary files a/static/img/2-0-visualizations-graph-single-stat-mem.jpg and /dev/null differ diff --git a/static/img/2-0-visualizations-graph-single-stat-mem.png b/static/img/2-0-visualizations-graph-single-stat-mem.png new file mode 100644 index 000000000..95368261a Binary files /dev/null and b/static/img/2-0-visualizations-graph-single-stat-mem.png differ diff --git a/static/img/2-0-visualizations-guage-pressure.jpg b/static/img/2-0-visualizations-guage-pressure.jpg deleted file mode 100644 index 85a6f8aa7..000000000 Binary files a/static/img/2-0-visualizations-guage-pressure.jpg and /dev/null differ diff --git a/static/img/2-0-visualizations-guage-pressure.png b/static/img/2-0-visualizations-guage-pressure.png new file mode 100644 index 000000000..e16da7cf8 Binary files /dev/null and b/static/img/2-0-visualizations-guage-pressure.png differ diff --git a/static/img/2-0-visualizations-heatmap-correlation.jpg b/static/img/2-0-visualizations-heatmap-correlation.jpg deleted file mode 100644 index 4f8b5369f..000000000 Binary files a/static/img/2-0-visualizations-heatmap-correlation.jpg and /dev/null differ diff --git a/static/img/2-0-visualizations-heatmap-correlation.png b/static/img/2-0-visualizations-heatmap-correlation.png new file mode 100644 index 000000000..ae4f0ea3d Binary files /dev/null and b/static/img/2-0-visualizations-heatmap-correlation.png differ diff --git a/static/img/2-0-visualizations-heatmap-vs-scatter.jpg b/static/img/2-0-visualizations-heatmap-vs-scatter.jpg deleted file mode 100644 index 35ecfc820..000000000 Binary files a/static/img/2-0-visualizations-heatmap-vs-scatter.jpg and /dev/null differ diff --git a/static/img/2-0-visualizations-heatmap-vs-scatter.png b/static/img/2-0-visualizations-heatmap-vs-scatter.png new file mode 100644 index 000000000..fae4574c4 Binary files /dev/null and b/static/img/2-0-visualizations-heatmap-vs-scatter.png differ diff --git a/static/img/2-0-visualizations-histogram-errors.jpg b/static/img/2-0-visualizations-histogram-errors.jpg deleted file mode 100644 index 74ee02f6a..000000000 Binary files a/static/img/2-0-visualizations-histogram-errors.jpg and /dev/null differ diff --git a/static/img/2-0-visualizations-histogram-errors.png b/static/img/2-0-visualizations-histogram-errors.png new file mode 100644 index 000000000..7a3f3967d Binary files /dev/null and b/static/img/2-0-visualizations-histogram-errors.png differ diff --git a/static/img/2-0-visualizations-scatter-correlation.jpg b/static/img/2-0-visualizations-scatter-correlation.jpg deleted file mode 100644 index 9f7cd81bc..000000000 Binary files a/static/img/2-0-visualizations-scatter-correlation.jpg and /dev/null differ diff --git a/static/img/2-0-visualizations-scatter-correlation.png b/static/img/2-0-visualizations-scatter-correlation.png new file mode 100644 index 000000000..62704baff Binary files /dev/null and b/static/img/2-0-visualizations-scatter-correlation.png differ diff --git a/static/img/2-0-visualizations-single-stat-memor.jpg b/static/img/2-0-visualizations-single-stat-memor.jpg deleted file mode 100644 index 852dd5e26..000000000 Binary files a/static/img/2-0-visualizations-single-stat-memor.jpg and /dev/null differ diff --git a/static/img/2-0-visualizations-single-stat-memor.png b/static/img/2-0-visualizations-single-stat-memor.png new file mode 100644 index 000000000..3351a4892 Binary files /dev/null and b/static/img/2-0-visualizations-single-stat-memor.png differ diff --git a/static/img/2-0-visualizations-table-human-readable.jpg b/static/img/2-0-visualizations-table-human-readable.jpg deleted file mode 100644 index 245b0bae5..000000000 Binary files a/static/img/2-0-visualizations-table-human-readable.jpg and /dev/null differ diff --git a/static/img/2-0-visualizations-table-human-readable.png b/static/img/2-0-visualizations-table-human-readable.png new file mode 100644 index 000000000..0ada221e7 Binary files /dev/null and b/static/img/2-0-visualizations-table-human-readable.png differ