Hotfix: Updated lambda function and visualization example images
|
|
@ -64,4 +64,4 @@ from(bucket: "example-bucket")
|
||||||
```
|
```
|
||||||
|
|
||||||
###### Visualization options for pressure gauge
|
###### 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" />}}
|
||||||
|
|
|
||||||
|
|
@ -90,4 +90,4 @@ from(bucket: "example-bucket")
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
###### Memory usage visualization
|
###### 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" />}}
|
||||||
|
|
|
||||||
|
|
@ -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
|
The domain for each axis is also customized to account for the scale difference
|
||||||
between column values.
|
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
|
## 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:
|
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.
|
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
|
In the scatter plot visualization, points that share the same X and Y coordinates
|
||||||
|
|
|
||||||
|
|
@ -77,4 +77,4 @@ from(bucket: "example-bucket")
|
||||||
In the Histogram visualization options, select `_time` as the [X Column](#data)
|
In the Histogram visualization options, select `_time` as the [X Column](#data)
|
||||||
and `severity` as the [Group By](#data) option:
|
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" />}}
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ union(tables: [cpu, mem])
|
||||||
###### Use a scatter plot to visualize correlation
|
###### Use a scatter plot to visualize correlation
|
||||||
In the Scatter visualization controls, points are differentiated based on their group keys.
|
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
|
## 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:
|
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.
|
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
|
In the scatter plot visualization, points that share the same X and Y coordinates
|
||||||
|
|
|
||||||
|
|
@ -62,4 +62,4 @@ from(bucket: "example-bucket")
|
||||||
```
|
```
|
||||||
|
|
||||||
###### Memory usage as a single stat
|
###### 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" />}}
|
||||||
|
|
|
||||||
|
|
@ -80,4 +80,4 @@ from(bucket: "example-bucket")
|
||||||
```
|
```
|
||||||
|
|
||||||
###### Cluster metrics in a table
|
###### 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" />}}
|
||||||
|
|
|
||||||
|
|
@ -156,55 +156,69 @@ Resources:
|
||||||
Description: Lambda function performing request URI rewriting.
|
Description: Lambda function performing request URI rewriting.
|
||||||
Code:
|
Code:
|
||||||
ZipFile: |
|
ZipFile: |
|
||||||
const config = {
|
'use strict';
|
||||||
suffix: '.html',
|
|
||||||
appendToDirs: 'index.html',
|
|
||||||
removeTrailingSlash: false,
|
|
||||||
};
|
|
||||||
|
|
||||||
const regexSuffixless = /\/[a-z0-9]+([0-9\.]+)?$/; // e.g. "/some/page" but not "/", "/some/" or "/some.jpg"
|
exports.handler = (event, context, callback) => {
|
||||||
const regexTrailingSlash = /.+\/$/; // e.g. "/some/" or "/some/page/" but not root "/"
|
|
||||||
|
|
||||||
exports.handler = function handler(event, context, callback) {
|
|
||||||
const { request } = event.Records[0].cf;
|
const { request } = event.Records[0].cf;
|
||||||
const { uri } = request;
|
const { uri, headers, origin } = request;
|
||||||
const { suffix, appendToDirs, removeTrailingSlash } = config;
|
const extension = uri.substr(uri.lastIndexOf('.') + 1);
|
||||||
|
|
||||||
// Append ".html" to origin request
|
const validExtensions = ['.html', '.css', '.js', '.xml', '.png', '.jpg', '.svg', '.otf', '.eot', '.ttf', '.woff'];
|
||||||
if (suffix && uri.match(regexSuffixless)) {
|
const indexPath = 'index.html';
|
||||||
request.uri = uri + suffix;
|
const defaultPath = '/v2.0/'
|
||||||
callback(null, request);
|
|
||||||
return;
|
// 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
|
const pathsV1 = ['/influxdb', '/telegraf', '/chronograf', '/kapacitor', '/enterprise_influxdb', '/enterprise_kapacitor'];
|
||||||
if (appendToDirs && uri.match(regexTrailingSlash)) {
|
const originV1 = process.env.ORIGIN_V1;
|
||||||
request.uri = uri + appendToDirs;
|
|
||||||
callback(null, request);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Redirect (301) non-root requests ending in "/" to URI without trailing slash
|
// Send to v1 origin if start of path matches
|
||||||
if (removeTrailingSlash && uri.match(/.+\/$/)) {
|
if (pathsV1.filter((path) => uri.startsWith(path)) > 0) {
|
||||||
const response = {
|
headers['host'] = [{key: 'host', value: originV1}];
|
||||||
// body: '',
|
origin.s3.domainName = originV1;
|
||||||
// bodyEncoding: 'text',
|
|
||||||
headers: {
|
|
||||||
'location': [{
|
|
||||||
key: 'Location',
|
|
||||||
value: uri.slice(0, -1)
|
|
||||||
}]
|
|
||||||
},
|
|
||||||
status: '301',
|
|
||||||
statusDescription: 'Moved Permanently'
|
|
||||||
};
|
|
||||||
callback(null, response);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If nothing matches, return request unchanged
|
// If nothing matches, return request unchanged
|
||||||
callback(null, request);
|
callback(null, request);
|
||||||
};
|
};
|
||||||
|
|
||||||
Handler: index.handler
|
Handler: index.handler
|
||||||
MemorySize: 128
|
MemorySize: 128
|
||||||
Role: !Sub ${DocsOriginRequestRewriteLambdaRole.Arn}
|
Role: !Sub ${DocsOriginRequestRewriteLambdaRole.Arn}
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 83 KiB |
|
After Width: | Height: | Size: 117 KiB |
|
Before Width: | Height: | Size: 88 KiB |
|
After Width: | Height: | Size: 133 KiB |
|
Before Width: | Height: | Size: 87 KiB |
|
After Width: | Height: | Size: 131 KiB |
|
Before Width: | Height: | Size: 65 KiB |
|
After Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 113 KiB |
|
After Width: | Height: | Size: 95 KiB |
|
Before Width: | Height: | Size: 114 KiB |
|
After Width: | Height: | Size: 147 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 27 KiB |