Compare commits
313 Commits
v9.2.0-bet
...
v9.1.7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0cbb79298d | ||
|
|
abaff05adf | ||
|
|
b0ef776ed8 | ||
|
|
af9bde9f08 | ||
|
|
983850eb12 | ||
|
|
db84cf55b3 | ||
|
|
3bc2a28006 | ||
|
|
f3cc439986 | ||
|
|
a3a59c5475 | ||
|
|
206d976b8b | ||
|
|
9f4459bab9 | ||
|
|
b486ffaa7c | ||
|
|
da3f44bf42 | ||
|
|
38b2062ddb | ||
|
|
fda7a54310 | ||
|
|
b859dac451 | ||
|
|
09f3d92f51 | ||
|
|
7a4497ab99 | ||
|
|
2fc60d3133 | ||
|
|
05b4ce4861 | ||
|
|
0d2524589b | ||
|
|
a39652741b | ||
|
|
8d076c38d0 | ||
|
|
b5a2dda7ff | ||
|
|
595344a3d0 | ||
|
|
3ff24b2731 | ||
|
|
f6365646a7 | ||
|
|
e2f3ce1703 | ||
|
|
51144a427f | ||
|
|
6d050f5d8f | ||
|
|
fbf3fe69b5 | ||
|
|
936b3d8327 | ||
|
|
c3275d23ff | ||
|
|
8f5fbb88ac | ||
|
|
b7c66294fa | ||
|
|
68b9af48db | ||
|
|
98eab48d38 | ||
|
|
f7c5f093ab | ||
|
|
b2b87464d7 | ||
|
|
21245470ae | ||
|
|
6d5399f792 | ||
|
|
3472ce7f70 | ||
|
|
b273a96985 | ||
|
|
12e0b2e860 | ||
|
|
97bee8a53a | ||
|
|
b7cc6fdf94 | ||
|
|
06b71c24c6 | ||
|
|
80784cbfab | ||
|
|
ca32cadaf3 | ||
|
|
3303eb7881 | ||
|
|
d9a39c1553 | ||
|
|
c8f4918e48 | ||
|
|
e61cc31378 | ||
|
|
d34b2eb738 | ||
|
|
855dbd6eaa | ||
|
|
d646f49ea0 | ||
|
|
90364a9173 | ||
|
|
89410ffd0c | ||
|
|
04ec76aaf3 | ||
|
|
404abe2be6 | ||
|
|
4c1225219c | ||
|
|
2f1f764364 | ||
|
|
3d55cc9b47 | ||
|
|
5f51a1425b | ||
|
|
93db981c89 | ||
|
|
81626ba88d | ||
|
|
aff26ac8ae | ||
|
|
8fe0c9452e | ||
|
|
b67d62c016 | ||
|
|
d3d45680d4 | ||
|
|
946622f7c6 | ||
|
|
b0124f0648 | ||
|
|
48676a95a1 | ||
|
|
ced6d5591a | ||
|
|
b1d62efb9f | ||
|
|
32fcbd78b5 | ||
|
|
131b857bd2 | ||
|
|
f500459303 | ||
|
|
85dc4fc505 | ||
|
|
1c9091f85d | ||
|
|
99039d8cf6 | ||
|
|
41a300a4f4 | ||
|
|
4d28c496b6 | ||
|
|
e962b2fd5d | ||
|
|
2760c71038 | ||
|
|
4cfc7a94df | ||
|
|
3425aace85 | ||
|
|
887cde9b0d | ||
|
|
714925777a | ||
|
|
58d5bc8f8f | ||
|
|
aa20e2125c | ||
|
|
25e991c523 | ||
|
|
7852384e10 | ||
|
|
ef4749bcb4 | ||
|
|
c80fb0c116 | ||
|
|
28997ed169 | ||
|
|
a41e6ae453 | ||
|
|
f80a9388cf | ||
|
|
1c05c66f33 | ||
|
|
fb0eb5ed60 | ||
|
|
e8e631d336 | ||
|
|
c4afe31c8e | ||
|
|
a78a93130d | ||
|
|
2e3292dbd3 | ||
|
|
e1f5d698e6 | ||
|
|
19a58da54c | ||
|
|
2619aead7f | ||
|
|
c4f57481fd | ||
|
|
ea2ac956cd | ||
|
|
afe763b4a3 | ||
|
|
3cb113d02a | ||
|
|
512a90e3e5 | ||
|
|
3339fc2210 | ||
|
|
ed52d422c1 | ||
|
|
bb398e9aac | ||
|
|
0e7ab2ea01 | ||
|
|
1bf8c8563d | ||
|
|
48ee6e6cb8 | ||
|
|
8f76cf81be | ||
|
|
67baeb765f | ||
|
|
6205d11afc | ||
|
|
9c3e1968da | ||
|
|
e7988dbb5a | ||
|
|
35d51435f4 | ||
|
|
eac9f6dd57 | ||
|
|
456d785f2f | ||
|
|
6267d4a3d5 | ||
|
|
843ca0a355 | ||
|
|
6e300048ed | ||
|
|
6f255cb089 | ||
|
|
d04f3fb2f1 | ||
|
|
05e6b345b6 | ||
|
|
8696aea01f | ||
|
|
9b816ea945 | ||
|
|
25f4599e76 | ||
|
|
8790142aef | ||
|
|
4f924a9b97 | ||
|
|
6da550f736 | ||
|
|
563b445185 | ||
|
|
e42f84f87d | ||
|
|
c64cecda0c | ||
|
|
031580ef3e | ||
|
|
1296582f4b | ||
|
|
b622632291 | ||
|
|
11ba65420d | ||
|
|
019a200107 | ||
|
|
1080729433 | ||
|
|
8526d2cb71 | ||
|
|
4a57bbce32 | ||
|
|
74734db443 | ||
|
|
fc4bab2463 | ||
|
|
ea4d653cce | ||
|
|
2c7c81cb7a | ||
|
|
9ea61eebfd | ||
|
|
83805b8b89 | ||
|
|
54356ac5b3 | ||
|
|
ba4dc6e77b | ||
|
|
af18359063 | ||
|
|
e39608eb3a | ||
|
|
6b805aaac5 | ||
|
|
e5741c82d6 | ||
|
|
0a4d2bbe3d | ||
|
|
ecf7cae554 | ||
|
|
f5a4e9232f | ||
|
|
344b2ef0bb | ||
|
|
238db92f69 | ||
|
|
b4a8496b06 | ||
|
|
565969cfcf | ||
|
|
493c7866a2 | ||
|
|
c8a313c289 | ||
|
|
200a901829 | ||
|
|
867c695646 | ||
|
|
34d32edcce | ||
|
|
a108cc4db9 | ||
|
|
3555aa8abb | ||
|
|
699be1eea8 | ||
|
|
108c2575f8 | ||
|
|
fe7c483b9b | ||
|
|
10c79f020c | ||
|
|
dddf5e510d | ||
|
|
e326041c82 | ||
|
|
b7864b3db1 | ||
|
|
308d226875 | ||
|
|
665da6bc21 | ||
|
|
de4cd984bd | ||
|
|
e059708aed | ||
|
|
d941d0ba78 | ||
|
|
219f7e63cf | ||
|
|
04967f4d8a | ||
|
|
7002c11006 | ||
|
|
58c41b2e29 | ||
|
|
b8aa0760e7 | ||
|
|
23e88aa9ca | ||
|
|
169eeb4ee2 | ||
|
|
6acfbeeaac | ||
|
|
a95c46e6f1 | ||
|
|
2021f603ed | ||
|
|
fa506b8327 | ||
|
|
a8855cd7dc | ||
|
|
9bea66845a | ||
|
|
c041930402 | ||
|
|
0d6d0ed9d0 | ||
|
|
9ece1844d9 | ||
|
|
0d949b40ba | ||
|
|
7e2d4789e5 | ||
|
|
543211103c | ||
|
|
54caac9518 | ||
|
|
f80df9a187 | ||
|
|
1639dad624 | ||
|
|
3892a175f5 | ||
|
|
a18df43e65 | ||
|
|
775ba0a7ee | ||
|
|
cbb6b88b7a | ||
|
|
49c1c2ec0a | ||
|
|
85ef08283f | ||
|
|
9ac364b7f4 | ||
|
|
516b1b7d6a | ||
|
|
31279e8c78 | ||
|
|
ba56a4dc12 | ||
|
|
5409e7a156 | ||
|
|
562d96efda | ||
|
|
f82b2fc716 | ||
|
|
319529f4a4 | ||
|
|
389dca97a6 | ||
|
|
5b36df325a | ||
|
|
c800c656bf | ||
|
|
d0d9f315c9 | ||
|
|
dc9af8d949 | ||
|
|
5a95003f9c | ||
|
|
14707ad4b4 | ||
|
|
a0e7ded34f | ||
|
|
2ae1af8b28 | ||
|
|
d83c62b939 | ||
|
|
0a71f0fc20 | ||
|
|
f6d7731dc1 | ||
|
|
732daac119 | ||
|
|
5242c26b3b | ||
|
|
5116f740ab | ||
|
|
9f5b714e16 | ||
|
|
42cf51b4cb | ||
|
|
6aeedb36de | ||
|
|
92fd6aaa80 | ||
|
|
e6b6382629 | ||
|
|
2184d6dcf0 | ||
|
|
f6755278dc | ||
|
|
81afb47ef3 | ||
|
|
5188243e30 | ||
|
|
3820ffd601 | ||
|
|
dac7b0e0ac | ||
|
|
189b868712 | ||
|
|
f9b75f8b46 | ||
|
|
b4a0c0458a | ||
|
|
98a36f4005 | ||
|
|
29ac9e8e58 | ||
|
|
5fd906f9f9 | ||
|
|
cb54541c5f | ||
|
|
e3a54dd3c6 | ||
|
|
82a1095f9e | ||
|
|
cc4acb719d | ||
|
|
6c935d3aa0 | ||
|
|
2c7e77b124 | ||
|
|
1237290a9d | ||
|
|
33afe60b87 | ||
|
|
ff2f7f2621 | ||
|
|
8c587f177f | ||
|
|
399bad4f72 | ||
|
|
9300634113 | ||
|
|
4d2005311a | ||
|
|
c1fe453a53 | ||
|
|
18c22f03f7 | ||
|
|
cd0071f183 | ||
|
|
aa321e74f6 | ||
|
|
57e60ffed6 | ||
|
|
bb1b145ce8 | ||
|
|
8dd2b99c87 | ||
|
|
6d8a345f4c | ||
|
|
7682ecd285 | ||
|
|
10aba4d7ed | ||
|
|
2873e044df | ||
|
|
806b7405aa | ||
|
|
712b474226 | ||
|
|
f27199df88 | ||
|
|
89bfade974 | ||
|
|
a9e628e887 | ||
|
|
d8419d4154 | ||
|
|
bb687ca965 | ||
|
|
7c7f082cd9 | ||
|
|
66a3c0fa7a | ||
|
|
f9a0926c59 | ||
|
|
02675223ec | ||
|
|
2cf5329622 | ||
|
|
d62274c4ca | ||
|
|
4db402c649 | ||
|
|
4afb108daf | ||
|
|
b308c331c2 | ||
|
|
17de328ac8 | ||
|
|
6ba2ecc470 | ||
|
|
447a2d4d82 | ||
|
|
b28a11e1b4 | ||
|
|
83e062f4c8 | ||
|
|
6fe808734b | ||
|
|
3489677be1 | ||
|
|
99293c5cf2 | ||
|
|
f738dad97c | ||
|
|
f0aad29a63 | ||
|
|
0015826410 | ||
|
|
d330c24c89 | ||
|
|
f4aed50192 | ||
|
|
0c8785fe21 | ||
|
|
6ca9dc8516 | ||
|
|
4f46dcbfdb | ||
|
|
27677fa9f3 | ||
|
|
b9e152fbf8 |
1340
.betterer.results
1340
.betterer.results
File diff suppressed because it is too large
Load Diff
1147
.drone.yml
1147
.drone.yml
File diff suppressed because it is too large
Load Diff
86
.eslintrc
86
.eslintrc
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"extends": ["@grafana/eslint-config"],
|
||||
"root": true,
|
||||
"plugins": ["@emotion", "lodash", "jest", "import", "jsx-a11y"],
|
||||
"plugins": ["@emotion", "lodash", "jest", "import"],
|
||||
"settings": {
|
||||
"import/internal-regex": "^(app/)|(@grafana)",
|
||||
"import/external-module-folders": ["node_modules", ".yarn"]
|
||||
@@ -18,82 +18,7 @@
|
||||
"newlines-between": "always",
|
||||
"alphabetize": { "order": "asc" }
|
||||
}
|
||||
],
|
||||
"no-restricted-imports": [
|
||||
"warn",
|
||||
{
|
||||
"paths": [
|
||||
{
|
||||
"name": "react-redux",
|
||||
"importNames": ["useDispatch", "useSelector"],
|
||||
"message": "Please import from app/types instead."
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
// Use typescript's no-redeclare for compatibility with overrides
|
||||
"no-redeclare": "off",
|
||||
"@typescript-eslint/no-redeclare": ["error"],
|
||||
|
||||
|
||||
// these are all the rules listed in the strict preset
|
||||
// we should fix them one by one and mark them as errors
|
||||
// once they're all fixed, we can remove them all and instead extend the strict preset
|
||||
// with "extends": ["plugin:jsx-a11y/strict"]
|
||||
"jsx-a11y/alt-text": "off",
|
||||
"jsx-a11y/anchor-has-content": "error",
|
||||
"jsx-a11y/anchor-is-valid": "off",
|
||||
"jsx-a11y/aria-activedescendant-has-tabindex": "error",
|
||||
"jsx-a11y/aria-props": "error",
|
||||
"jsx-a11y/aria-proptypes": "error",
|
||||
"jsx-a11y/aria-role": "off",
|
||||
"jsx-a11y/aria-unsupported-elements": "error",
|
||||
"jsx-a11y/autocomplete-valid": "error",
|
||||
"jsx-a11y/click-events-have-key-events": "off",
|
||||
"jsx-a11y/heading-has-content": "error",
|
||||
"jsx-a11y/html-has-lang": "error",
|
||||
"jsx-a11y/iframe-has-title": "off",
|
||||
"jsx-a11y/img-redundant-alt": "off",
|
||||
"jsx-a11y/interactive-supports-focus": [
|
||||
"off",
|
||||
{
|
||||
"tabbable": [
|
||||
"button",
|
||||
"checkbox",
|
||||
"link",
|
||||
"progressbar",
|
||||
"searchbox",
|
||||
"slider",
|
||||
"spinbutton",
|
||||
"switch",
|
||||
"textbox"
|
||||
]
|
||||
}
|
||||
],
|
||||
"jsx-a11y/label-has-associated-control": "off",
|
||||
"jsx-a11y/media-has-caption": "error",
|
||||
"jsx-a11y/mouse-events-have-key-events": "off",
|
||||
"jsx-a11y/no-access-key": "error",
|
||||
"jsx-a11y/no-autofocus": "off",
|
||||
"jsx-a11y/no-distracting-elements": "error",
|
||||
"jsx-a11y/no-interactive-element-to-noninteractive-role": "error",
|
||||
"jsx-a11y/no-noninteractive-element-interactions": [
|
||||
"off",
|
||||
{
|
||||
"body": ["onError", "onLoad"],
|
||||
"iframe": ["onError", "onLoad"],
|
||||
"img": ["onError", "onLoad"]
|
||||
}
|
||||
],
|
||||
"jsx-a11y/no-noninteractive-element-to-interactive-role": "off",
|
||||
"jsx-a11y/no-noninteractive-tabindex": "off",
|
||||
"jsx-a11y/no-redundant-roles": "error",
|
||||
"jsx-a11y/no-static-element-interactions": "off",
|
||||
"jsx-a11y/role-has-required-aria-props": "off",
|
||||
"jsx-a11y/role-supports-aria-props": "off",
|
||||
"jsx-a11y/scope": "error",
|
||||
"jsx-a11y/tabindex-no-positive": "off"
|
||||
]
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
@@ -110,13 +35,6 @@
|
||||
"react/jsx-uses-react": "off",
|
||||
"react/react-in-jsx-scope": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["public/dashboards/scripted*.js"],
|
||||
"rules": {
|
||||
"no-redeclare": "error",
|
||||
"@typescript-eslint/no-redeclare": "off"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
65
.github/CODEOWNERS
vendored
65
.github/CODEOWNERS
vendored
@@ -11,27 +11,12 @@
|
||||
# In each subsection folders are ordered first by depth, then alphabetically.
|
||||
# This should make it easy to add new rules without breaking existing ones.
|
||||
|
||||
# Documentation
|
||||
# Documentation owner: Jita Chatterjee
|
||||
/docs/ @grafana/docs-squad
|
||||
/contribute/ @grafana/docs-squad
|
||||
/docs/sources/developers/plugins/ @grafana/docs-squad @grafana/plugins-platform-frontend @grafana/plugins-platform-backend
|
||||
/docs/sources/developers/plugins/backend @grafana/docs-squad @grafana/plugins-platform-backend
|
||||
# Administration, data sources, querying, release updates: Garrett Guillotte
|
||||
# Set up, dashboards/visualization, best practices: Chris Moyer
|
||||
# Alerting: Brenda Muir
|
||||
/docs/sources/administration/ @gguillotte-grafana
|
||||
/docs/sources/alerting @brendamuir
|
||||
/docs/sources/best-practices/ @chri2547
|
||||
/docs/sources/dashboards/ @chri2547
|
||||
/docs/sources/datasources/ @gguillotte-grafana
|
||||
/docs/sources/enterprise/ @gguillotte-grafana
|
||||
/docs/sources/explore/ @gguillotte-grafana
|
||||
/docs/sources/getting-started/ @chri2547
|
||||
/docs/sources/old-alerting @brendamuir
|
||||
/docs/sources/panels/ @chri2547
|
||||
/docs/sources/release-notes/ @gguillotte-grafana
|
||||
/docs/sources/visualization/ @chri2547
|
||||
/docs/sources/whatsnew/ @gguillotte-grafana
|
||||
/contribute/ @marcusolsson @grafana/docs-squad
|
||||
/docs/sources/developers/plugins/ @marcusolsson @grafana/docs-squad @grafana/plugins-platform-frontend @grafana/plugins-platform-backend
|
||||
/docs/sources/developers/plugins/backend @marcusolsson @grafana/docs-squad @grafana/plugins-platform-backend
|
||||
/docs/sources/enterprise/ @osg-grafana @grafana/docs-squad
|
||||
|
||||
# Backend code
|
||||
*.go @grafana/backend-platform
|
||||
@@ -39,13 +24,6 @@ go.mod @grafana/backend-platform
|
||||
go.sum @grafana/backend-platform
|
||||
/.bingo @grafana/backend-platform
|
||||
|
||||
# Backend code, developers environment
|
||||
/devenv/docker/blocks/auth @grafana/grafana-authnz-team
|
||||
|
||||
# Logs code, developers environment
|
||||
/devenv/docker/blocks/loki* @grafana/observability-logs
|
||||
/devenv/docker/blocks/elastic* @grafana/observability-logs
|
||||
|
||||
# Continuous Integration
|
||||
.drone.yml @grafana/grafana-release-eng
|
||||
.drone.star @grafana/grafana-release-eng
|
||||
@@ -62,10 +40,10 @@ go.sum @grafana/backend-platform
|
||||
/pkg/tsdb/influxdb @grafana/observability-metrics
|
||||
/pkg/tsdb/elasticsearch @grafana/observability-logs
|
||||
/pkg/tsdb/graphite @grafana/observability-metrics
|
||||
/pkg/tsdb/jaeger @grafana/observability-traces-and-profiling
|
||||
/pkg/tsdb/jaeger @grafana/observability-logs-and-traces
|
||||
/pkg/tsdb/loki @grafana/observability-logs
|
||||
/pkg/tsdb/zipkin @grafana/observability-traces-and-profiling
|
||||
/pkg/tsdb/tempo @grafana/observability-traces-and-profiling
|
||||
/pkg/tsdb/zipkin @grafana/observability-logs-and-traces
|
||||
/pkg/tsdb/tempo @grafana/observability-logs-and-traces
|
||||
|
||||
# BI backend code
|
||||
/pkg/tsdb/mysql @grafana/grafana-bi-squad
|
||||
@@ -82,7 +60,7 @@ go.sum @grafana/backend-platform
|
||||
/pkg/services/store/ @grafana/grafana-edge-squad
|
||||
/pkg/services/export/ @grafana/grafana-edge-squad
|
||||
/pkg/infra/filestore/ @grafana/grafana-edge-squad
|
||||
/pkg/tsdb/testdatasource/sims/ @grafana/grafana-edge-squad
|
||||
pkg/tsdb/testdatasource/sims/ @grafana/grafana-edge-squad
|
||||
|
||||
# Alerting
|
||||
/pkg/services/ngalert @grafana/alerting-squad-backend
|
||||
@@ -100,7 +78,6 @@ go.sum @grafana/backend-platform
|
||||
/pkg/plugins @grafana/plugins-platform-backend
|
||||
/pkg/services/datasourceproxy @grafana/plugins-platform-backend
|
||||
/pkg/services/datasources @grafana/plugins-platform-backend
|
||||
/pkg/plugins/pfs @grafana/plugins-platform-backend @grafana/grafana-as-code
|
||||
|
||||
# Dashboard previews / crawler (behind feature flag)
|
||||
/pkg/services/thumbs @grafana/grafana-edge-squad
|
||||
@@ -118,12 +95,11 @@ go.sum @grafana/backend-platform
|
||||
/packages/grafana-ui/.storybook @grafana/plugins-platform-frontend
|
||||
/packages/grafana-ui/src/components/DateTimePickers @grafana/grafana-bi-squad
|
||||
/packages/grafana-ui/src/components/GraphNG @grafana/grafana-bi-squad
|
||||
/packages/grafana-ui/src/components/Logs @grafana/observability-logs
|
||||
/packages/grafana-ui/src/components/Table @grafana/grafana-bi-squad
|
||||
/packages/grafana-ui/src/components/TimeSeries @grafana/grafana-bi-squad
|
||||
/packages/grafana-ui/src/components/uPlot @grafana/grafana-bi-squad
|
||||
/packages/grafana-ui/src/utils/storybook @grafana/plugins-platform-frontend
|
||||
/packages/jaeger-ui-components/ @grafana/observability-traces-and-profiling
|
||||
/packages/jaeger-ui-components/ @grafana/observability-logs-and-traces
|
||||
/plugins-bundled @grafana/plugins-platform-frontend
|
||||
# public folder
|
||||
/public/app/core/components/TimePicker @grafana/grafana-bi-squad
|
||||
@@ -142,8 +118,7 @@ go.sum @grafana/backend-platform
|
||||
/public/app/plugins/panel/heatmap @grafana/grafana-bi-squad
|
||||
/public/app/plugins/panel/histogram @grafana/grafana-bi-squad
|
||||
/public/app/plugins/panel/logs @grafana/observability-logs
|
||||
/public/app/plugins/panel/nodeGraph @grafana/observability-traces-and-profiling
|
||||
/public/app/plugins/panel/traces @grafana/observability-traces-and-profiling
|
||||
/public/app/plugins/panel/nodeGraph @grafana/observability-logs-and-traces
|
||||
/public/app/plugins/panel/piechart @grafana/grafana-bi-squad
|
||||
/public/app/plugins/panel/state-timeline @grafana/grafana-bi-squad
|
||||
/public/app/plugins/panel/status-history @grafana/grafana-bi-squad
|
||||
@@ -156,6 +131,8 @@ go.sum @grafana/backend-platform
|
||||
/scripts/build/release-packages.sh @grafana/plugins-platform-frontend
|
||||
/scripts/circle-release-next-packages.sh @grafana/plugins-platform-frontend
|
||||
/scripts/ci-frontend-metrics.sh @grafana/user-essentials @grafana/plugins-platform-frontend @grafana/grafana-bi-squad
|
||||
/scripts/ci-reference-docs-build.sh @grafana/plugins-platform-frontend
|
||||
/scripts/ci-reference-docs-lint.sh @grafana/plugins-platform-frontend
|
||||
/scripts/grunt @grafana/frontend-ops
|
||||
/scripts/webpack @grafana/frontend-ops
|
||||
/scripts/generate-a11y-report.sh @grafana/user-essentials
|
||||
@@ -170,7 +147,7 @@ lerna.json @grafana/frontend-ops
|
||||
.betterer.results @joshhunt
|
||||
|
||||
# @grafana/ui component documentation
|
||||
*.mdx @jessover9000 @grafana/plugins-platform-frontend
|
||||
*.mdx @marcusolsson @jessover9000 @grafana/plugins-platform-frontend
|
||||
|
||||
# Core datasources
|
||||
/public/app/plugins/datasource/cloudwatch @grafana/aws-plugins
|
||||
@@ -178,7 +155,7 @@ lerna.json @grafana/frontend-ops
|
||||
/public/app/plugins/datasource/grafana-azure-monitor-datasource @grafana/cloud-provider-plugins
|
||||
/public/app/plugins/datasource/graphite @grafana/observability-metrics
|
||||
/public/app/plugins/datasource/influxdb @grafana/observability-metrics
|
||||
/public/app/plugins/datasource/jaeger @grafana/observability-traces-and-profiling
|
||||
/public/app/plugins/datasource/jaeger @grafana/observability-logs-and-traces
|
||||
/public/app/plugins/datasource/loki @grafana/observability-logs
|
||||
/public/app/plugins/datasource/mssql @grafana/grafana-bi-squad
|
||||
/public/app/plugins/datasource/mysql @grafana/grafana-bi-squad
|
||||
@@ -186,8 +163,8 @@ lerna.json @grafana/frontend-ops
|
||||
/public/app/plugins/datasource/postgres @grafana/grafana-bi-squad
|
||||
/public/app/plugins/datasource/prometheus @grafana/observability-metrics
|
||||
/public/app/plugins/datasource/cloud-monitoring @grafana/cloud-provider-plugins
|
||||
/public/app/plugins/datasource/zipkin @grafana/observability-traces-and-profiling
|
||||
/public/app/plugins/datasource/tempo @grafana/observability-traces-and-profiling
|
||||
/public/app/plugins/datasource/zipkin @grafana/observability-logs-and-traces
|
||||
/public/app/plugins/datasource/tempo @grafana/observability-logs-and-traces
|
||||
/public/app/plugins/datasource/alertmanager @grafana/alerting-squad
|
||||
|
||||
# Cloud middleware
|
||||
@@ -206,11 +183,3 @@ lerna.json @grafana/frontend-ops
|
||||
/pkg/services/oauthtoken @grafana/grafana-authnz-team
|
||||
/pkg/services/teamguardian @grafana/grafana-authnz-team
|
||||
/pkg/services/serviceaccounts @grafana/grafana-authnz-team
|
||||
|
||||
# Grafana Partnerships Team
|
||||
/pkg/infra/httpclient/httpclientprovider/sigv4_middleware.go @grafana/grafana-partnerships-team
|
||||
|
||||
# Schema framework and code generation
|
||||
/pkg/codegen @grafana/grafana-as-code
|
||||
/pkg/framework/coremodel @grafana/grafana-as-code
|
||||
/public/app/plugins/*gen.go @grafana/grafana-as-code
|
||||
|
||||
7
.github/commands.json
vendored
7
.github/commands.json
vendored
@@ -41,7 +41,6 @@
|
||||
"type":"label",
|
||||
"name":"bot/no new info",
|
||||
"action":"close",
|
||||
"removeLabel":"needs more info",
|
||||
"comment":"We've closed this issue since it needs more information and hasn't had any activity recently. We can re-open it after you you add more information. To avoid having your issue closed in the future, please read our [CONTRIBUTING](https://github.com/grafana/grafana/blob/main/CONTRIBUTING.md) guidelines.\n\nHappy graphing!"
|
||||
},
|
||||
{
|
||||
@@ -152,7 +151,7 @@
|
||||
"name":"datasource/Tempo",
|
||||
"action":"addToProject",
|
||||
"addToProject":{
|
||||
"url":"https://github.com/orgs/grafana/projects/221"
|
||||
"url":"https://github.com/orgs/grafana/projects/110"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -168,7 +167,7 @@
|
||||
"name":"datasource/Jaeger",
|
||||
"action":"addToProject",
|
||||
"addToProject":{
|
||||
"url":"https://github.com/orgs/grafana/projects/221"
|
||||
"url":"https://github.com/orgs/grafana/projects/110"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -176,7 +175,7 @@
|
||||
"name":"datasource/Zipkin",
|
||||
"action":"addToProject",
|
||||
"addToProject":{
|
||||
"url":"https://github.com/orgs/grafana/projects/221"
|
||||
"url":"https://github.com/orgs/grafana/projects/110"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
8
.github/metrics-collector.json
vendored
8
.github/metrics-collector.json
vendored
@@ -16,10 +16,6 @@
|
||||
"name": "needs_more_info",
|
||||
"query": "label:\"needs more info\" is:open"
|
||||
},
|
||||
{
|
||||
"name": "triage_needs_confirmation",
|
||||
"query": "label:\"triage/needs-confirmation\" is:open"
|
||||
},
|
||||
{
|
||||
"name": "unlabeled",
|
||||
"query": "is:open is:issue no:label"
|
||||
@@ -27,6 +23,10 @@
|
||||
{
|
||||
"name": "open_prs",
|
||||
"query": "is:open is:pr"
|
||||
},
|
||||
{
|
||||
"name": "milestone_7_4_open",
|
||||
"query": "is:open is:issue milestone:7.4"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
2
.github/renovate.json5
vendored
2
.github/renovate.json5
vendored
@@ -16,7 +16,7 @@
|
||||
"d3-scale-chromatic", // we should bump this once we move to esm modules
|
||||
"execa", // we should bump this once we move to esm modules
|
||||
"history", // we should bump this together with react-router-dom
|
||||
"@mdx-js/react", // storybook peer-depends on its 1.x version, we should upgrade this when we upgrade storybook
|
||||
"@mdx-js/react", // storybook peer-depends on it's 1.x version, we should upgrade this when we upgrade storybook
|
||||
"monaco-editor", // due to us exposing this via @grafana/ui/CodeEditor's props bumping can break plugins
|
||||
"node-fetch", // we should bump this once we move to esm modules
|
||||
"react-hook-form", // due to us exposing these hooks via @grafana/ui form components bumping can break plugins
|
||||
|
||||
1
.github/teams.yml
vendored
1
.github/teams.yml
vendored
@@ -7,5 +7,4 @@ test:
|
||||
|
||||
# Alerting team
|
||||
area/alerting:
|
||||
github-board: 52
|
||||
channel-label: C02B9MXQE0J
|
||||
|
||||
@@ -14,7 +14,7 @@ on:
|
||||
|
||||
jobs:
|
||||
workflow-call:
|
||||
uses: grafana/code-coverage/.github/workflows/code-coverage.yml@v0.1.11
|
||||
uses: grafana/code-coverage/.github/workflows/code-coverage.yml@v0.1.6
|
||||
with:
|
||||
frontend-path-regexp: public\/app\/plugins\/datasource\/(grafana-azure-monitor-datasource|cloud-monitoring|cloudwatch)
|
||||
backend-path-regexp: pkg\/tsdb\/(azuremonitor|cloudmonitoring|cloudwatch)
|
||||
|
||||
@@ -12,8 +12,9 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
with:
|
||||
path: './pr'
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.16.0
|
||||
@@ -21,7 +22,7 @@ jobs:
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
|
||||
|
||||
|
||||
- name: Restore yarn cache
|
||||
uses: actions/cache@v2
|
||||
id: yarn-cache
|
||||
@@ -30,18 +31,15 @@ jobs:
|
||||
key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }}
|
||||
restore-keys: |
|
||||
yarn-cache-folder-
|
||||
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn install --immutable
|
||||
|
||||
- name: Build packages
|
||||
run: yarn packages:build
|
||||
|
||||
- name: Pack packages
|
||||
run: yarn packages:pack --out ./%s.tgz
|
||||
|
||||
- name: Zip built tarballed packages
|
||||
run: zip -r ./pr_built_packages.zip ./packages/**/*.tgz
|
||||
- name: Zip built packages
|
||||
run: zip -r ./pr_built_packages.zip ./packages/**/dist
|
||||
|
||||
- name: Upload build output as artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
@@ -58,7 +56,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
with:
|
||||
path: './base'
|
||||
ref: ${{ github.event.pull_request.base.ref }}
|
||||
|
||||
@@ -69,7 +67,7 @@ jobs:
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
|
||||
|
||||
|
||||
- name: Restore yarn cache
|
||||
uses: actions/cache@v2
|
||||
id: yarn-cache
|
||||
@@ -78,18 +76,15 @@ jobs:
|
||||
key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }}
|
||||
restore-keys: |
|
||||
yarn-cache-folder-
|
||||
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn install --immutable
|
||||
|
||||
- name: Build packages
|
||||
run: yarn packages:build
|
||||
|
||||
- name: Pack packages
|
||||
run: yarn packages:pack --out ./%s.tgz
|
||||
|
||||
- name: Zip built tarballed packages
|
||||
run: zip -r ./base_built_packages.zip ./packages/**/*.tgz
|
||||
- name: Zip built packages
|
||||
run: zip -r ./base_built_packages.zip ./packages/**/dist
|
||||
|
||||
- name: Upload build output as artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
@@ -116,12 +111,12 @@ jobs:
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: buildBase
|
||||
|
||||
|
||||
- name: Unzip artifact from pr
|
||||
run: unzip -j pr_built_packages.zip -d ./pr && rm pr_built_packages.zip
|
||||
run: unzip pr_built_packages.zip -d ./pr && rm pr_built_packages.zip
|
||||
|
||||
- name: Unzip artifact from base
|
||||
run: unzip -j base_built_packages.zip -d ./base && rm base_built_packages.zip
|
||||
run: unzip base_built_packages.zip -d ./base && rm base_built_packages.zip
|
||||
|
||||
- name: Get link for the Github Action job
|
||||
id: job
|
||||
@@ -133,7 +128,7 @@ jobs:
|
||||
|
||||
- name: Detect breaking changes
|
||||
id: breaking-changes
|
||||
run: ./scripts/check-breaking-changes.sh
|
||||
run: ./scripts/check-breaking-changes.sh
|
||||
env:
|
||||
FORCE_COLOR: 3
|
||||
GITHUB_JOB_LINK: ${{ steps.job.outputs.link }}
|
||||
@@ -148,7 +143,7 @@ jobs:
|
||||
with:
|
||||
name: levitate
|
||||
path: levitate/
|
||||
|
||||
|
||||
- name: Exit
|
||||
run: exit ${{ steps.breaking-changes.outputs.is_breaking }}
|
||||
shell: bash
|
||||
|
||||
19
.github/workflows/issue-labeled.yml
vendored
19
.github/workflows/issue-labeled.yml
vendored
@@ -14,37 +14,23 @@ jobs:
|
||||
- name: "Determine which team to notify"
|
||||
run: |
|
||||
# Default to null values.
|
||||
BOARD="null"
|
||||
CHANNEL="null"
|
||||
|
||||
echo "${{ github.event.label.name }} label added"
|
||||
export CURRENT_LABEL="${{ github.event.label.name }}" # Enable the use of the label in yq evaluations
|
||||
# yq is installed by default in ubuntu-latest
|
||||
if [[ $(yq e 'keys | .[] | select(. == env(CURRENT_LABEL))' teams.yml ) ]]; then
|
||||
# Check if we have a board set to use.
|
||||
if [[ $(yq '.[env(CURRENT_LABEL)] | has("github-board")' teams.yml ) == true ]]; then
|
||||
BOARD=$(yq '.[env(CURRENT_LABEL)].github-board' teams.yml)
|
||||
echo "Ready to add issue to Grafana board ${BOARD}"
|
||||
fi
|
||||
# Check if we have a channel set to notify on comments.
|
||||
if [[ $(yq '.[env(CURRENT_LABEL)] | has("channel-label")' teams.yml ) == true ]]; then
|
||||
CHANNEL=$(yq '.[env(CURRENT_LABEL)].channel-label' teams.yml)
|
||||
echo "Ready to send issue to channel ID ${CHANNEL}"
|
||||
fi
|
||||
fi
|
||||
|
||||
# set environment for next step
|
||||
echo "BOARD=${BOARD}" >> $GITHUB_ENV
|
||||
echo "CHANNEL=${CHANNEL}" >> $GITHUB_ENV
|
||||
|
||||
- name: "Add to GitHub board"
|
||||
if: ${{ env.BOARD != 'null' }}
|
||||
uses: leonsteinhaeuser/project-beta-automations@v1.3.0
|
||||
with:
|
||||
project_id: ${{ env.BOARD }}
|
||||
organization: grafana
|
||||
resource_node_id: ${{ github.event.issue.node_id }}
|
||||
gh_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
# Debug logging
|
||||
echo "Ready to send issue to channel ID ${CHANNEL}"
|
||||
|
||||
- name: "Prepare payload"
|
||||
uses: frabert/replace-string-action@v2.0
|
||||
@@ -57,7 +43,6 @@ jobs:
|
||||
flags: 'g'
|
||||
|
||||
- name: "Send Slack notification"
|
||||
if: ${{ env.CHANNEL != 'null' }}
|
||||
uses: slackapi/slack-github-action@v1.14.0
|
||||
with:
|
||||
payload: >
|
||||
|
||||
17
.github/workflows/ox-code-coverage.yml
vendored
17
.github/workflows/ox-code-coverage.yml
vendored
@@ -1,17 +0,0 @@
|
||||
name: Observability Experience test code coverage
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'pkg/services/queryhistory/**'
|
||||
- 'public/app/features/explore/**'
|
||||
- 'public/app/features/correlations/**'
|
||||
branches-ignore:
|
||||
- dependabot/**
|
||||
- backport-*
|
||||
|
||||
jobs:
|
||||
workflow-call:
|
||||
uses: grafana/code-coverage/.github/workflows/code-coverage.yml@v0.1.11
|
||||
with:
|
||||
frontend-path-regexp: public\/app\/features\/(explore|correlations)
|
||||
backend-path-regexp: pkg\/services\/(queryhistory)
|
||||
7
.github/workflows/publish.yml
vendored
7
.github/workflows/publish.yml
vendored
@@ -3,7 +3,7 @@ name: publish_docs
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- v9.1.x
|
||||
paths:
|
||||
- 'docs/sources/**'
|
||||
- 'packages/grafana-*/**'
|
||||
@@ -30,7 +30,8 @@ jobs:
|
||||
key: yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
yarn-
|
||||
- run: yarn install --immutable
|
||||
- run: yarn install --immutable
|
||||
- run: ./scripts/ci-reference-docs-build.sh
|
||||
- name: publish-to-git
|
||||
uses: ./.github/actions/website-sync
|
||||
id: publish
|
||||
@@ -40,7 +41,7 @@ jobs:
|
||||
host: github.com
|
||||
github_pat: '${{ secrets.GH_BOT_ACCESS_TOKEN }}'
|
||||
source_folder: docs/sources
|
||||
target_folder: content/docs/grafana/next
|
||||
target_folder: content/docs/grafana/latest
|
||||
allow_no_changes: 'true'
|
||||
- shell: bash
|
||||
run: |
|
||||
|
||||
12
.gitignore
vendored
12
.gitignore
vendored
@@ -40,8 +40,6 @@ tsconfig.tsbuildinfo
|
||||
# Enterprise devenv
|
||||
/devenv/docker/blocks/grafana-enterprise
|
||||
/devenv/docker/blocks/saml-enterprise
|
||||
# This is the new place of the block, but I leave the previous here for a while
|
||||
/devenv/docker/blocks/auth/saml-enterprise
|
||||
|
||||
/tmp
|
||||
tools/phantomjs/phantomjs
|
||||
@@ -75,9 +73,7 @@ public/css/*.min.css
|
||||
|
||||
# devenv
|
||||
/devenv/docker-compose.yaml
|
||||
/devenv/docker-compose.override.yaml
|
||||
/devenv/.env
|
||||
/devenv/docker/blocks/tempo/tempo-data/
|
||||
|
||||
conf/custom.ini
|
||||
/conf/provisioning/**/custom.yaml
|
||||
@@ -129,12 +125,6 @@ pkg/cmd/grafana-server/__debug_bin
|
||||
/packages/**/compiled
|
||||
/packages/**/.rpt2_cache
|
||||
/packages/**/tsdoc-metadata.json
|
||||
/packages/**/package.tgz
|
||||
## CI places the packages in a different location
|
||||
/npm-artifacts/*.tgz
|
||||
|
||||
# Ignore frontend build manifest
|
||||
manifest.json
|
||||
|
||||
# Ignore go local build dependencies
|
||||
/scripts/go/bin/**
|
||||
@@ -172,8 +162,6 @@ compilation-stats.json
|
||||
!pkg/services/featuremgmt/toggles_gen.go
|
||||
!pkg/coremodel/**/*_gen.go
|
||||
!pkg/framework/**/*_gen.go
|
||||
!pkg/plugins/pfs/**/*_gen.go
|
||||
!public/app/plugins/**/*_gen.go
|
||||
|
||||
# Auto-generated internationalization files
|
||||
public/locales/_build/
|
||||
|
||||
@@ -13,13 +13,6 @@ ignore-generated-header = false
|
||||
severity = "warning"
|
||||
confidence = 3
|
||||
|
||||
[linters-settings.depguard]
|
||||
list-type = "blacklist"
|
||||
include-go-root = true
|
||||
packages = ["io/ioutil"]
|
||||
[[linters-settings.depguard.packages-with-error-message]]
|
||||
"io/ioutil" = "Deprecated: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details."
|
||||
|
||||
[linters-settings.gocritic]
|
||||
enabled-checks = ["ruleguard"]
|
||||
[linters-settings.gocritic.settings.ruleguard]
|
||||
|
||||
@@ -1,48 +1,3 @@
|
||||
var dashboardSettings = [
|
||||
{
|
||||
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=settings',
|
||||
wait: 500,
|
||||
rootElement: '.main-view',
|
||||
threshold: 0,
|
||||
},
|
||||
{
|
||||
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=annotations',
|
||||
wait: 500,
|
||||
rootElement: '.main-view',
|
||||
threshold: 0,
|
||||
},
|
||||
{
|
||||
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=templating',
|
||||
wait: 500,
|
||||
rootElement: '.main-view',
|
||||
threshold: 0,
|
||||
},
|
||||
{
|
||||
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=links',
|
||||
wait: 500,
|
||||
rootElement: '.main-view',
|
||||
threshold: 0,
|
||||
},
|
||||
{
|
||||
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=versions',
|
||||
wait: 500,
|
||||
rootElement: '.main-view',
|
||||
threshold: 0,
|
||||
},
|
||||
{
|
||||
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=permissions',
|
||||
wait: 500,
|
||||
rootElement: '.main-view',
|
||||
threshold: 9,
|
||||
},
|
||||
{
|
||||
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=dashboard_json',
|
||||
wait: 500,
|
||||
rootElement: '.main-view',
|
||||
threshold: 2,
|
||||
},
|
||||
];
|
||||
|
||||
var config = {
|
||||
defaults: {
|
||||
concurrency: 1,
|
||||
@@ -88,7 +43,12 @@ var config = {
|
||||
rootElement: '.main-view',
|
||||
threshold: 0,
|
||||
},
|
||||
...dashboardSettings,
|
||||
{
|
||||
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=settings',
|
||||
wait: 500,
|
||||
rootElement: '.main-view',
|
||||
threshold: 0,
|
||||
},
|
||||
{
|
||||
url: '${HOST}/?orgId=1&search=open',
|
||||
wait: 500,
|
||||
|
||||
@@ -1,40 +1,3 @@
|
||||
var dashboardSettings = [
|
||||
{
|
||||
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=settings',
|
||||
wait: 500,
|
||||
rootElement: '.main-view',
|
||||
},
|
||||
{
|
||||
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=annotations',
|
||||
wait: 500,
|
||||
rootElement: '.main-view',
|
||||
},
|
||||
{
|
||||
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=templating',
|
||||
wait: 500,
|
||||
rootElement: '.main-view',
|
||||
},
|
||||
{
|
||||
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=links',
|
||||
wait: 500,
|
||||
rootElement: '.main-view',
|
||||
},
|
||||
{
|
||||
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=versions',
|
||||
wait: 500,
|
||||
rootElement: '.main-view',
|
||||
},
|
||||
{
|
||||
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=permissions',
|
||||
wait: 500,
|
||||
rootElement: '.main-view',
|
||||
},
|
||||
{
|
||||
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=dashboard_json',
|
||||
wait: 500,
|
||||
rootElement: '.main-view',
|
||||
},
|
||||
];
|
||||
var config = {
|
||||
defaults: {
|
||||
concurrency: 1,
|
||||
@@ -76,7 +39,11 @@ var config = {
|
||||
wait: 500,
|
||||
rootElement: '.main-view',
|
||||
},
|
||||
...dashboardSettings,
|
||||
{
|
||||
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=settings',
|
||||
wait: 500,
|
||||
rootElement: '.main-view',
|
||||
},
|
||||
{
|
||||
url: '${HOST}/?orgId=1&search=open',
|
||||
wait: 500,
|
||||
|
||||
@@ -25,8 +25,3 @@ public/locales/**/*.js
|
||||
# Auto-generated theme files
|
||||
theme.light.generated.json
|
||||
theme.dark.generated.json
|
||||
|
||||
# Generated Swagger API specs
|
||||
public/api-spec.json
|
||||
public/api-merged.json
|
||||
public/openapi3.json
|
||||
|
||||
File diff suppressed because one or more lines are too long
4
.yarn/sdks/eslint/bin/eslint.js
vendored
4
.yarn/sdks/eslint/bin/eslint.js
vendored
@@ -1,13 +1,13 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire} = require(`module`);
|
||||
const {createRequire, createRequireFromPath} = require(`module`);
|
||||
const {resolve} = require(`path`);
|
||||
|
||||
const relPnpApiPath = "../../../../.pnp.cjs";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absRequire = createRequire(absPnpApiPath);
|
||||
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
|
||||
4
.yarn/sdks/eslint/lib/api.js
vendored
4
.yarn/sdks/eslint/lib/api.js
vendored
@@ -1,13 +1,13 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire} = require(`module`);
|
||||
const {createRequire, createRequireFromPath} = require(`module`);
|
||||
const {resolve} = require(`path`);
|
||||
|
||||
const relPnpApiPath = "../../../../.pnp.cjs";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absRequire = createRequire(absPnpApiPath);
|
||||
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
|
||||
2
.yarn/sdks/eslint/package.json
vendored
2
.yarn/sdks/eslint/package.json
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "eslint",
|
||||
"version": "8.23.0-sdk",
|
||||
"version": "8.20.0-sdk",
|
||||
"main": "./lib/api.js",
|
||||
"type": "commonjs"
|
||||
}
|
||||
|
||||
4
.yarn/sdks/prettier/index.js
vendored
4
.yarn/sdks/prettier/index.js
vendored
@@ -1,13 +1,13 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire} = require(`module`);
|
||||
const {createRequire, createRequireFromPath} = require(`module`);
|
||||
const {resolve} = require(`path`);
|
||||
|
||||
const relPnpApiPath = "../../../.pnp.cjs";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absRequire = createRequire(absPnpApiPath);
|
||||
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
|
||||
4
.yarn/sdks/typescript/bin/tsc
vendored
4
.yarn/sdks/typescript/bin/tsc
vendored
@@ -1,13 +1,13 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire} = require(`module`);
|
||||
const {createRequire, createRequireFromPath} = require(`module`);
|
||||
const {resolve} = require(`path`);
|
||||
|
||||
const relPnpApiPath = "../../../../.pnp.cjs";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absRequire = createRequire(absPnpApiPath);
|
||||
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
|
||||
4
.yarn/sdks/typescript/bin/tsserver
vendored
4
.yarn/sdks/typescript/bin/tsserver
vendored
@@ -1,13 +1,13 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire} = require(`module`);
|
||||
const {createRequire, createRequireFromPath} = require(`module`);
|
||||
const {resolve} = require(`path`);
|
||||
|
||||
const relPnpApiPath = "../../../../.pnp.cjs";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absRequire = createRequire(absPnpApiPath);
|
||||
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
|
||||
4
.yarn/sdks/typescript/lib/tsc.js
vendored
4
.yarn/sdks/typescript/lib/tsc.js
vendored
@@ -1,13 +1,13 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire} = require(`module`);
|
||||
const {createRequire, createRequireFromPath} = require(`module`);
|
||||
const {resolve} = require(`path`);
|
||||
|
||||
const relPnpApiPath = "../../../../.pnp.cjs";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absRequire = createRequire(absPnpApiPath);
|
||||
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
|
||||
4
.yarn/sdks/typescript/lib/tsserver.js
vendored
4
.yarn/sdks/typescript/lib/tsserver.js
vendored
@@ -1,13 +1,13 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire} = require(`module`);
|
||||
const {createRequire, createRequireFromPath} = require(`module`);
|
||||
const {resolve} = require(`path`);
|
||||
|
||||
const relPnpApiPath = "../../../../.pnp.cjs";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absRequire = createRequire(absPnpApiPath);
|
||||
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
|
||||
|
||||
const moduleWrapper = tsserver => {
|
||||
if (!process.versions.pnp) {
|
||||
|
||||
4
.yarn/sdks/typescript/lib/tsserverlibrary.js
vendored
4
.yarn/sdks/typescript/lib/tsserverlibrary.js
vendored
@@ -1,13 +1,13 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire} = require(`module`);
|
||||
const {createRequire, createRequireFromPath} = require(`module`);
|
||||
const {resolve} = require(`path`);
|
||||
|
||||
const relPnpApiPath = "../../../../.pnp.cjs";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absRequire = createRequire(absPnpApiPath);
|
||||
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
|
||||
|
||||
const moduleWrapper = tsserver => {
|
||||
if (!process.versions.pnp) {
|
||||
|
||||
4
.yarn/sdks/typescript/lib/typescript.js
vendored
4
.yarn/sdks/typescript/lib/typescript.js
vendored
@@ -1,13 +1,13 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const {existsSync} = require(`fs`);
|
||||
const {createRequire} = require(`module`);
|
||||
const {createRequire, createRequireFromPath} = require(`module`);
|
||||
const {resolve} = require(`path`);
|
||||
|
||||
const relPnpApiPath = "../../../../.pnp.cjs";
|
||||
|
||||
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
||||
const absRequire = createRequire(absPnpApiPath);
|
||||
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
|
||||
|
||||
if (existsSync(absPnpApiPath)) {
|
||||
if (!process.versions.pnp) {
|
||||
|
||||
2
.yarn/sdks/typescript/package.json
vendored
2
.yarn/sdks/typescript/package.json
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "typescript",
|
||||
"version": "4.8.2-sdk",
|
||||
"version": "4.7.4-sdk",
|
||||
"main": "./lib/typescript.js",
|
||||
"type": "commonjs"
|
||||
}
|
||||
|
||||
58
.yarnrc.yml
58
.yarnrc.yml
@@ -3,40 +3,37 @@ enableTelemetry: false
|
||||
nodeLinker: pnp
|
||||
|
||||
packageExtensions:
|
||||
"@mdx-js/loader@1.6.22":
|
||||
'@mdx-js/loader@1.6.22':
|
||||
peerDependencies:
|
||||
react: 17.0.1
|
||||
"@npmcli/run-script@4.1.3":
|
||||
dependencies:
|
||||
which: ^2.0.2
|
||||
"@storybook/addon-docs@6.4.21":
|
||||
'@storybook/addon-docs@6.4.21':
|
||||
peerDependencies:
|
||||
"@storybook/manager-webpack5": 6.4.21
|
||||
"@storybook/addon-essentials@6.4.21":
|
||||
'@storybook/manager-webpack5': 6.4.21
|
||||
'@storybook/addon-essentials@6.4.21':
|
||||
peerDependencies:
|
||||
"@storybook/components": 6.4.21
|
||||
"@storybook/core-events": 6.4.21
|
||||
"@storybook/manager-webpack5": 6.4.21
|
||||
"@storybook/theming": 6.4.21
|
||||
"@storybook/core-server@6.4.21":
|
||||
'@storybook/components': 6.4.21
|
||||
'@storybook/core-events': 6.4.21
|
||||
'@storybook/manager-webpack5': 6.4.21
|
||||
'@storybook/theming': 6.4.21
|
||||
'@storybook/core-server@6.4.21':
|
||||
peerDependencies:
|
||||
"@babel/core": ^7.0.0
|
||||
"@storybook/core@6.4.21":
|
||||
'@babel/core': ^7.0.0
|
||||
'@storybook/core@6.4.21':
|
||||
peerDependencies:
|
||||
"@babel/core": ^7.0.0
|
||||
"@storybook/manager-webpack5": 6.4.21
|
||||
"@storybook/csf-tools@6.4.21":
|
||||
'@babel/core': ^7.0.0
|
||||
'@storybook/manager-webpack5': 6.4.21
|
||||
'@storybook/csf-tools@6.4.21':
|
||||
peerDependencies:
|
||||
"@babel/core": ^7.0.0
|
||||
"@storybook/react@6.4.21":
|
||||
'@babel/core': ^7.0.0
|
||||
'@storybook/react@6.4.21':
|
||||
peerDependencies:
|
||||
"@storybook/manager-webpack5": 6.4.21
|
||||
'@storybook/manager-webpack5': 6.4.21
|
||||
doctrine@3.0.0:
|
||||
dependencies:
|
||||
assert: 2.0.0
|
||||
moveable@0.30.0:
|
||||
dependencies:
|
||||
"@daybrush/utils": 1.7.0
|
||||
'@daybrush/utils': 1.7.0
|
||||
framework-utils: ^1.1.0
|
||||
rc-time-picker@3.7.3:
|
||||
peerDependencies:
|
||||
@@ -51,9 +48,9 @@ packageExtensions:
|
||||
react-simple-compat: 1.2.2
|
||||
react-compat-moveable@0.18.0:
|
||||
dependencies:
|
||||
"@egjs/agent": ^2.2.1
|
||||
"@egjs/children-differ": ^1.0.1
|
||||
"@scena/matrix": 1.1.1
|
||||
'@egjs/agent': ^2.2.1
|
||||
'@egjs/children-differ': ^1.0.1
|
||||
'@scena/matrix': 1.1.1
|
||||
css-to-mat: ^1.0.3
|
||||
gesto: ^1.9.0
|
||||
overlap-area: ^1.0.0
|
||||
@@ -65,17 +62,20 @@ packageExtensions:
|
||||
webpack: 4.41.5
|
||||
react-icons@2.2.7:
|
||||
peerDependencies:
|
||||
prop-types: "*"
|
||||
prop-types: '*'
|
||||
react-resizable@3.0.4:
|
||||
peerDependencies:
|
||||
react-dom: 17.0.1
|
||||
'@npmcli/run-script@4.1.3':
|
||||
dependencies:
|
||||
which: ^2.0.2
|
||||
|
||||
plugins:
|
||||
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
|
||||
spec: "@yarnpkg/plugin-typescript"
|
||||
spec: '@yarnpkg/plugin-typescript'
|
||||
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
|
||||
spec: "@yarnpkg/plugin-interactive-tools"
|
||||
spec: '@yarnpkg/plugin-interactive-tools'
|
||||
- path: .yarn/plugins/@yarnpkg/plugin-outdated.cjs
|
||||
spec: "https://mskelton.dev/yarn-outdated/v2"
|
||||
spec: 'https://mskelton.dev/yarn-outdated/v2'
|
||||
|
||||
yarnPath: .yarn/releases/yarn-3.2.3.cjs
|
||||
yarnPath: .yarn/releases/yarn-3.2.2.cjs
|
||||
|
||||
26
CHANGELOG.md
26
CHANGELOG.md
@@ -418,18 +418,6 @@ In Prometheus, browser access mode was deprecated in Grafana 7.4.0 and removed i
|
||||
- **Grafana/UI:** Add ColorPickerInput component. [#52222](https://github.com/grafana/grafana/pull/52222), [@Clarity-89](https://github.com/Clarity-89)
|
||||
- **Plugins:** Validate root URLs when signing private plugins via grafana-toolkit. [#51968](https://github.com/grafana/grafana/pull/51968), [@wbrowne](https://github.com/wbrowne)
|
||||
|
||||
<!-- 9.0.9 START -->
|
||||
|
||||
# 9.0.9 (2022-09-20)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- **AngularPanels:** Fixing changing angular panel options not taking having affect when coming back from panel edit. [#54834](https://github.com/grafana/grafana/pull/54834), [@grafanabot](https://github.com/grafanabot)
|
||||
- **AuthNZ:** Security fixes for CVE-2022-35957 and CVE-2022-36062. [#55498](https://github.com/grafana/grafana/pull/55498), [@IevaVasiljeva](https://github.com/IevaVasiljeva)
|
||||
- **FIX:** RBAC prevents deleting empty snapshots (#54385). [#54509](https://github.com/grafana/grafana/pull/54509), [@gamab](https://github.com/gamab)
|
||||
|
||||
<!-- 9.0.9 END -->
|
||||
|
||||
<!-- 9.0.8 START -->
|
||||
|
||||
# 9.0.8 (2022-08-30)
|
||||
@@ -1162,20 +1150,6 @@ In the Loki data source, for consistency and performance reasons, we changed how
|
||||
|
||||
The dependency to [grafana/aws-sdk](https://github.com/grafana/grafana-aws-sdk-react) is moved from [grafana/ui](https://github.com/grafana/grafana/blob/main/packages/grafana-ui/package.json) to the plugin. This means that any plugin that use SIGV4 auth need to pass a SIGV4 editor component as a prop to the `DataSourceHttpSettings` component. Issue [#43559](https://github.com/grafana/grafana/issues/43559)
|
||||
|
||||
<!-- 8.5.13 START -->
|
||||
|
||||
# 8.5.13 (2022-09-20)
|
||||
|
||||
### Features and enhancements
|
||||
|
||||
- **Plugins:** Expose @emotion/react to plugins to prevent load failures. [#55297](https://github.com/grafana/grafana/pull/55297), [@jackw](https://github.com/jackw)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- **AuthNZ:** Security fixes for CVE-2022-35957 and CVE-2022-36062. [#55495](https://github.com/grafana/grafana/pull/55495), [@IevaVasiljeva](https://github.com/IevaVasiljeva)
|
||||
|
||||
<!-- 8.5.13 END -->
|
||||
|
||||
<!-- 8.5.11 START -->
|
||||
|
||||
# 8.5.11 (2022-08-30)
|
||||
|
||||
@@ -21,8 +21,6 @@ pkg/coremodel/
|
||||
pkg/framework/coremodel/
|
||||
grafana-mixin/
|
||||
cue/
|
||||
public/img/icons/solid/
|
||||
public/img/icons/unicons/
|
||||
```
|
||||
|
||||
The following directories and their subdirectories are licensed under their original upstream licenses:
|
||||
|
||||
17
Makefile
17
Makefile
@@ -42,27 +42,22 @@ $(MERGED_SPEC_TARGET): $(SPEC_TARGET) $(NGALERT_SPEC_TARGET) $(SWAGGER) ## Merge
|
||||
# known conflicts DsPermissionType, AddApiKeyCommand, Json, Duration (identical models referenced by both specs)
|
||||
$(SWAGGER) mixin $(SPEC_TARGET) $(NGALERT_SPEC_TARGET) --ignore-conflicts -o $(MERGED_SPEC_TARGET)
|
||||
|
||||
$(SPEC_TARGET): $(SWAGGER) ## Generate API Swagger specification
|
||||
SWAGGER_GENERATE_EXTENSION=false $(SWAGGER) generate spec -m -w pkg/server -o $(SPEC_TARGET) \
|
||||
--swagger-api-spec: $(SWAGGER) ## Generate API Swagger specification
|
||||
SWAGGER_GENERATE_EXTENSION=false $(SWAGGER) generate spec -m -w pkg/server -o public/api-spec.json \
|
||||
-x "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" \
|
||||
-x "github.com/prometheus/alertmanager" \
|
||||
-i pkg/api/swagger_tags.json
|
||||
|
||||
swagger-api-spec: gen-go $(SPEC_TARGET) $(MERGED_SPEC_TARGET) validate-api-spec
|
||||
swagger-api-spec: gen-go --swagger-api-spec $(MERGED_SPEC_TARGET) validate-api-spec
|
||||
|
||||
validate-api-spec: $(MERGED_SPEC_TARGET) $(SWAGGER) ## Validate API spec
|
||||
$(SWAGGER) validate $(<)
|
||||
|
||||
clean-api-spec:
|
||||
rm $(SPEC_TARGET) $(MERGED_SPEC_TARGET) $(OAPI_SPEC_TARGET)
|
||||
|
||||
##@ OpenAPI 3
|
||||
OAPI_SPEC_TARGET = public/openapi3.json
|
||||
|
||||
openapi3-gen: swagger-api-spec ## Generates OpenApi 3 specs from the Swagger 2 already generated
|
||||
$(GO) run scripts/openapi3/openapi3conv.go $(MERGED_SPEC_TARGET) $(OAPI_SPEC_TARGET)
|
||||
rm $(SPEC_TARGET) $(MERGED_SPEC_TARGET)
|
||||
|
||||
##@ Building
|
||||
|
||||
gen-cue: ## Do all CUE/Thema code generation
|
||||
@echo "generate code from .cue files"
|
||||
go generate ./pkg/framework/coremodel
|
||||
@@ -158,7 +153,7 @@ build-docker-full-ubuntu: ## Build Docker image based on Ubuntu for development.
|
||||
##@ Services
|
||||
|
||||
# create docker-compose file with provided sources and start them
|
||||
# example: make devenv sources=postgres,auth/openldap
|
||||
# example: make devenv sources=postgres,openldap
|
||||
ifeq ($(sources),)
|
||||
devenv:
|
||||
@printf 'You have to define sources for this command \nexample: make devenv sources=postgres,openldap\n'
|
||||
|
||||
38
api-extractor.json
Normal file
38
api-extractor.json
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
||||
"mainEntryPointFilePath": "<projectFolder>/dist/index.d.ts",
|
||||
"bundledPackages": [],
|
||||
"compiler": {},
|
||||
"apiReport": {
|
||||
"enabled": false
|
||||
},
|
||||
"docModel": {
|
||||
"enabled": true,
|
||||
"apiJsonFilePath": "<projectFolder>/../../reports/docs/<unscopedPackageName>.api.json"
|
||||
},
|
||||
"dtsRollup": {
|
||||
"enabled": false
|
||||
},
|
||||
"tsdocMetadata": {},
|
||||
"messages": {
|
||||
"compilerMessageReporting": {
|
||||
"default": {
|
||||
"logLevel": "warning"
|
||||
}
|
||||
},
|
||||
"extractorMessageReporting": {
|
||||
"default": {
|
||||
"logLevel": "warning"
|
||||
},
|
||||
"ae-internal-missing-underscore": {
|
||||
"logLevel": "none",
|
||||
"addToApiReportFile": false
|
||||
}
|
||||
},
|
||||
"tsdocMessageReporting": {
|
||||
"default": {
|
||||
"logLevel": "warning"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -210,10 +210,7 @@ check_for_updates = true
|
||||
check_for_plugin_updates = true
|
||||
|
||||
# Google Analytics universal tracking code, only enabled if you specify an id here
|
||||
google_analytics_ua_id =
|
||||
|
||||
# Google Analytics 4 tracking code, only enabled if you specify an id here
|
||||
google_analytics_4_id =
|
||||
google_analytics_ua_id =
|
||||
|
||||
# Google Tag Manager ID, only enabled if you specify an id here
|
||||
google_tag_manager_id =
|
||||
@@ -250,9 +247,6 @@ admin_user = admin
|
||||
# default admin password, can be changed before first start of grafana, or in profile settings
|
||||
admin_password = admin
|
||||
|
||||
# default admin email, created on startup
|
||||
admin_email = admin@localhost
|
||||
|
||||
# used for signing
|
||||
secret_key = SW2YcwTIb9zpOOhoPsMm
|
||||
|
||||
@@ -622,10 +616,7 @@ jwk_set_file =
|
||||
cache_ttl = 60m
|
||||
expected_claims = {}
|
||||
key_file =
|
||||
role_attribute_path =
|
||||
role_attribute_strict = false
|
||||
auto_sign_up = false
|
||||
allow_assign_grafana_admin = false
|
||||
|
||||
#################################### Auth LDAP ###########################
|
||||
[auth.ldap]
|
||||
@@ -669,7 +660,7 @@ managed_identity_client_id =
|
||||
|
||||
#################################### Role-based Access Control ###########
|
||||
[rbac]
|
||||
# If enabled, cache permissions in a in memory cache
|
||||
# If enabled, cache permissions in a in memory cache (Enterprise only)
|
||||
permission_cache = true
|
||||
|
||||
#################################### SMTP / Emailing #####################
|
||||
@@ -945,10 +936,6 @@ max_annotations_to_keep =
|
||||
# Configures the batch size for the annotation clean-up job. This setting is used for dashboard, API, and alert annotations.
|
||||
cleanupjob_batchsize = 100
|
||||
|
||||
# Enforces the maximum allowed length of the tags for any newly introduced annotations. It can be between 500 and 4096 inclusive (which is the respective's column length). Default value is 500.
|
||||
# Setting it to a higher value would impact performance therefore is not recommended.
|
||||
tags_length = 500
|
||||
|
||||
[annotations.dashboard]
|
||||
# Dashboard annotations means that annotations are associated with the dashboard they are created on.
|
||||
|
||||
@@ -1046,11 +1033,6 @@ zipkin_propagation = false
|
||||
# Not disabling is the most common setting when using Zipkin elsewhere in your infrastructure.
|
||||
disable_shared_zipkin_spans = false
|
||||
|
||||
[tracing.opentelemetry]
|
||||
|
||||
# attributes that will always be included in when creating new spans. ex (key1:value1,key2:value2)
|
||||
custom_attributes =
|
||||
|
||||
[tracing.opentelemetry.jaeger]
|
||||
# jaeger destination (ex http://localhost:14268/api/traces)
|
||||
address =
|
||||
@@ -1235,7 +1217,7 @@ lokiQueryBuilder = true
|
||||
# Experimental Explore to Dashboard workflow
|
||||
explore2Dashboard = true
|
||||
|
||||
# Command Palette
|
||||
# Experimental Command Palette
|
||||
commandPalette = true
|
||||
|
||||
# Use dynamic labels in CloudWatch datasource
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
# # <string, required> action allowed.
|
||||
# - action: 'users:read'
|
||||
# #<string> scope it applies to.
|
||||
# scope: 'global.users:*'
|
||||
# scope: 'users:*'
|
||||
# - action: 'users:write'
|
||||
# scope: 'global.users:*'
|
||||
# scope: 'users:*'
|
||||
# - action: 'users:create'
|
||||
# - name: 'custom:global:users:reader'
|
||||
# # <bool> overwrite org id and creates a global role.
|
||||
@@ -42,9 +42,9 @@
|
||||
# # <list> list of the permissions to add/remove on top of the copied ones.
|
||||
# permissions:
|
||||
# - action: 'users:read'
|
||||
# scope: 'global.users:*'
|
||||
# scope: 'users:*'
|
||||
# - action: 'users:write'
|
||||
# scope: 'global.users:*'
|
||||
# scope: 'users:*'
|
||||
# # <string> state of the permission. Defaults to 'present'. If 'absent', the permission will be removed.
|
||||
# state: absent
|
||||
|
||||
|
||||
@@ -218,9 +218,6 @@
|
||||
# Google Analytics universal tracking code, only enabled if you specify an id here
|
||||
;google_analytics_ua_id =
|
||||
|
||||
# Google Analytics 4 tracking code, only enabled if you specify an id here
|
||||
;google_analytics_4_id =
|
||||
|
||||
# Google Tag Manager ID, only enabled if you specify an id here
|
||||
;google_tag_manager_id =
|
||||
|
||||
@@ -250,9 +247,6 @@
|
||||
# default admin password, can be changed before first start of grafana, or in profile settings
|
||||
;admin_password = admin
|
||||
|
||||
# default admin email, created on startup
|
||||
;admin_email = admin@localhost
|
||||
|
||||
# used for signing
|
||||
;secret_key = SW2YcwTIb9zpOOhoPsMm
|
||||
|
||||
@@ -612,11 +606,8 @@
|
||||
;cache_ttl = 60m
|
||||
;expected_claims = {"aud": ["foo", "bar"]}
|
||||
;key_file = /path/to/key/file
|
||||
;role_attribute_path =
|
||||
;role_attribute_strict = false
|
||||
;auto_sign_up = false
|
||||
;url_login = false
|
||||
;allow_assign_grafana_admin = false
|
||||
|
||||
#################################### Auth LDAP ##########################
|
||||
[auth.ldap]
|
||||
@@ -914,10 +905,6 @@
|
||||
# Configures the batch size for the annotation clean-up job. This setting is used for dashboard, API, and alert annotations.
|
||||
;cleanupjob_batchsize = 100
|
||||
|
||||
# Enforces the maximum allowed length of the tags for any newly introduced annotations. It can be between 500 and 4096 inclusive (which is the respective's column length). Default value is 500.
|
||||
# Setting it to a higher value would impact performance therefore is not recommended.
|
||||
;tags_length = 500
|
||||
|
||||
[annotations.dashboard]
|
||||
# Dashboard annotations means that annotations are associated with the dashboard they are created on.
|
||||
|
||||
@@ -1015,10 +1002,6 @@
|
||||
# Not disabling is the most common setting when using Zipkin elsewhere in your infrastructure.
|
||||
;disable_shared_zipkin_spans = false
|
||||
|
||||
[tracing.opentelemetry]
|
||||
# attributes that will always be included in when creating new spans. ex (key1:value1,key2:value2)
|
||||
;custom_attributes = key1:value1,key2:value2
|
||||
|
||||
[tracing.opentelemetry.jaeger]
|
||||
# jaeger destination (ex http://localhost:14268/api/traces)
|
||||
; address = http://localhost:14268/api/traces
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Data requests
|
||||
|
||||
[BackendSrv](https://github.com/grafana/grafana/blob/main/packages/grafana-runtime/src/services/backendSrv.ts) handles all outgoing HTTP requests from Grafana. This document explains the high-level concepts used by `BackendSrv`.
|
||||
[BackendSrv](https://grafana.com/docs/grafana/latest/packages_api/runtime/backendsrv) handles all outgoing HTTP requests from Grafana. This document explains the high-level concepts used by `BackendSrv`.
|
||||
|
||||
## Canceling requests
|
||||
|
||||
@@ -14,7 +14,7 @@ Grafana uses a concept called _request cancellation_ to cancel any ongoing reque
|
||||
|
||||
#### Before Grafana 7.2
|
||||
|
||||
Before Grafana can cancel any data request, it has to identify that request. Grafana identifies a request using the property `requestId` [passed as options](https://github.com/grafana/grafana/blob/main/packages/grafana-runtime/src/services/backendSrv.ts#L47) when you use [BackendSrv](https://github.com/grafana/grafana/blob/main/packages/grafana-runtime/src/services/backendSrv.ts).
|
||||
Before Grafana can cancel any data request, it has to identify that request. Grafana identifies a request using the property `requestId` [passed as options](https://github.com/grafana/grafana/blob/main/docs/sources/packages_api/runtime/backendsrvrequest.md) when you use [BackendSrv](https://grafana.com/docs/grafana/latest/packages_api/runtime/backendsrv).
|
||||
|
||||
The cancellation logic is as follows:
|
||||
|
||||
@@ -23,7 +23,7 @@ The cancellation logic is as follows:
|
||||
|
||||
#### After Grafana 7.2
|
||||
|
||||
Grafana 7.2 introduced an additional way of canceling requests using [RxJs](https://github.com/ReactiveX/rxjs). To support the new cancellation functionality, the data source needs to use the new `fetch` function in [BackendSrv](https://github.com/grafana/grafana/blob/main/packages/grafana-runtime/src/services/backendSrv.ts).
|
||||
Grafana 7.2 introduced an additional way of canceling requests using [RxJs](https://github.com/ReactiveX/rxjs). To support the new cancellation functionality, the data source needs to use the new `fetch` function in [BackendSrv](https://grafana.com/docs/grafana/latest/packages_api/runtime/backendsrv).
|
||||
|
||||
Migrating the core data sources to the new `fetch` function [is an ongoing process that you can read about in this issue.](https://github.com/grafana/grafana/issues/27222)
|
||||
|
||||
|
||||
@@ -55,9 +55,16 @@ Pull requests that create new UI components or modify existing ones must adhere
|
||||
- Use the [Grafana theme palette](/contribute/style-guides/themes.md) for styling. It contains colors with good contrast which aids accessibility.
|
||||
- Use [RTL](https://testing-library.com/docs/dom-testing-library/api-accessibility/) for writing unit tests. It helps to create accessible components.
|
||||
|
||||
### Accessibility-specific guidelines
|
||||
Pull requests that introduce accessibility(a11y) errors:
|
||||
|
||||
Pull requests that introduce accessibility(a11y) errors - please refer to the [accessibility guidelines](/contribute/style-guides/accessibility.md).
|
||||
We use [pa11y-ci](https://github.com/pa11y/pa11y-ci) to collect accessibility errors on [some URLs on the project](https://github.com/grafana/grafana/issues/36555), threshold errors are specified per URL.
|
||||
|
||||
If the contribution introduces new a11y errors, our continuous integration will fail, preventing you to merge on the main branch. In those cases there are two alternatives for moving forward:
|
||||
|
||||
- Check the error log on the pipeline step `test-a11y-frontend-pr`, identify what was the error, and fix it.
|
||||
- Locally run the command `yarn test:accessibility-report` that generates an HTML accessibility report, then go to the URL that contains your change, identify the error, and fix it. Keep in mind, a local e2e Grafana instance is going to be running on `http://localhost:3001`.
|
||||
|
||||
You can also prevent introducing a11y errors by installing an a11y plugin in your browser, for example, axe DevTools, Accessibility Insights for Web among others.
|
||||
|
||||
### Betterer
|
||||
|
||||
|
||||
@@ -1,276 +0,0 @@
|
||||
# Instrumenting Grafana
|
||||
|
||||
Guidance, conventions and best practices for instrumenting Grafana using logs, metrics and traces.
|
||||
|
||||
## Logs
|
||||
|
||||
Logs are files that record events, warnings and errors as they occur within a software environment. Most logs include contextual information, such as the time an event occurred and which user or endpoint was associated with it.
|
||||
|
||||
### Usage
|
||||
|
||||
Use the _pkg/infra/log_ package to create a named structured logger. Example:
|
||||
|
||||
```go
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
)
|
||||
|
||||
logger := log.New("my-logger")
|
||||
logger.Debug("Debug msg")
|
||||
logger.Info("Info msg")
|
||||
logger.Warning("Warning msg")
|
||||
logger.Error("Error msg", "error", fmt.Errorf("BOOM"))
|
||||
```
|
||||
|
||||
### Naming conventions
|
||||
|
||||
Name the logger using lowercase characters, e.g. `log.New("my-logger")` using snake_case or kebab-case styling.
|
||||
|
||||
Prefix the logger name with an area name when using different loggers across a feature or related packages, e.g. `log.New("plugin.loader")` and `log.New("plugin.client")`.
|
||||
|
||||
Start the log message with a capital letter, e.g. `logger.Info("Hello world")` instead of `logger.Info("hello world")`. The log message should be an identifier for the log entry, avoid parameterization in favor of key-value pairs for additional data.
|
||||
|
||||
Prefer using camelCase style when naming log keys, e.g. _remoteAddr_, to be consistent with Go identifiers.
|
||||
|
||||
Use the key _error_ when logging Go errors, e.g. `logger.Error("Something failed", "error", fmt.Errorf("BOOM"))`.
|
||||
|
||||
### Validate and sanitize input coming from user input
|
||||
|
||||
If log messages or key/value pairs originates from user input they **should** be validated and sanitized.
|
||||
|
||||
Be **careful** to not expose any sensitive information in log messages e.g. secrets, credentials etc. It's especially easy to do by mistake when including a struct as value.
|
||||
|
||||
### Log levels
|
||||
|
||||
When to use which log level?
|
||||
|
||||
- **Debug:** Informational messages of high frequency and/or less-important messages during normal operations.
|
||||
- **Info:** Informational messages of low frequency and/or important messages.
|
||||
- **Warning:** Should in normal cases not be used/needed. If used should be actionable.
|
||||
- **Error:** Error messages indicating some operation failed (with an error) and the program didn't have a way of handle the error.
|
||||
|
||||
### Contextual logging
|
||||
|
||||
Use a contextual logger to include additional key/value pairs attached to `context.Context`, e.g. `traceID`, to allow correlating logs with traces and/or correlate logs with a common identifier.
|
||||
|
||||
Example:
|
||||
|
||||
```go
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
)
|
||||
|
||||
var logger = log.New("my-logger")
|
||||
|
||||
func doSomething(ctx context.Context) {
|
||||
ctxLogger := logger.FromContext(ctx)
|
||||
ctxLogger.Debug("Debug msg")
|
||||
ctxLogger.Info("Info msg")
|
||||
ctxLogger.Warning("Warning msg")
|
||||
ctxLogger.Error("Error msg", "error", fmt.Errorf("BOOM"))
|
||||
}
|
||||
```
|
||||
|
||||
### Enable certain log levels for certain loggers
|
||||
|
||||
During development it's convenient to enable certain log level, e.g. debug, for certain loggers to minimize the generated log output and make it easier to find things. See [[log.filters]](https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#filters) for information how to configure this.
|
||||
|
||||
It's also possible to configure multiple loggers:
|
||||
|
||||
```ini
|
||||
[log]
|
||||
filters = rendering:debug \
|
||||
; alerting.notifier:debug \
|
||||
oauth.generic_oauth:debug \
|
||||
; oauth.okta:debug \
|
||||
; tsdb.postgres:debug \
|
||||
; tsdb.mssql:debug \
|
||||
; provisioning.plugins:debug \
|
||||
; provisioning:debug \
|
||||
; provisioning.dashboard:debug \
|
||||
; provisioning.datasources:debug \
|
||||
datasources:debug \
|
||||
data-proxy-log:debug
|
||||
```
|
||||
|
||||
## Metrics
|
||||
|
||||
Metrics are quantifiable measurements that reflect the health and performance of applications or infrastructure.
|
||||
|
||||
Consider using metrics to provide real-time insight into the state of resources. If you want to know how responsive your application is or identify anomalies that could be early signs of a performance issue, metrics are a key source of visibility.
|
||||
|
||||
### Metric types
|
||||
|
||||
See [Prometheus metric types](https://prometheus.io/docs/concepts/metric_types/) for a list and description of the different metric types you can use and when to use them.
|
||||
|
||||
There are many possible types of metrics that can be tracked. One popular method for defining metrics is the [RED method](https://grafana.com/blog/2018/08/02/the-red-method-how-to-instrument-your-services/).
|
||||
|
||||
### Naming conventions
|
||||
|
||||
Use the namespace _grafana_ as that would prefix any defined metric names with `grafana_`. This will make it clear for operators that any metric named `grafana_*` belongs to Grafana.
|
||||
|
||||
Use snake*case style when naming metrics, e.g. \_http_request_duration_seconds* instead of _httpRequestDurationSeconds_.
|
||||
|
||||
Use snake*case style when naming labels, e.g. \_status_code* instead of _statusCode_.
|
||||
|
||||
If metric type is a _counter_, name it with a `_total` suffix, e.g. _http_requests_total_.
|
||||
|
||||
If metric type is a _histogram_ and you're measuring duration, name it with a `_<unit>` suffix, e.g. _http_request_duration_seconds_.
|
||||
|
||||
If metric type is a _gauge_, name it to denote it's a value that can increase and decrease , e.g. _http_request_in_flight_.
|
||||
|
||||
### Label values and high cardinality
|
||||
|
||||
Be careful with what label values you add/accept. Using/allowing too many label values could result in [high cardinality problems](https://grafana.com/blog/2022/02/15/what-are-cardinality-spikes-and-why-do-they-matter/).
|
||||
|
||||
If label values originates from user input they **should** be validated. Use `metricutil.SanitizeLabelName(<label value>`) from _pkg/infra/metrics/metricutil_ package to sanitize label names. Very **important** to only allow a pre-defined set of labels to minimize the risk of high cardinality problems.
|
||||
|
||||
Be **careful** to not expose any sensitive information in label values, e.g. secrets, credentials etc.
|
||||
|
||||
### Guarantee the existence of metrics
|
||||
|
||||
If you want to guarantee the existence of metrics before any observations has happened there's a couple of helper methods available in the _pkg/infra/metrics/metricutil_ package.
|
||||
|
||||
### How to collect and visualize metrics locally
|
||||
|
||||
1. Start Prometheus
|
||||
|
||||
```bash
|
||||
make devenv sources=prometheus
|
||||
```
|
||||
|
||||
2. Use Grafana Explore or dashboards to query any exported Grafana metrics
|
||||
|
||||
## Traces
|
||||
|
||||
A distributed trace is data that tracks an application request as it flows through the various parts of an application. The trace records how long it takes each application component to process the request and pass the result to the next component. Traces can also identify which parts of the application trigger an error.
|
||||
|
||||
### Usage
|
||||
|
||||
Grafana currently supports two tracing implementations, [OpenTelemetry](https://opentelemetry.io/) and [OpenTracing](https://opentracing.io/). OpenTracing is deprecated, but still supported until we remove it. The two different implementations implements the `Tracer` and `Span` interfaces, defined in the _pkg/infra/tracing_ package, which you can use to create traces and spans. To get a hold of a `Tracer` you would need to get it injected as dependency into your service, see [Services](../../architecture/backend/services.md) for more details.
|
||||
|
||||
Example:
|
||||
|
||||
```go
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/tracing"
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
)
|
||||
|
||||
type MyService struct {
|
||||
tracer tracing.Tracer
|
||||
}
|
||||
|
||||
func ProvideService(tracer tracing.Tracer) *MyService {
|
||||
return &MyService{
|
||||
tracer: tracer,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *MyService) Hello(ctx context.Context, name string) (string, error) {
|
||||
ctx, span := s.tracer.Start(ctx, "MyService.Hello")
|
||||
// this make sure the span is marked as finished when this
|
||||
// method ends to allow the span to be flushed and sent to
|
||||
// storage backend.
|
||||
defer span.End()
|
||||
|
||||
// Add some event to show Events usage
|
||||
span.AddEvents(
|
||||
[]string{"message"},
|
||||
[]tracing.EventValue{
|
||||
{Str: "checking name..."},
|
||||
})
|
||||
|
||||
if name == "" {
|
||||
err := fmt.Errorf("name cannot be empty")
|
||||
|
||||
// record err as an exception span event for this span
|
||||
span.RecordError(err)
|
||||
return "", err
|
||||
}
|
||||
|
||||
// Add some other event to show Events usage
|
||||
span.AddEvents(
|
||||
[]string{"message"},
|
||||
[]tracing.EventValue{
|
||||
{Str: "name checked"},
|
||||
})
|
||||
|
||||
// Add attribute to show Attributes usage
|
||||
span.SetAttributes("my_service.name", name, attribute.Key("my_service.name").String(name))
|
||||
|
||||
return fmt.Sprintf("Hello %s", name), nil
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
### Naming conventions
|
||||
|
||||
Span names should follow the [guidelines from OpenTelemetry](https://opentelemetry.io/docs/reference/specification/trace/api/#span).
|
||||
|
||||
| Span Name | Guidance |
|
||||
| ----------------------- | -------------------------------------------------------- |
|
||||
| get | Too general |
|
||||
| get_account/42 | Too specific |
|
||||
| get_account | Good, and account_id=42 would make a nice Span attribute |
|
||||
| get_account/{accountId} | Also good (using the “HTTP route”) |
|
||||
|
||||
Span attribute and span event attributes should follow the [Attribute naming specification from OpenTelemetry](https://opentelemetry.io/docs/reference/specification/common/attribute-naming/). Good attribute key examples:
|
||||
|
||||
- service.version
|
||||
- http.status_code
|
||||
|
||||
See [Trace semantic conventions from OpenTelemetry](https://opentelemetry.io/docs/reference/specification/trace/semantic_conventions/) for additional conventions regarding well-known protocols and operations.
|
||||
|
||||
### Span names and high cardinality
|
||||
|
||||
Be careful with what span names you add/accept. Using/allowing too many span names could result in high cardinality problems.
|
||||
|
||||
### Validate and sanitize input coming from user input
|
||||
|
||||
If span names, attribute or event values originates from user input they **should** be validated and sanitized. It's very **important** to only allow a pre-defined set of span names to minimize the risk of high cardinality problems.
|
||||
|
||||
Be **careful** to not expose any sensitive information in span names, attribute or event values, e.g. secrets, credentials etc.
|
||||
|
||||
### How to collect, visualize and query traces (and correlate logs with traces) locally
|
||||
|
||||
1. Start Jaeger
|
||||
|
||||
```bash
|
||||
make devenv sources=jaeger
|
||||
```
|
||||
|
||||
2. Enable tracing in Grafana
|
||||
|
||||
opentelemetry tracing (recommended):
|
||||
|
||||
```ini
|
||||
[tracing.opentelemetry.jaeger]
|
||||
address = http://localhost:14268/api/traces
|
||||
```
|
||||
|
||||
opentracing tracing (deprecated/not recommended):
|
||||
|
||||
```ini
|
||||
[tracing.jaeger]
|
||||
address = localhost:6831
|
||||
```
|
||||
|
||||
3. Search/browse collected logs and traces in Grafana Explore
|
||||
|
||||
You need provisioned gdev-jaeger and gdev-loki datasources, see [developer dashboard and data sources](https://github.com/grafana/grafana/tree/main/devenv#developer-dashboards-and-data-sources) for setup instructions.
|
||||
|
||||
Open Grafana explore and select gdev-loki datasource and use the query `{filename="/var/log/grafana/grafana.log"} | logfmt`.
|
||||
|
||||
You can then inspect any log message that includes a `traceID` and from there click on `gdev-jaeger` to split view and inspect the trace in question.
|
||||
|
||||
4. Search/browse collected traces in Jaeger UI
|
||||
|
||||
You can open http://localhost:16686 to use the Jaeger UI for browsing and searching traces.
|
||||
@@ -1,77 +0,0 @@
|
||||
# Accessibility at Grafana
|
||||
|
||||
At Grafana we pay special attention to accessibility and that's why it's important that all components are written with it in
|
||||
mind.
|
||||
|
||||
The goal of this document is to list best practices and recommendations when it comes to writing accessible components.
|
||||
|
||||
### grafana/ui components
|
||||
|
||||
Some grafana/ui components have specific mechanisms built-in that make it easier to write accessible components.
|
||||
|
||||
#### Form elements
|
||||
|
||||
One of the important accessibility considerations when working with form elements is to make sure form controls are
|
||||
properly labelled. For that a `label` element has to be associated with the respective form control. One way to
|
||||
do that is to provide `for` attribute to the label that matches the `id` attribute of the form control.
|
||||
|
||||
The form components from grafana/ui provide an easier way to achieve that. The form elements, used inside `Field`
|
||||
components, will get the `label` properly associated with them given that the element has `id` (in case of `Select` the prop is `inputId`) specified.
|
||||
|
||||
As an example, this code
|
||||
|
||||
```tsx
|
||||
<Field label="Name">
|
||||
<Input id="name" placeholder="Enter a name" />
|
||||
</Field>
|
||||
```
|
||||
|
||||
will be rendered as (simplified)
|
||||
|
||||
```html
|
||||
<div>
|
||||
<label for="name"> Name </label>
|
||||
<input name="name" type="text" id="name" placeholder="Enter a name" value="" />
|
||||
</div>
|
||||
```
|
||||
|
||||
As long as the form element has a unique `id` attribute specified, it will be automatically accessible when rendered.
|
||||
|
||||
### Writing tests with accessibility in mind
|
||||
|
||||
We use [React Testing Library](https://testing-library.com/docs/react-testing-library/intro) (RTL) for writing unit tests.
|
||||
The library is built with accessibility in mind and makes it easier to ensure the written code is accessible to all users.
|
||||
When querying DOM elements with RTL prefer using `*ByRole` queries as they resemble closely how the users interact
|
||||
with the page - both using mouse/visual display and assistive technologies.
|
||||
As a rule of thumb, if code is written with the accessibility concerns in
|
||||
mind, `*ByRole` queries will be sufficient in most of the cases. There are certainly exceptions here, as not all the elements have defined [ARIA role](https://www.w3.org/TR/html-aria/#docconformance).
|
||||
|
||||
As an example, for this code
|
||||
|
||||
```tsx
|
||||
<Field label="Username">
|
||||
<Input id="username" placeholder="Enter a name" value={'Test'} />
|
||||
</Field>
|
||||
```
|
||||
|
||||
the test could case be as follows
|
||||
|
||||
```tsx
|
||||
it('has username set', () => {
|
||||
expect(screen.getByRole('textbox', { name: 'Username' })).toHaveValue('Test');
|
||||
});
|
||||
```
|
||||
|
||||
Input with type `text` (default type value) has a role of `textbox` and the `name` option is not the name attribute
|
||||
given to the input elements but their [accessible name](https://www.tpgi.com/what-is-an-accessible-name/), which in this case is the text content of the associated with input label.
|
||||
|
||||
### Pull requests that introduce accessibility(a11y) errors:
|
||||
|
||||
We use [pa11y-ci](https://github.com/pa11y/pa11y-ci) to collect accessibility errors on [some URLs in the project](https://github.com/grafana/grafana/issues/36555), threshold errors are specified per URL.
|
||||
|
||||
If the contribution introduces new a11y errors, our continuous integration will fail, preventing you to merge to the main branch. In those cases there are two alternatives for moving forward:
|
||||
|
||||
- Check the error log on the pipeline step `test-a11y-frontend-pr`, identify what was the error, and fix it.
|
||||
- Locally run the command `yarn test:accessibility-report` that generates an HTML accessibility report, then go to the URL that contains your change, identify the error, and fix it. Keep in mind, a local e2e Grafana instance is going to be running on `http://localhost:3001`.
|
||||
|
||||
You can also prevent introducing a11y errors by installing an a11y plugin in your browser, for example, axe DevTools, Accessibility Insights for Web among others.
|
||||
@@ -166,22 +166,17 @@ interface ModalState {
|
||||
##### Emotion class names
|
||||
|
||||
```typescript
|
||||
const getStyles = (theme: GrafanaTheme2) => ({
|
||||
const getStyles = = () => ({
|
||||
// bad
|
||||
ElementWrapper: css`...`,
|
||||
// bad
|
||||
['element-wrapper']: css`...`,
|
||||
["element-wrapper"]: css`...`,
|
||||
|
||||
// good
|
||||
elementWrapper: css({
|
||||
padding: theme.spacing(1, 2),
|
||||
background: theme.colors.background.secondary,
|
||||
}),
|
||||
elementWrapper: css`...`,
|
||||
});
|
||||
```
|
||||
|
||||
Use hook useStyles2(getStyles) to memoize the styles generation and try to avoid passing props to the the getStyles function and instead compose classes using emotion cx function.
|
||||
|
||||
#### Use `ALL_CAPS` for constants.
|
||||
|
||||
```typescript
|
||||
|
||||
@@ -4,9 +4,26 @@
|
||||
|
||||
## Usage
|
||||
|
||||
### Basic styling
|
||||
|
||||
For styling components, use [Emotion's `css` function](https://emotion.sh/docs/emotion#css).
|
||||
|
||||
### Basic styling
|
||||
```tsx
|
||||
import React from 'react';
|
||||
import { css } from '@emotion/css';
|
||||
|
||||
const ComponentA = () => (
|
||||
<div
|
||||
className={css`
|
||||
background: red;
|
||||
`}
|
||||
>
|
||||
As red as you can get
|
||||
</div>
|
||||
);
|
||||
```
|
||||
|
||||
### Styling with theme
|
||||
|
||||
To access the theme in your styles, use the `useStyles` hook. It provides basic memoization and access to the theme object.
|
||||
|
||||
@@ -14,35 +31,33 @@ To access the theme in your styles, use the `useStyles` hook. It provides basic
|
||||
|
||||
```tsx
|
||||
import React, { FC } from 'react';
|
||||
import { GrafanaTheme2 } from '@grafana/data';
|
||||
import { useStyles2 } from '@grafana/ui';
|
||||
import { GrafanaTheme } from '@grafana/data';
|
||||
import { useStyles } from '@grafana/ui';
|
||||
import { css } from '@emotion/css';
|
||||
|
||||
const Foo: FC<FooProps> = () => {
|
||||
const styles = useStyles2(getStyles);
|
||||
const styles = useStyles(getStyles);
|
||||
|
||||
// Use styles with classNames
|
||||
return <div className={styles}>...</div>;
|
||||
};
|
||||
|
||||
const getStyles = (theme: GrafanaTheme2) =>
|
||||
css({
|
||||
padding: theme.spacing(1, 2), // will result in 8px 16px padding
|
||||
});
|
||||
const getStyles = (theme: GrafanaTheme) => css`
|
||||
padding: ${theme.spacing.md};
|
||||
`;
|
||||
```
|
||||
|
||||
### Styling complex components
|
||||
|
||||
In more complex cases, especially when you need to style multiple DOM elements in one component, or when using styles that depend on properties and/or state you
|
||||
can have your getStyles function return an object with many class names and use [Emotion's `cx` function](https://emotion.sh/docs/emotion#cx) to compose them.
|
||||
In more complex cases, especially when you need to style multiple DOM elements in one component, or when using styles that depend on properties and/or state, you should create a helper function that returns an object of styles. This function should also be wrapped in the `stylesFactory` helper function, which will provide basic memoization.
|
||||
|
||||
Let's say you need to style a component that has a different background depending on the `isActive` property :
|
||||
|
||||
```tsx
|
||||
import React from 'react';
|
||||
import { css, cx } from '@emotion/css';
|
||||
import { GrafanaTheme2 } from '@grafana/data';
|
||||
import { useStyles2 } from '@grafana/ui';
|
||||
import { css } from '@emotion/css';
|
||||
import { GrafanaTheme } from '@grafana/data';
|
||||
import { selectThemeVariant, stylesFactory, useTheme } from '@grafana/ui';
|
||||
|
||||
interface ComponentAProps {
|
||||
isActive: boolean;
|
||||
@@ -50,10 +65,10 @@ interface ComponentAProps {
|
||||
|
||||
const ComponentA: React.FC<ComponentAProps> = ({ isActive }) => {
|
||||
const theme = useTheme();
|
||||
const styles = useStyles2(theme);
|
||||
const styles = getStyles(theme, isActive);
|
||||
|
||||
return (
|
||||
<div className={cx(styles.wrapper, isActive && styles.active)}>
|
||||
<div className={styles.wrapper}>
|
||||
As red as you can get
|
||||
<i className={styles.icon} />
|
||||
</div>
|
||||
@@ -61,20 +76,42 @@ const ComponentA: React.FC<ComponentAProps> = ({ isActive }) => {
|
||||
};
|
||||
|
||||
// Mind, that you can pass multiple arguments, theme included
|
||||
const getStyles = (theme: GrafanaTheme2) => {
|
||||
const getStyles = stylesFactory((theme: GrafanaTheme, isActive: boolean) => {
|
||||
const backgroundColor = isActive ? theme.colors.red : theme.colors.blue;
|
||||
|
||||
return {
|
||||
wrapper: css({
|
||||
background: theme.colors.background.secondary;
|
||||
}),
|
||||
active: css({
|
||||
background: theme.colors.primary.main,
|
||||
text: theme.colors.primary.contrastText,
|
||||
},
|
||||
icon: css({
|
||||
fontSize: theme.typography.bodySmall.fontSize;
|
||||
})
|
||||
wrapper: css`
|
||||
background: ${backgroundColor};
|
||||
`,
|
||||
icon: css`
|
||||
font-size: ${theme.typography.size.sm};
|
||||
`,
|
||||
};
|
||||
};
|
||||
});
|
||||
```
|
||||
|
||||
For more information about themes at Grafana please see the [themes guide](./themes.md).
|
||||
|
||||
### Composing class names
|
||||
|
||||
For class composition, use [Emotion's `cx` function](https://emotion.sh/docs/emotion#cx).
|
||||
|
||||
```tsx
|
||||
import React from 'react';
|
||||
import { css, cx } from '@emotion/css';
|
||||
|
||||
interface Props {
|
||||
className?: string;
|
||||
}
|
||||
|
||||
const ComponentA: React.FC<Props> = ({ className }) => {
|
||||
const finalClassName = cx(
|
||||
className,
|
||||
css`
|
||||
background: red;
|
||||
`
|
||||
);
|
||||
|
||||
return <div className={finalClassName}>As red as you can ge</div>;
|
||||
};
|
||||
```
|
||||
|
||||
10
crowdin.yml
10
crowdin.yml
@@ -1,10 +0,0 @@
|
||||
files:
|
||||
- source: /public/locales/en-US/messages.po
|
||||
translation: /public/locales/%locale%/%original_file_name%
|
||||
export_only_approved: true
|
||||
|
||||
pull_request_title: 'I18n: Crowdin sync'
|
||||
pull_request_labels:
|
||||
- area/internationalization
|
||||
- no-changelog
|
||||
- no-backport
|
||||
@@ -35,7 +35,7 @@ make devenv sources=influxdb,prometheus,elastic5
|
||||
Some of the blocks support dynamic change of the image version used in the Docker file. The signature looks like this:
|
||||
|
||||
```bash
|
||||
make devenv sources=postgres,auth/openldap,grafana postgres_version=9.2 grafana_version=6.7.0-beta1
|
||||
make devenv sources=postgres,openldap,grafana postgres_version=9.2 grafana_version=6.7.0-beta1
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -255,6 +255,7 @@ datasources:
|
||||
label: "Zipkin traces"
|
||||
description: "Related traces stored in Zipkin"
|
||||
jsonData:
|
||||
something: here
|
||||
manageAlerts: false
|
||||
derivedFields:
|
||||
- name: "traceID"
|
||||
@@ -284,5 +285,5 @@ datasources:
|
||||
type: tempo
|
||||
uid: gdev-tempo
|
||||
access: proxy
|
||||
url: http://localhost:3200
|
||||
url: http://localhost:3101
|
||||
editable: false
|
||||
|
||||
@@ -61,6 +61,96 @@ datasources:
|
||||
tsdbResolution: 1
|
||||
tsdbVersion: 1
|
||||
|
||||
- name: gdev-elasticsearch-v2-metrics
|
||||
type: elasticsearch
|
||||
access: proxy
|
||||
database: "[metrics-]YYYY.MM.DD"
|
||||
url: http://elasticsearch:9200
|
||||
jsonData:
|
||||
interval: Daily
|
||||
timeField: "@timestamp"
|
||||
esVersion: 2
|
||||
|
||||
- name: gdev-elasticsearch-v2-logs
|
||||
type: elasticsearch
|
||||
access: proxy
|
||||
database: "[logs-]YYYY.MM.DD"
|
||||
url: http://elasticsearch:9200
|
||||
jsonData:
|
||||
interval: Daily
|
||||
timeField: "@timestamp"
|
||||
esVersion: 2
|
||||
|
||||
- name: gdev-elasticsearch-v5-metrics
|
||||
type: elasticsearch
|
||||
access: proxy
|
||||
database: "[metrics-]YYYY.MM.DD"
|
||||
url: http://elasticsearch5:9200
|
||||
jsonData:
|
||||
interval: Daily
|
||||
timeField: "@timestamp"
|
||||
esVersion: 5
|
||||
|
||||
- name: gdev-elasticsearch-v5-logs
|
||||
type: elasticsearch
|
||||
access: proxy
|
||||
database: "[logs-]YYYY.MM.DD"
|
||||
url: http://elasticsearch5:9200
|
||||
jsonData:
|
||||
interval: Daily
|
||||
timeField: "@timestamp"
|
||||
esVersion: 5
|
||||
|
||||
- name: gdev-elasticsearch-v56-metrics
|
||||
type: elasticsearch
|
||||
access: proxy
|
||||
database: "[metrics-]YYYY.MM.DD"
|
||||
url: http://elasticsearch5:9200
|
||||
jsonData:
|
||||
interval: Daily
|
||||
timeField: "@timestamp"
|
||||
esVersion: 56
|
||||
|
||||
- name: gdev-elasticsearch-v56-logs
|
||||
type: elasticsearch
|
||||
access: proxy
|
||||
database: "[logs-]YYYY.MM.DD"
|
||||
url: http://elasticsearch5:9200
|
||||
jsonData:
|
||||
interval: Daily
|
||||
timeField: "@timestamp"
|
||||
esVersion: 56
|
||||
|
||||
- name: gdev-elasticsearch-v6-metrics
|
||||
type: elasticsearch
|
||||
access: proxy
|
||||
database: "[metrics-]YYYY.MM.DD"
|
||||
url: http://elasticsearch6:9200
|
||||
jsonData:
|
||||
interval: Daily
|
||||
timeField: "@timestamp"
|
||||
esVersion: 60
|
||||
|
||||
- name: gdev-elasticsearch-v6-logs
|
||||
type: elasticsearch
|
||||
access: proxy
|
||||
database: "[logs-]YYYY.MM.DD"
|
||||
url: http://elasticsearch6:9200
|
||||
jsonData:
|
||||
interval: Daily
|
||||
timeField: "@timestamp"
|
||||
esVersion: 60
|
||||
|
||||
- name: gdev-elasticsearch-v6-filebeat
|
||||
type: elasticsearch
|
||||
access: proxy
|
||||
database: "[filebeat-]YYYY.MM.DD"
|
||||
url: http://elasticsearch6:9200
|
||||
jsonData:
|
||||
interval: Daily
|
||||
timeField: "@timestamp"
|
||||
esVersion: 60
|
||||
|
||||
- name: gdev-elasticsearch-v7-metrics
|
||||
type: elasticsearch
|
||||
access: proxy
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
package dashboard_test
|
||||
package dev_dashboards
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io"
|
||||
"io/fs"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -17,12 +16,9 @@ import (
|
||||
)
|
||||
|
||||
func TestDevenvDashboardValidity(t *testing.T) {
|
||||
path, err := filepath.Abs("../../../devenv/dev-dashboards")
|
||||
m, err := themaTestableDashboards()
|
||||
require.NoError(t, err)
|
||||
|
||||
m, err := themaTestableDashboards(os.DirFS(path))
|
||||
require.NoError(t, err)
|
||||
cm, err := dashboard.New(cuectx.ProvideThemaLibrary())
|
||||
cm, err := dashboard.ProvideCoremodel(cuectx.ProvideThemaLibrary())
|
||||
require.NoError(t, err)
|
||||
|
||||
for path, b := range m {
|
||||
@@ -45,8 +41,9 @@ func TestDevenvDashboardValidity(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func themaTestableDashboards(in fs.FS) (map[string][]byte, error) {
|
||||
func themaTestableDashboards() (map[string][]byte, error) {
|
||||
m := make(map[string][]byte)
|
||||
in := DevDashboardFS
|
||||
|
||||
err := fs.WalkDir(in, ".", func(path string, d fs.DirEntry, err error) error {
|
||||
if err != nil {
|
||||
@@ -70,10 +67,7 @@ func themaTestableDashboards(in fs.FS) (map[string][]byte, error) {
|
||||
}
|
||||
|
||||
jtree := make(map[string]interface{})
|
||||
err = json.Unmarshal(b, &jtree)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
json.Unmarshal(b, &jtree)
|
||||
if oldschemav, has := jtree["schemaVersion"]; !has || !(oldschemav.(float64) > dashboard.HandoffSchemaVersion-1) {
|
||||
return nil
|
||||
}
|
||||
@@ -25,6 +25,7 @@
|
||||
"fiscalYearStartMonth": 0,
|
||||
"graphTooltip": 0,
|
||||
"id": 95,
|
||||
"iteration": 1652465568602,
|
||||
"links": [],
|
||||
"liveNow": false,
|
||||
"panels": [
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
"fiscalYearStartMonth": 0,
|
||||
"graphTooltip": 0,
|
||||
"id": 85,
|
||||
"iteration": 1652465607869,
|
||||
"links": [],
|
||||
"liveNow": false,
|
||||
"panels": [
|
||||
|
||||
@@ -49,7 +49,8 @@
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green"
|
||||
"color": "green",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
@@ -150,7 +151,8 @@
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green"
|
||||
"color": "green",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
@@ -236,7 +238,8 @@
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green"
|
||||
"color": "green",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
@@ -357,4 +360,4 @@
|
||||
"uid": "KVxZKdmVz",
|
||||
"version": 10,
|
||||
"weekStart": ""
|
||||
}
|
||||
}
|
||||
@@ -49,7 +49,8 @@
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green"
|
||||
"color": "green",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
@@ -151,7 +152,8 @@
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green"
|
||||
"color": "green",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
@@ -257,7 +259,8 @@
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green"
|
||||
"color": "green",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
@@ -355,7 +358,8 @@
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green"
|
||||
"color": "green",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
@@ -470,4 +474,4 @@
|
||||
"uid": "2xuwrgV7z",
|
||||
"version": 4,
|
||||
"weekStart": ""
|
||||
}
|
||||
}
|
||||
@@ -3414,7 +3414,8 @@
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green"
|
||||
"color": "green",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
@@ -3488,4 +3489,4 @@
|
||||
"uid": "1KxMUdE7k",
|
||||
"version": 5,
|
||||
"weekStart": ""
|
||||
}
|
||||
}
|
||||
@@ -1,631 +0,0 @@
|
||||
{
|
||||
"annotations": {
|
||||
"list": [
|
||||
{
|
||||
"builtIn": 1,
|
||||
"datasource": {
|
||||
"type": "grafana",
|
||||
"uid": "-- Grafana --"
|
||||
},
|
||||
"enable": true,
|
||||
"hide": true,
|
||||
"iconColor": "rgba(0, 211, 255, 1)",
|
||||
"name": "Annotations & Alerts",
|
||||
"target": {
|
||||
"limit": 100,
|
||||
"matchAny": false,
|
||||
"tags": [],
|
||||
"type": "dashboard"
|
||||
},
|
||||
"type": "dashboard"
|
||||
}
|
||||
]
|
||||
},
|
||||
"editable": true,
|
||||
"fiscalYearStartMonth": 0,
|
||||
"graphTooltip": 0,
|
||||
"id": 1351,
|
||||
"links": [],
|
||||
"liveNow": false,
|
||||
"panels": [
|
||||
{
|
||||
"collapsed": false,
|
||||
"gridPos": {
|
||||
"h": 1,
|
||||
"w": 24,
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"id": 9,
|
||||
"panels": [],
|
||||
"title": "Join by time",
|
||||
"type": "row"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "testdata",
|
||||
"uid": "PD8C576611E62080A"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"lineInterpolation": "linear",
|
||||
"lineWidth": 1,
|
||||
"pointSize": 5,
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
},
|
||||
"showPoints": "auto",
|
||||
"spanNulls": false,
|
||||
"stacking": {
|
||||
"group": "A",
|
||||
"mode": "none"
|
||||
},
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green"
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 0,
|
||||
"y": 1
|
||||
},
|
||||
"id": 11,
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [],
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "testdata",
|
||||
"uid": "PD8C576611E62080A"
|
||||
},
|
||||
"refId": "A",
|
||||
"scenarioId": "random_walk",
|
||||
"seriesCount": 4
|
||||
}
|
||||
],
|
||||
"title": "Timeseries data",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "datasource",
|
||||
"uid": "-- Dashboard --"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "thresholds"
|
||||
},
|
||||
"custom": {
|
||||
"align": "auto",
|
||||
"displayMode": "auto",
|
||||
"inspect": false
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green"
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 12,
|
||||
"y": 1
|
||||
},
|
||||
"id": 13,
|
||||
"options": {
|
||||
"footer": {
|
||||
"fields": "",
|
||||
"reducer": [
|
||||
"sum"
|
||||
],
|
||||
"show": false
|
||||
},
|
||||
"showHeader": true
|
||||
},
|
||||
"pluginVersion": "9.2.0-pre",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "datasource",
|
||||
"uid": "-- Dashboard --"
|
||||
},
|
||||
"panelId": 11,
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"title": "Same data (as a table)",
|
||||
"type": "table"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "datasource",
|
||||
"uid": "-- Dashboard --"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "thresholds"
|
||||
},
|
||||
"custom": {
|
||||
"align": "auto",
|
||||
"displayMode": "auto",
|
||||
"inspect": false
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green"
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 5,
|
||||
"w": 24,
|
||||
"x": 0,
|
||||
"y": 9
|
||||
},
|
||||
"id": 16,
|
||||
"options": {
|
||||
"footer": {
|
||||
"fields": "",
|
||||
"reducer": [
|
||||
"sum"
|
||||
],
|
||||
"show": false
|
||||
},
|
||||
"showHeader": true
|
||||
},
|
||||
"pluginVersion": "9.2.0-pre",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "datasource",
|
||||
"uid": "-- Dashboard --"
|
||||
},
|
||||
"panelId": 11,
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"title": "OUTER join on time (default)",
|
||||
"transformations": [
|
||||
{
|
||||
"id": "joinByField",
|
||||
"options": {}
|
||||
}
|
||||
],
|
||||
"type": "table"
|
||||
},
|
||||
{
|
||||
"collapsed": false,
|
||||
"gridPos": {
|
||||
"h": 1,
|
||||
"w": 24,
|
||||
"x": 0,
|
||||
"y": 14
|
||||
},
|
||||
"id": 5,
|
||||
"panels": [],
|
||||
"title": "Join by string field",
|
||||
"type": "row"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "testdata",
|
||||
"uid": "PD8C576611E62080A"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "thresholds"
|
||||
},
|
||||
"custom": {
|
||||
"align": "auto",
|
||||
"displayMode": "auto",
|
||||
"inspect": false
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green"
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 0,
|
||||
"y": 15
|
||||
},
|
||||
"id": 2,
|
||||
"options": {
|
||||
"footer": {
|
||||
"fields": "",
|
||||
"reducer": [
|
||||
"sum"
|
||||
],
|
||||
"show": false
|
||||
},
|
||||
"frameIndex": 0,
|
||||
"showHeader": true
|
||||
},
|
||||
"pluginVersion": "9.2.0-pre",
|
||||
"targets": [
|
||||
{
|
||||
"csvContent": "OrderID,CustomerID,Time\n100,A,10000\n101,B,20000\n102,C,30000",
|
||||
"datasource": {
|
||||
"type": "testdata",
|
||||
"uid": "PD8C576611E62080A"
|
||||
},
|
||||
"refId": "Orders",
|
||||
"scenarioId": "csv_content"
|
||||
},
|
||||
{
|
||||
"csvContent": "CustomerID,Name,Country\nA,Customer A,USA\nB,Customer B,Germany\nC,Customer C,Spain\nD,Customer D,Canada",
|
||||
"datasource": {
|
||||
"type": "testdata",
|
||||
"uid": "PD8C576611E62080A"
|
||||
},
|
||||
"hide": false,
|
||||
"refId": "Customers",
|
||||
"scenarioId": "csv_content"
|
||||
}
|
||||
],
|
||||
"title": "Orders",
|
||||
"transformations": [],
|
||||
"type": "table"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "datasource",
|
||||
"uid": "-- Dashboard --"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "thresholds"
|
||||
},
|
||||
"custom": {
|
||||
"align": "auto",
|
||||
"displayMode": "auto",
|
||||
"inspect": false
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green"
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 12,
|
||||
"y": 15
|
||||
},
|
||||
"id": 3,
|
||||
"options": {
|
||||
"footer": {
|
||||
"fields": "",
|
||||
"reducer": [
|
||||
"sum"
|
||||
],
|
||||
"show": false
|
||||
},
|
||||
"frameIndex": 1,
|
||||
"showHeader": true
|
||||
},
|
||||
"pluginVersion": "9.2.0-pre",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "datasource",
|
||||
"uid": "-- Dashboard --"
|
||||
},
|
||||
"panelId": 2,
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"title": "Customers",
|
||||
"transformations": [],
|
||||
"type": "table"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "datasource",
|
||||
"uid": "-- Dashboard --"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "thresholds"
|
||||
},
|
||||
"custom": {
|
||||
"align": "auto",
|
||||
"displayMode": "auto",
|
||||
"inspect": false
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green"
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"matcher": {
|
||||
"id": "byName",
|
||||
"options": "CustomerID"
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"id": "custom.width",
|
||||
"value": 101
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"matcher": {
|
||||
"id": "byName",
|
||||
"options": "OrderID"
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"id": "custom.width",
|
||||
"value": 89
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 0,
|
||||
"y": 23
|
||||
},
|
||||
"id": 6,
|
||||
"options": {
|
||||
"footer": {
|
||||
"fields": "",
|
||||
"reducer": [
|
||||
"sum"
|
||||
],
|
||||
"show": false
|
||||
},
|
||||
"frameIndex": 0,
|
||||
"showHeader": true,
|
||||
"sortBy": []
|
||||
},
|
||||
"pluginVersion": "9.2.0-pre",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "datasource",
|
||||
"uid": "-- Dashboard --"
|
||||
},
|
||||
"panelId": 2,
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"title": "OUTER join on CustomerID (keeps missing values)",
|
||||
"transformations": [
|
||||
{
|
||||
"id": "joinByField",
|
||||
"options": {
|
||||
"byField": "CustomerID",
|
||||
"mode": "outer"
|
||||
}
|
||||
}
|
||||
],
|
||||
"type": "table"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "datasource",
|
||||
"uid": "-- Dashboard --"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "thresholds"
|
||||
},
|
||||
"custom": {
|
||||
"align": "auto",
|
||||
"displayMode": "auto",
|
||||
"inspect": false
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green"
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"matcher": {
|
||||
"id": "byName",
|
||||
"options": "CustomerID"
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"id": "custom.width",
|
||||
"value": 101
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"matcher": {
|
||||
"id": "byName",
|
||||
"options": "OrderID"
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"id": "custom.width",
|
||||
"value": 89
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 12,
|
||||
"y": 23
|
||||
},
|
||||
"id": 7,
|
||||
"options": {
|
||||
"footer": {
|
||||
"fields": "",
|
||||
"reducer": [
|
||||
"sum"
|
||||
],
|
||||
"show": false
|
||||
},
|
||||
"frameIndex": 0,
|
||||
"showHeader": true,
|
||||
"sortBy": []
|
||||
},
|
||||
"pluginVersion": "9.2.0-pre",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "datasource",
|
||||
"uid": "-- Dashboard --"
|
||||
},
|
||||
"panelId": 2,
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"title": "INNER join on CustomerID ",
|
||||
"transformations": [
|
||||
{
|
||||
"id": "joinByField",
|
||||
"options": {
|
||||
"byField": "CustomerID",
|
||||
"mode": "inner"
|
||||
}
|
||||
}
|
||||
],
|
||||
"type": "table"
|
||||
}
|
||||
],
|
||||
"schemaVersion": 37,
|
||||
"style": "dark",
|
||||
"tags": [
|
||||
"gdev",
|
||||
"transform"
|
||||
],
|
||||
"templating": {
|
||||
"list": []
|
||||
},
|
||||
"time": {
|
||||
"from": "now-6h",
|
||||
"to": "now"
|
||||
},
|
||||
"timepicker": {},
|
||||
"timezone": "",
|
||||
"title": "Join by field",
|
||||
"uid": "gw0K4rmVz",
|
||||
"version": 6,
|
||||
"weekStart": ""
|
||||
}
|
||||
@@ -1,354 +0,0 @@
|
||||
{
|
||||
"annotations": {
|
||||
"list": [
|
||||
{
|
||||
"builtIn": 1,
|
||||
"datasource": {
|
||||
"type": "grafana",
|
||||
"uid": "-- Grafana --"
|
||||
},
|
||||
"enable": true,
|
||||
"hide": true,
|
||||
"iconColor": "rgba(0, 211, 255, 1)",
|
||||
"name": "Annotations & Alerts",
|
||||
"target": {
|
||||
"limit": 100,
|
||||
"matchAny": false,
|
||||
"tags": [],
|
||||
"type": "dashboard"
|
||||
},
|
||||
"type": "dashboard"
|
||||
}
|
||||
]
|
||||
},
|
||||
"editable": true,
|
||||
"fiscalYearStartMonth": 0,
|
||||
"graphTooltip": 0,
|
||||
"id": 1342,
|
||||
"links": [],
|
||||
"liveNow": false,
|
||||
"panels": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "testdata",
|
||||
"uid": "PD8C576611E62080A"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "thresholds"
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green"
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 10,
|
||||
"w": 12,
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"id": 2,
|
||||
"maxDataPoints": 1,
|
||||
"options": {
|
||||
"colorMode": "none",
|
||||
"graphMode": "none",
|
||||
"justifyMode": "auto",
|
||||
"orientation": "auto",
|
||||
"reduceOptions": {
|
||||
"calcs": [
|
||||
"lastNotNull"
|
||||
],
|
||||
"fields": "",
|
||||
"values": false
|
||||
},
|
||||
"textMode": "auto"
|
||||
},
|
||||
"pluginVersion": "9.2.0-pre",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "testdata",
|
||||
"uid": "PD8C576611E62080A"
|
||||
},
|
||||
"labels": "site=A,measure=speed,state=CA",
|
||||
"refId": "A",
|
||||
"scenarioId": "random_walk"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "testdata",
|
||||
"uid": "PD8C576611E62080A"
|
||||
},
|
||||
"hide": false,
|
||||
"labels": "site=B,measure=speed,state=OR",
|
||||
"refId": "B",
|
||||
"scenarioId": "random_walk"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "testdata",
|
||||
"uid": "PD8C576611E62080A"
|
||||
},
|
||||
"hide": false,
|
||||
"labels": "site=B,measure=temp",
|
||||
"refId": "C",
|
||||
"scenarioId": "random_walk"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "testdata",
|
||||
"uid": "PD8C576611E62080A"
|
||||
},
|
||||
"hide": false,
|
||||
"labels": "site=A,measure=temp",
|
||||
"refId": "D",
|
||||
"scenarioId": "random_walk"
|
||||
}
|
||||
],
|
||||
"title": "Labeled values",
|
||||
"type": "stat"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "datasource",
|
||||
"uid": "-- Dashboard --"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "thresholds"
|
||||
},
|
||||
"custom": {
|
||||
"align": "auto",
|
||||
"displayMode": "auto",
|
||||
"inspect": false
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green"
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 10,
|
||||
"w": 12,
|
||||
"x": 12,
|
||||
"y": 0
|
||||
},
|
||||
"id": 5,
|
||||
"maxDataPoints": 1,
|
||||
"options": {
|
||||
"footer": {
|
||||
"fields": "",
|
||||
"reducer": [
|
||||
"sum"
|
||||
],
|
||||
"show": false
|
||||
},
|
||||
"frameIndex": 2,
|
||||
"showHeader": true
|
||||
},
|
||||
"pluginVersion": "9.2.0-pre",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "datasource",
|
||||
"uid": "-- Dashboard --"
|
||||
},
|
||||
"panelId": 2,
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"title": "Same values... in a table",
|
||||
"transformations": [],
|
||||
"type": "table"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "datasource",
|
||||
"uid": "-- Dashboard --"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "thresholds"
|
||||
},
|
||||
"custom": {
|
||||
"align": "auto",
|
||||
"displayMode": "auto",
|
||||
"inspect": false
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green"
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 0,
|
||||
"y": 10
|
||||
},
|
||||
"id": 4,
|
||||
"maxDataPoints": 1,
|
||||
"options": {
|
||||
"footer": {
|
||||
"fields": "",
|
||||
"reducer": [
|
||||
"sum"
|
||||
],
|
||||
"show": false
|
||||
},
|
||||
"showHeader": true
|
||||
},
|
||||
"pluginVersion": "9.2.0-pre",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "datasource",
|
||||
"uid": "-- Dashboard --"
|
||||
},
|
||||
"panelId": 2,
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"title": "Join by site",
|
||||
"transformations": [
|
||||
{
|
||||
"id": "joinByLabels",
|
||||
"options": {
|
||||
"join": [
|
||||
"site"
|
||||
],
|
||||
"value": "measure"
|
||||
}
|
||||
}
|
||||
],
|
||||
"type": "table"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "datasource",
|
||||
"uid": "-- Dashboard --"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "thresholds"
|
||||
},
|
||||
"custom": {
|
||||
"align": "auto",
|
||||
"displayMode": "auto",
|
||||
"inspect": false
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green"
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 12,
|
||||
"y": 10
|
||||
},
|
||||
"id": 6,
|
||||
"maxDataPoints": 1,
|
||||
"options": {
|
||||
"footer": {
|
||||
"fields": "",
|
||||
"reducer": [
|
||||
"sum"
|
||||
],
|
||||
"show": false
|
||||
},
|
||||
"showHeader": true
|
||||
},
|
||||
"pluginVersion": "9.2.0-pre",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "datasource",
|
||||
"uid": "-- Dashboard --"
|
||||
},
|
||||
"panelId": 2,
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"title": "Join on all labels",
|
||||
"transformations": [
|
||||
{
|
||||
"id": "joinByLabels",
|
||||
"options": {
|
||||
"value": "measure"
|
||||
}
|
||||
}
|
||||
],
|
||||
"type": "table"
|
||||
}
|
||||
],
|
||||
"schemaVersion": 37,
|
||||
"style": "dark",
|
||||
"tags": [
|
||||
"gdev",
|
||||
"transform"
|
||||
],
|
||||
"templating": {
|
||||
"list": []
|
||||
},
|
||||
"time": {
|
||||
"from": "now-6h",
|
||||
"to": "now"
|
||||
},
|
||||
"timepicker": {},
|
||||
"timezone": "",
|
||||
"title": "Join by labels",
|
||||
"uid": "FVl-9CR4z",
|
||||
"version": 10,
|
||||
"weekStart": ""
|
||||
}
|
||||
@@ -1,536 +0,0 @@
|
||||
{
|
||||
"annotations": {
|
||||
"list": [
|
||||
{
|
||||
"builtIn": 1,
|
||||
"datasource": {
|
||||
"type": "grafana",
|
||||
"uid": "-- Grafana --"
|
||||
},
|
||||
"enable": true,
|
||||
"hide": true,
|
||||
"iconColor": "rgba(0, 211, 255, 1)",
|
||||
"name": "Annotations & Alerts",
|
||||
"target": {
|
||||
"limit": 100,
|
||||
"matchAny": false,
|
||||
"tags": [],
|
||||
"type": "dashboard"
|
||||
},
|
||||
"type": "dashboard"
|
||||
}
|
||||
]
|
||||
},
|
||||
"editable": true,
|
||||
"fiscalYearStartMonth": 0,
|
||||
"graphTooltip": 0,
|
||||
"id": 1394,
|
||||
"links": [],
|
||||
"liveNow": false,
|
||||
"panels": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "testdata",
|
||||
"uid": "PD8C576611E62080A"
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 3,
|
||||
"w": 24,
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"id": 9,
|
||||
"options": {
|
||||
"content": "Dashboard queries allow re-using the same results from one panel in another panel context.\n\nThis dashboard shows a single panel that makes a real query and applies transformations. The other panels, all use the same results rather than make their own query requests.",
|
||||
"mode": "markdown"
|
||||
},
|
||||
"pluginVersion": "9.2.0-pre",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "testdata",
|
||||
"uid": "PD8C576611E62080A"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "thresholds"
|
||||
},
|
||||
"custom": {
|
||||
"align": "auto",
|
||||
"displayMode": "auto",
|
||||
"inspect": false
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green"
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 18,
|
||||
"w": 7,
|
||||
"x": 0,
|
||||
"y": 3
|
||||
},
|
||||
"id": 2,
|
||||
"options": {
|
||||
"footer": {
|
||||
"fields": "",
|
||||
"reducer": [
|
||||
"sum"
|
||||
],
|
||||
"show": false
|
||||
},
|
||||
"showHeader": true
|
||||
},
|
||||
"pluginVersion": "9.2.0-pre",
|
||||
"targets": [
|
||||
{
|
||||
"csvFileName": "flight_info_by_state.csv",
|
||||
"datasource": {
|
||||
"type": "testdata",
|
||||
"uid": "PD8C576611E62080A"
|
||||
},
|
||||
"refId": "A",
|
||||
"scenarioId": "csv_file"
|
||||
},
|
||||
{
|
||||
"csvFileName": "population_by_state.csv",
|
||||
"datasource": {
|
||||
"type": "testdata",
|
||||
"uid": "PD8C576611E62080A"
|
||||
},
|
||||
"refId": "B",
|
||||
"scenarioId": "csv_file"
|
||||
}
|
||||
],
|
||||
"title": "Raw data -- with outer join",
|
||||
"transformations": [
|
||||
{
|
||||
"id": "seriesToColumns",
|
||||
"options": {
|
||||
"byField": "State",
|
||||
"mode": "outer"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "organize",
|
||||
"options": {
|
||||
"excludeByName": {
|
||||
"1980 population_by_state.csv": true,
|
||||
"2000 population_by_state.csv": true,
|
||||
"DestLocation flight_info_by_state.csv": true,
|
||||
"Lat flight_info_by_state.csv": true,
|
||||
"Lng flight_info_by_state.csv": true,
|
||||
"Price flight_info_by_state.csv": true
|
||||
},
|
||||
"indexByName": {},
|
||||
"renameByName": {
|
||||
"2020 population_by_state.csv": "2020 population",
|
||||
"Count flight_info_by_state.csv": "Flight count",
|
||||
"Price flight_info_by_state.csv": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"type": "table"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "datasource",
|
||||
"uid": "-- Dashboard --"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "thresholds"
|
||||
},
|
||||
"custom": {
|
||||
"align": "auto",
|
||||
"displayMode": "auto",
|
||||
"inspect": false
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green"
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 9,
|
||||
"w": 11,
|
||||
"x": 7,
|
||||
"y": 3
|
||||
},
|
||||
"id": 4,
|
||||
"options": {
|
||||
"footer": {
|
||||
"fields": "",
|
||||
"reducer": [
|
||||
"sum"
|
||||
],
|
||||
"show": false
|
||||
},
|
||||
"showHeader": true
|
||||
},
|
||||
"pluginVersion": "9.2.0-pre",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "datasource",
|
||||
"uid": "-- Dashboard --"
|
||||
},
|
||||
"panelId": 2,
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"title": "Reused data (without transform)",
|
||||
"type": "table"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "datasource",
|
||||
"uid": "-- Dashboard --"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "thresholds"
|
||||
},
|
||||
"custom": {
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
}
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green"
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 9,
|
||||
"w": 6,
|
||||
"x": 18,
|
||||
"y": 3
|
||||
},
|
||||
"id": 5,
|
||||
"options": {
|
||||
"basemap": {
|
||||
"config": {},
|
||||
"name": "Layer 0",
|
||||
"type": "default"
|
||||
},
|
||||
"controls": {
|
||||
"mouseWheelZoom": true,
|
||||
"showAttribution": true,
|
||||
"showDebug": false,
|
||||
"showMeasure": false,
|
||||
"showScale": false,
|
||||
"showZoom": true
|
||||
},
|
||||
"layers": [
|
||||
{
|
||||
"config": {
|
||||
"showLegend": true,
|
||||
"style": {
|
||||
"color": {
|
||||
"fixed": "dark-green"
|
||||
},
|
||||
"opacity": 0.4,
|
||||
"rotation": {
|
||||
"fixed": 0,
|
||||
"max": 360,
|
||||
"min": -360,
|
||||
"mode": "mod"
|
||||
},
|
||||
"size": {
|
||||
"field": "Flight count",
|
||||
"fixed": 5,
|
||||
"max": 15,
|
||||
"min": 2
|
||||
},
|
||||
"symbol": {
|
||||
"fixed": "img/icons/marker/circle.svg",
|
||||
"mode": "fixed"
|
||||
},
|
||||
"textConfig": {
|
||||
"fontSize": 12,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"textAlign": "center",
|
||||
"textBaseline": "middle"
|
||||
}
|
||||
}
|
||||
},
|
||||
"location": {
|
||||
"gazetteer": "public/gazetteer/usa-states.json",
|
||||
"lookup": "State",
|
||||
"mode": "lookup"
|
||||
},
|
||||
"name": "Flight count",
|
||||
"tooltip": true,
|
||||
"type": "markers"
|
||||
}
|
||||
],
|
||||
"tooltip": {
|
||||
"mode": "details"
|
||||
},
|
||||
"view": {
|
||||
"id": "coords",
|
||||
"lat": 35.70008,
|
||||
"lon": -93.558296,
|
||||
"zoom": 3.09
|
||||
}
|
||||
},
|
||||
"pluginVersion": "9.2.0-pre",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "datasource",
|
||||
"uid": "-- Dashboard --"
|
||||
},
|
||||
"panelId": 2,
|
||||
"refId": "A",
|
||||
"withTransforms": true
|
||||
}
|
||||
],
|
||||
"title": "Reused data (without transform)",
|
||||
"type": "geomap"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "datasource",
|
||||
"uid": "-- Dashboard --"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "thresholds"
|
||||
},
|
||||
"custom": {
|
||||
"align": "auto",
|
||||
"displayMode": "auto",
|
||||
"inspect": false
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green"
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 9,
|
||||
"w": 11,
|
||||
"x": 7,
|
||||
"y": 12
|
||||
},
|
||||
"id": 6,
|
||||
"options": {
|
||||
"footer": {
|
||||
"fields": "",
|
||||
"reducer": [
|
||||
"sum"
|
||||
],
|
||||
"show": false
|
||||
},
|
||||
"showHeader": true
|
||||
},
|
||||
"pluginVersion": "9.2.0-pre",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "datasource",
|
||||
"uid": "-- Dashboard --"
|
||||
},
|
||||
"panelId": 2,
|
||||
"refId": "A",
|
||||
"withTransforms": true
|
||||
}
|
||||
],
|
||||
"title": "Reused data (with transform)",
|
||||
"type": "table"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "datasource",
|
||||
"uid": "-- Dashboard --"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "thresholds"
|
||||
},
|
||||
"custom": {
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
}
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green"
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 9,
|
||||
"w": 6,
|
||||
"x": 18,
|
||||
"y": 12
|
||||
},
|
||||
"id": 7,
|
||||
"options": {
|
||||
"basemap": {
|
||||
"config": {},
|
||||
"name": "Layer 0",
|
||||
"type": "default"
|
||||
},
|
||||
"controls": {
|
||||
"mouseWheelZoom": true,
|
||||
"showAttribution": true,
|
||||
"showDebug": false,
|
||||
"showMeasure": false,
|
||||
"showScale": false,
|
||||
"showZoom": true
|
||||
},
|
||||
"layers": [
|
||||
{
|
||||
"config": {
|
||||
"showLegend": true,
|
||||
"style": {
|
||||
"color": {
|
||||
"fixed": "dark-green"
|
||||
},
|
||||
"opacity": 0.4,
|
||||
"rotation": {
|
||||
"fixed": 0,
|
||||
"max": 360,
|
||||
"min": -360,
|
||||
"mode": "mod"
|
||||
},
|
||||
"size": {
|
||||
"field": "2020 population",
|
||||
"fixed": 5,
|
||||
"max": 15,
|
||||
"min": 2
|
||||
},
|
||||
"symbol": {
|
||||
"fixed": "img/icons/marker/circle.svg",
|
||||
"mode": "fixed"
|
||||
},
|
||||
"textConfig": {
|
||||
"fontSize": 12,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"textAlign": "center",
|
||||
"textBaseline": "middle"
|
||||
}
|
||||
}
|
||||
},
|
||||
"location": {
|
||||
"gazetteer": "public/gazetteer/usa-states.json",
|
||||
"lookup": "State",
|
||||
"mode": "lookup"
|
||||
},
|
||||
"name": "2022 Population",
|
||||
"tooltip": true,
|
||||
"type": "markers"
|
||||
}
|
||||
],
|
||||
"tooltip": {
|
||||
"mode": "details"
|
||||
},
|
||||
"view": {
|
||||
"id": "coords",
|
||||
"lat": 35.70008,
|
||||
"lon": -93.558296,
|
||||
"zoom": 3.09
|
||||
}
|
||||
},
|
||||
"pluginVersion": "9.2.0-pre",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "datasource",
|
||||
"uid": "-- Dashboard --"
|
||||
},
|
||||
"panelId": 2,
|
||||
"refId": "A",
|
||||
"withTransforms": true
|
||||
}
|
||||
],
|
||||
"title": "Reused data (with transform)",
|
||||
"type": "geomap"
|
||||
}
|
||||
],
|
||||
"schemaVersion": 37,
|
||||
"style": "dark",
|
||||
"tags": ["devenv"],
|
||||
"templating": {
|
||||
"list": []
|
||||
},
|
||||
"time": {
|
||||
"from": "now-6h",
|
||||
"to": "now"
|
||||
},
|
||||
"timepicker": {},
|
||||
"timezone": "",
|
||||
"title": "Reuse dashboard queries",
|
||||
"uid": "fYGWTVW4k"
|
||||
}
|
||||
@@ -3,13 +3,14 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func hello(w http.ResponseWriter, r *http.Request) {
|
||||
body, err := io.ReadAll(r.Body)
|
||||
body, err := ioutil.ReadAll(r.Body)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -5,5 +5,5 @@
|
||||
# root_url = %(protocol)s://%(domain)s:10081/grafana/
|
||||
|
||||
apacheproxy:
|
||||
build: docker/blocks/auth/apache_proxy
|
||||
build: docker/blocks/apache_proxy
|
||||
network_mode: host
|
||||
@@ -5,6 +5,6 @@
|
||||
# root_url = %(protocol)s://%(domain)s:10081/grafana/
|
||||
|
||||
apacheproxy:
|
||||
build: docker/blocks/auth/apache_proxy_mac
|
||||
build: docker/blocks/apache_proxy_mac
|
||||
ports:
|
||||
- "10081:10081"
|
||||
@@ -1,32 +0,0 @@
|
||||
# Auth Docker blocks
|
||||
|
||||
This collection of Docker images will help create a developer environment to
|
||||
interact with different Authentication Providers.
|
||||
|
||||
## Usage
|
||||
|
||||
Spin up a service with the following command from the base directory of this
|
||||
repository.
|
||||
|
||||
```bash
|
||||
make devenv=oauth
|
||||
```
|
||||
|
||||
This will add the `oauth/docker-compose` block to the `docker-compose` file used
|
||||
by the `devenv` target.
|
||||
|
||||
## Available Authentication Providers
|
||||
|
||||
- [apache_proxy](./apache_proxy)
|
||||
- [apache_proxy_mac](./apache_proxy_mac)
|
||||
- [freeipa](./freeipa)
|
||||
- [jwt_proxy](./jwt_proxy)
|
||||
- [oauth](./oauth)
|
||||
- [nginx_proxy](./nginx_proxy)
|
||||
- [nginx_proxy_mac](./nginx_proxy_mac)
|
||||
- [oauth](./oauth)
|
||||
- [openldap](./openldap)
|
||||
- [openldap-mac](./openldap-mac)
|
||||
- [openldap-multiple](./openldap-multiple)
|
||||
- [prometheus_basic_auth_proxy](./prometheus_basic_auth_proxy)
|
||||
- [saml](./saml)
|
||||
@@ -1,57 +0,0 @@
|
||||
oauthkeycloakdb:
|
||||
image: postgres:12.2
|
||||
container_name: oauthkeycloakdb
|
||||
environment:
|
||||
POSTGRES_DB: keycloak
|
||||
POSTGRES_USER: keycloak
|
||||
POSTGRES_PASSWORD: password
|
||||
volumes:
|
||||
- ./docker/blocks/auth/jwt_proxy/cloak.sql:/docker-entrypoint-initdb.d/cloak.sql
|
||||
restart: unless-stopped
|
||||
|
||||
oauthkeycloak:
|
||||
image: quay.io/keycloak/keycloak:12.0.1
|
||||
container_name: oauthkeycloak
|
||||
environment:
|
||||
DB_VENDOR: POSTGRES
|
||||
DB_ADDR: oauthkeycloakdb
|
||||
DB_DATABASE: keycloak
|
||||
DB_USER: keycloak
|
||||
DB_PASSWORD: password
|
||||
KEYCLOAK_USER: admin
|
||||
KEYCLOAK_PASSWORD: admin
|
||||
PROXY_ADDRESS_FORWARDING: "true"
|
||||
ports:
|
||||
- 8087:8080
|
||||
depends_on:
|
||||
- oauthkeycloakdb
|
||||
links:
|
||||
- "oauthkeycloakdb:oauthkeycloakdb"
|
||||
restart: unless-stopped
|
||||
|
||||
oauthproxy:
|
||||
image: docker.io/bitnami/oauth2-proxy:7.3.0
|
||||
container_name: oauthproxy
|
||||
command: [
|
||||
"--cookie-secret=yI-CWT5s4sBR2Zd0DDJJlTYc0aQ3jwGH15jYA18ZAQA=",
|
||||
"--upstream=http://env.grafana.local:3000",
|
||||
"--provider=keycloak",
|
||||
"--client-id=grafana-oauth",
|
||||
"--client-secret=d17b9ea9-bcb1-43d2-b132-d339e55872a8",
|
||||
"--login-url=http://env.grafana.local:8087/auth/realms/grafana/protocol/openid-connect/auth",
|
||||
"--redeem-url=http://env.grafana.local:8087/auth/realms/grafana/protocol/openid-connect/token",
|
||||
"--profile-url=http://env.grafana.local:8087/auth/realms/grafana/protocol/openid-connect/userinfo",
|
||||
"--validate-url=http://env.grafana.local:8087/auth/realms/grafana/protocol/openid-connect/userinfo",
|
||||
"--cookie-secure=false",
|
||||
"--http-address=0.0.0.0:8088",
|
||||
"--redirect-url=http://env.grafana.local:8088/oauth2/callback",
|
||||
"--pass-access-token=true",
|
||||
"--email-domain=*",
|
||||
]
|
||||
depends_on:
|
||||
- oauthkeycloak
|
||||
extra_hosts:
|
||||
- "env.grafana.local:host-gateway"
|
||||
ports:
|
||||
- 8088:8088
|
||||
restart: unless-stopped
|
||||
@@ -1,117 +0,0 @@
|
||||
# JWT PROXY BLOCK
|
||||
## Devenv setup jwt auth
|
||||
|
||||
To launch the block, use the oauth source. Ex:
|
||||
|
||||
```bash
|
||||
make devenv sources="auth/jwt_proxy"
|
||||
```
|
||||
|
||||
Here is the conf you need to add to your configuration file (conf/custom.ini):
|
||||
|
||||
```ini
|
||||
[auth]
|
||||
signout_redirect_url = http://env.grafana.local:8088/oauth2/sign_out
|
||||
|
||||
[auth.jwt]
|
||||
enabled = true
|
||||
header_name = X-Forwarded-Access-Token
|
||||
username_claim = login
|
||||
email_claim = email
|
||||
jwk_set_file = devenv/docker/blocks/auth/oauth/jwks.json
|
||||
cache_ttl = 60m
|
||||
expected_claims = {"iss": "http://env.grafana.local:8087/auth/realms/grafana", "azp": "grafana-oauth"}
|
||||
auto_sign_up = true
|
||||
role_attribute_path = contains(roles[*], 'grafanaadmin') && 'GrafanaAdmin' || contains(roles[*], 'admin') && 'Admin' || contains(roles[*], 'editor') && 'Editor' || 'Viewer'
|
||||
role_attribute_strict = false
|
||||
allow_assign_grafana_admin = true
|
||||
```
|
||||
|
||||
Add *env.grafana.local* to /etc/hosts (Mac/Linux) or C:\Windows\System32\drivers\etc\hosts (Windows):
|
||||
```ini
|
||||
127.0.0.1 env.grafana.local
|
||||
::1 env.grafana.local
|
||||
```
|
||||
|
||||
Access Grafana through:
|
||||
|
||||
```sh
|
||||
http://env.grafana.local:8088
|
||||
```
|
||||
|
||||
## Devenv setup jwt auth iframe embedding
|
||||
|
||||
- Add previous configuration and next snippet to grafana.ini
|
||||
|
||||
```ini
|
||||
[security]
|
||||
allow_embedding = true
|
||||
```
|
||||
|
||||
- Create dashboard and copy UID
|
||||
|
||||
- Clone [https://github.com/grafana/grafana-iframe-oauth-sample](https://github.com/grafana/grafana-iframe-oauth-sample)
|
||||
|
||||
- Change the dashboard URL in `grafana-iframe-oauth-sample/src/pages/restricted.tsx` to use the dashboard you created (keep URL query values)
|
||||
|
||||
- Start sample app from the `grafana-iframe-oauth-sample` folder with: `yarn start`
|
||||
|
||||
- Navigate to [http://localhost:4200](http://localhost:4200) and press restricted area
|
||||
|
||||
Note: You may need to grant the JWT user in grafana access to the datasources and the dashboard
|
||||
|
||||
## Backing up keycloak DB
|
||||
|
||||
In case you want to make changes to the devenv setup, you can dump keycloak's DB:
|
||||
|
||||
```bash
|
||||
cd devenv;
|
||||
docker-compose exec -T oauthkeycloakdb bash -c "pg_dump -U keycloak keycloak" > docker/blocks/auth/jwt_proxy/cloak.sql
|
||||
```
|
||||
|
||||
## Connecting to keycloak:
|
||||
|
||||
- keycloak admin: http://localhost:8087
|
||||
- keycloak admin login: admin:admin
|
||||
- grafana jwt viewer login: jwt-viewer:grafana
|
||||
- grafana jwt editor login: jwt-editor:grafana
|
||||
- grafana jwt admin login: jwt-admin:grafana
|
||||
|
||||
# Troubleshooting
|
||||
|
||||
## Mac M1 Users
|
||||
|
||||
The new arm64 architecture does not build for the latest docker image of keycloak. Refer to https://github.com/docker/for-mac/issues/5310 for the issue to see if it resolved.
|
||||
Until then you need to build the docker image locally and then run `devenv`.
|
||||
|
||||
1. Remove any lingering keycloak image
|
||||
```sh
|
||||
$ docker rmi $(docker images | grep 'keycloak')
|
||||
```
|
||||
1. Build keycloak image locally
|
||||
```sh
|
||||
$ ./docker-build-keycloak-m1-image.sh
|
||||
```
|
||||
1. Start from beginning of this readme
|
||||
|
||||
## Docker for Windows Users
|
||||
|
||||
### Docker for Windows with WSL 2
|
||||
|
||||
Port forwarding needs to be set up between the WSL 2 VM (which runs Grafana, in my case it is Ubuntu) and the host system. (https://docs.microsoft.com/en-us/windows/wsl/networking)
|
||||
|
||||
Run the following commands from an elevated PowerShell prompt:
|
||||
1. Change the default WSL 2 distribution if necessary
|
||||
```powershell
|
||||
wsl --list # Find the default
|
||||
wsl -s Ubuntu # Change the default
|
||||
```
|
||||
2. Open port 3000 between the Windows host and the WSL 2 VM
|
||||
```powershell
|
||||
$hostAddr = '0.0.0.0';
|
||||
$wslHostAddr = wsl hostname -I;
|
||||
iex "netsh interface portproxy delete v4tov4 listenport=3000 listenaddress=$hostAddr"
|
||||
iex "netsh interface portproxy add v4tov4 listenport=3000 listenaddress=$hostAddr connectport=3000 connectaddress=$wslHostAddr"
|
||||
```
|
||||
|
||||
Tested on Win 11 Home, Ubuntu and Docker for Windows v4.11.1 (84025).
|
||||
@@ -1,56 +0,0 @@
|
||||
# OpenLDAP for MacOS Docker Block
|
||||
|
||||
This Docker block is an updated version from [OpenLDAP](../openldap/) block. This Docker block uses `osixia/openldap` image. The original Docker block was based of `debian:jessie` which is not available for Apple's ARM chip.
|
||||
|
||||
## Deployment
|
||||
|
||||
First build and deploy the `openldap` container.
|
||||
|
||||
```bash
|
||||
make devenv sources=auth/openldap-mac
|
||||
```
|
||||
|
||||
### Exposed ports
|
||||
|
||||
The container will expose port `389` and `636`.
|
||||
|
||||
### Background services
|
||||
|
||||
The `osixia/openldap` container will update the database with any `*.ldif` file changes inside `./prepopulate` and the `./modules` folder. Remember to rebuild the `devenv` to apply any changes.
|
||||
|
||||
## Grafana configuration changes
|
||||
|
||||
The following changes are needed at Grafana's configuration file.
|
||||
|
||||
```ini
|
||||
[auth.ldap]
|
||||
enabled = true
|
||||
config_file = conf/ldap_dev.toml
|
||||
```
|
||||
|
||||
The configuration between Grafana and the OpenLDAP container is configured at [./conf/ldap.toml](../../../../conf/ldap.toml).
|
||||
|
||||
## Available users and groups
|
||||
|
||||
- admins
|
||||
- ldap-admin
|
||||
- ldap-torkel
|
||||
- backend
|
||||
- ldap-carl
|
||||
- ldap-torkel
|
||||
- ldap-leo
|
||||
- frontend
|
||||
- ldap-torkel
|
||||
- ldap-tobias
|
||||
- ldap-daniel
|
||||
- editors
|
||||
- ldap-editors
|
||||
- no groups
|
||||
- ldap-viewer
|
||||
|
||||
## Groups & Users (POSIX)
|
||||
|
||||
- admins
|
||||
- ldap-posix-admin
|
||||
- no groups
|
||||
- ldap-posix
|
||||
@@ -1,15 +0,0 @@
|
||||
openldap-mac:
|
||||
container_name: ldap
|
||||
image: osixia/openldap
|
||||
environment:
|
||||
LDAP_ORGANISATION: grafana
|
||||
LDAP_DOMAIN: grafana.org
|
||||
LDAP_ADMIN_PASSWORD: grafana
|
||||
LDAP_SEED_INTERNAL_LDIF_PATH: /tmp/smt/
|
||||
ports:
|
||||
- 389:389
|
||||
- 636:636
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./docker/blocks/auth/openldap-mac/prepopulate/:/tmp/smt/
|
||||
- ./docker/blocks/auth/openldap-mac/modules/:/tmp/smt/
|
||||
@@ -1,33 +0,0 @@
|
||||
dn: cn=module,cn=config
|
||||
cn: module
|
||||
objectClass: olcModuleList
|
||||
objectClass: top
|
||||
olcModulePath: /usr/lib/ldap
|
||||
olcModuleLoad: memberof.la
|
||||
|
||||
dn: olcOverlay={0}memberof,olcDatabase={1}hdb,cn=config
|
||||
objectClass: olcConfig
|
||||
objectClass: olcMemberOf
|
||||
objectClass: olcOverlayConfig
|
||||
objectClass: top
|
||||
olcOverlay: memberof
|
||||
olcMemberOfDangling: ignore
|
||||
olcMemberOfRefInt: TRUE
|
||||
olcMemberOfGroupOC: groupOfNames
|
||||
olcMemberOfMemberAD: member
|
||||
olcMemberOfMemberOfAD: memberOf
|
||||
|
||||
dn: cn=module,cn=config
|
||||
cn: module
|
||||
objectClass: olcModuleList
|
||||
objectClass: top
|
||||
olcModulePath: /usr/lib/ldap
|
||||
olcModuleLoad: refint.la
|
||||
|
||||
dn: olcOverlay={1}refint,olcDatabase={1}hdb,cn=config
|
||||
objectClass: olcConfig
|
||||
objectClass: olcOverlayConfig
|
||||
objectClass: olcRefintConfig
|
||||
objectClass: top
|
||||
olcOverlay: {1}refint
|
||||
olcRefintAttribute: memberof member manager owner
|
||||
@@ -1,9 +0,0 @@
|
||||
dn: ou=groups,dc=grafana,dc=org
|
||||
ou: Groups
|
||||
objectclass: top
|
||||
objectclass: organizationalUnit
|
||||
|
||||
dn: ou=users,dc=grafana,dc=org
|
||||
ou: Users
|
||||
objectclass: top
|
||||
objectclass: organizationalUnit
|
||||
@@ -1,108 +0,0 @@
|
||||
# ldap-admin
|
||||
dn: cn=ldap-admin,ou=users,dc=grafana,dc=org
|
||||
mail: ldap-admin@grafana.com
|
||||
userPassword: grafana
|
||||
objectClass: person
|
||||
objectClass: top
|
||||
objectClass: inetOrgPerson
|
||||
objectClass: organizationalPerson
|
||||
sn: ldap-admin
|
||||
cn: ldap-admin
|
||||
|
||||
dn: cn=ldap-editor,ou=users,dc=grafana,dc=org
|
||||
mail: ldap-editor@grafana.com
|
||||
userPassword: grafana
|
||||
objectClass: person
|
||||
objectClass: top
|
||||
objectClass: inetOrgPerson
|
||||
objectClass: organizationalPerson
|
||||
sn: ldap-editor
|
||||
cn: ldap-editor
|
||||
|
||||
dn: cn=ldap-viewer,ou=users,dc=grafana,dc=org
|
||||
mail: ldap-viewer@grafana.com
|
||||
userPassword: grafana
|
||||
objectClass: person
|
||||
objectClass: top
|
||||
objectClass: inetOrgPerson
|
||||
objectClass: organizationalPerson
|
||||
sn: ldap-viewer
|
||||
cn: ldap-viewer
|
||||
|
||||
dn: cn=ldap-carl,ou=users,dc=grafana,dc=org
|
||||
mail: ldap-carl@grafana.com
|
||||
userPassword: grafana
|
||||
objectClass: person
|
||||
objectClass: top
|
||||
objectClass: inetOrgPerson
|
||||
objectClass: organizationalPerson
|
||||
sn: ldap-carl
|
||||
cn: ldap-carl
|
||||
|
||||
dn: cn=ldap-daniel,ou=users,dc=grafana,dc=org
|
||||
mail: ldap-daniel@grafana.com
|
||||
userPassword: grafana
|
||||
objectClass: person
|
||||
objectClass: top
|
||||
objectClass: inetOrgPerson
|
||||
objectClass: organizationalPerson
|
||||
sn: ldap-daniel
|
||||
cn: ldap-daniel
|
||||
|
||||
dn: cn=ldap-leo,ou=users,dc=grafana,dc=org
|
||||
mail: ldap-leo@grafana.com
|
||||
userPassword: grafana
|
||||
objectClass: person
|
||||
objectClass: top
|
||||
objectClass: inetOrgPerson
|
||||
objectClass: organizationalPerson
|
||||
sn: ldap-leo
|
||||
cn: ldap-leo
|
||||
|
||||
dn: cn=ldap-tobias,ou=users,dc=grafana,dc=org
|
||||
mail: ldap-tobias@grafana.com
|
||||
userPassword: grafana
|
||||
objectClass: person
|
||||
objectClass: top
|
||||
objectClass: inetOrgPerson
|
||||
objectClass: organizationalPerson
|
||||
sn: ldap-tobias
|
||||
cn: ldap-tobias
|
||||
|
||||
dn: cn=ldap-torkel,ou=users,dc=grafana,dc=org
|
||||
mail: ldap-torkel@grafana.com
|
||||
userPassword: grafana
|
||||
objectClass: person
|
||||
objectClass: top
|
||||
objectClass: inetOrgPerson
|
||||
objectClass: organizationalPerson
|
||||
sn: ldap-torkel
|
||||
cn: ldap-torkel
|
||||
|
||||
# admin for posix group (without support for memberOf attribute)
|
||||
dn: uid=ldap-posix-admin,ou=users,dc=grafana,dc=org
|
||||
mail: ldap-posix-admin@grafana.com
|
||||
userPassword: grafana
|
||||
objectclass: top
|
||||
objectclass: posixAccount
|
||||
objectclass: inetOrgPerson
|
||||
homedirectory: /home/ldap-posix-admin
|
||||
sn: ldap-posix-admin
|
||||
cn: ldap-posix-admin
|
||||
uid: ldap-posix-admin
|
||||
uidnumber: 1
|
||||
gidnumber: 1
|
||||
|
||||
# user for posix group (without support for memberOf attribute)
|
||||
dn: uid=ldap-posix,ou=users,dc=grafana,dc=org
|
||||
mail: ldap-posix@grafana.com
|
||||
userPassword: grafana
|
||||
objectclass: top
|
||||
objectclass: posixAccount
|
||||
objectclass: inetOrgPerson
|
||||
homedirectory: /home/ldap-posix
|
||||
sn: ldap-posix
|
||||
cn: ldap-posix
|
||||
uid: ldap-posix
|
||||
uidnumber: 2
|
||||
gidnumber: 2
|
||||
@@ -1,43 +0,0 @@
|
||||
dn: cn=admins,ou=groups,dc=grafana,dc=org
|
||||
cn: admins
|
||||
objectClass: groupOfNames
|
||||
objectClass: top
|
||||
member: cn=ldap-admin,ou=users,dc=grafana,dc=org
|
||||
member: cn=ldap-torkel,ou=users,dc=grafana,dc=org
|
||||
|
||||
dn: cn=editors,ou=groups,dc=grafana,dc=org
|
||||
cn: editors
|
||||
objectClass: groupOfNames
|
||||
member: cn=ldap-editor,ou=users,dc=grafana,dc=org
|
||||
|
||||
dn: cn=backend,ou=groups,dc=grafana,dc=org
|
||||
cn: backend
|
||||
objectClass: groupOfNames
|
||||
member: cn=ldap-carl,ou=users,dc=grafana,dc=org
|
||||
member: cn=ldap-leo,ou=users,dc=grafana,dc=org
|
||||
member: cn=ldap-torkel,ou=users,dc=grafana,dc=org
|
||||
|
||||
dn: cn=frontend,ou=groups,dc=grafana,dc=org
|
||||
cn: frontend
|
||||
objectClass: groupOfNames
|
||||
member: cn=ldap-torkel,ou=users,dc=grafana,dc=org
|
||||
member: cn=ldap-daniel,ou=users,dc=grafana,dc=org
|
||||
member: cn=ldap-leo,ou=users,dc=grafana,dc=org
|
||||
|
||||
# -- POSIX --
|
||||
|
||||
# posix admin group (without support for memberOf attribute)
|
||||
dn: cn=posix-admins,ou=groups,dc=grafana,dc=org
|
||||
cn: admins
|
||||
objectClass: top
|
||||
objectClass: posixGroup
|
||||
gidNumber: 1
|
||||
memberUid: ldap-posix-admin
|
||||
|
||||
# posix group (without support for memberOf attribute)
|
||||
dn: cn=posix,ou=groups,dc=grafana,dc=org
|
||||
cn: viewers
|
||||
objectClass: top
|
||||
objectClass: posixGroup
|
||||
gidNumber: 2
|
||||
memberUid: ldap-posix
|
||||
@@ -1 +1 @@
|
||||
elastic_version=8.4.1
|
||||
elastic_version=8.2.0
|
||||
@@ -80,9 +80,6 @@ async function elasticSetupIndexTemplate() {
|
||||
location: {
|
||||
type: 'geo_point',
|
||||
},
|
||||
shapes: {
|
||||
type: 'nested',
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -111,15 +108,6 @@ function getRandomLogItem(counter, timestamp) {
|
||||
level: chooseRandomElement(['info', 'info', 'error']),
|
||||
// location: chooseRandomElement(LOCATIONS),
|
||||
location: makeRandomPoint(),
|
||||
shapes: Math.random() < 0.5 ? [
|
||||
{"type": "triangle"},
|
||||
{"type": "square"},
|
||||
] : [
|
||||
{"type": "triangle"},
|
||||
{"type": "triangle"},
|
||||
{"type": "triangle"},
|
||||
{"type": "square"},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
42
devenv/docker/blocks/elastic7/docker-compose.yaml
Normal file
42
devenv/docker/blocks/elastic7/docker-compose.yaml
Normal file
@@ -0,0 +1,42 @@
|
||||
# You need to run 'sysctl -w vm.max_map_count=262144' on the host machine
|
||||
|
||||
elasticsearch7:
|
||||
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
|
||||
command: elasticsearch -E "discovery.type=single-node"
|
||||
ports:
|
||||
- "12200:9200"
|
||||
- "12300:9300"
|
||||
|
||||
fake-elastic7-data:
|
||||
image: grafana/fake-data-gen
|
||||
links:
|
||||
- elasticsearch7
|
||||
environment:
|
||||
FD_SERVER: elasticsearch7
|
||||
FD_DATASOURCE: elasticsearch7
|
||||
FD_PORT: 9200
|
||||
|
||||
filebeat7:
|
||||
image: docker.elastic.co/beats/filebeat-oss:7.17.0
|
||||
command: filebeat -e -strict.perms=false
|
||||
volumes:
|
||||
- ./docker/blocks/elastic7/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro
|
||||
- /var/log:/var/log:ro
|
||||
- ../data/log:/var/log/grafana:ro
|
||||
|
||||
metricbeat7:
|
||||
image: docker.elastic.co/beats/metricbeat-oss:7.17.0
|
||||
command: metricbeat -e -strict.perms=false
|
||||
user: root
|
||||
volumes:
|
||||
- ./docker/blocks/elastic7/metricbeat.yml:/usr/share/metricbeat/metricbeat.yml:ro
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
|
||||
kibana7:
|
||||
image: docker.elastic.co/kibana/kibana-oss:7.0.0
|
||||
ports:
|
||||
- "5601:5601"
|
||||
links:
|
||||
- elasticsearch7
|
||||
environment:
|
||||
ELASTICSEARCH_HOSTS: http://elasticsearch7:9200
|
||||
2
devenv/docker/blocks/elastic7/elasticsearch.yml
Normal file
2
devenv/docker/blocks/elastic7/elasticsearch.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
script.inline: on
|
||||
script.indexed: on
|
||||
@@ -409,7 +409,7 @@ filebeat.inputs:
|
||||
enabled: true
|
||||
paths:
|
||||
- /var/log/grafana/grafana.log
|
||||
include_lines: ['level=info']
|
||||
include_lines: ['lvl=info']
|
||||
fields:
|
||||
app: grafana
|
||||
level: info
|
||||
@@ -417,7 +417,7 @@ filebeat.inputs:
|
||||
enabled: true
|
||||
paths:
|
||||
- /var/log/grafana/grafana.log
|
||||
include_lines: ['level=eror']
|
||||
include_lines: ['lvl=eror']
|
||||
fields:
|
||||
app: grafana
|
||||
level: error
|
||||
@@ -425,7 +425,7 @@ filebeat.inputs:
|
||||
enabled: true
|
||||
paths:
|
||||
- /var/log/grafana/grafana.log
|
||||
include_lines: ['level=warn']
|
||||
include_lines: ['lvl=warn']
|
||||
fields:
|
||||
app: grafana
|
||||
level: warning
|
||||
@@ -433,7 +433,7 @@ filebeat.inputs:
|
||||
enabled: true
|
||||
paths:
|
||||
- /var/log/grafana/grafana.log
|
||||
include_lines: ['level=dbug']
|
||||
include_lines: ['lvl=dbug']
|
||||
fields:
|
||||
app: grafana
|
||||
level: debug
|
||||
@@ -1080,13 +1080,13 @@ filebeat.inputs:
|
||||
#-------------------------- Elasticsearch output -------------------------------
|
||||
output.elasticsearch:
|
||||
# Boolean flag to enable or disable the output module.
|
||||
enabled: true
|
||||
#enabled: true
|
||||
|
||||
# Array of hosts to connect to.
|
||||
# Scheme and port can be left out and will be set to the default (http and 9200)
|
||||
# In case you specify and additional path, the scheme is required: http://localhost:9200/path
|
||||
# IPv6 addresses should always be defined as: https://[2001:db8::1]:9200
|
||||
hosts: ["elasticsearch:9200"]
|
||||
hosts: ["elasticsearch7:9200"]
|
||||
|
||||
# Enabled ilm (beta) to use index lifecycle management instead daily indices.
|
||||
#ilm.enabled: false
|
||||
@@ -28,7 +28,7 @@ processors:
|
||||
- add_cloud_metadata: ~
|
||||
|
||||
output.elasticsearch:
|
||||
hosts: ["elasticsearch:9200"]
|
||||
hosts: ["elasticsearch7:9200"]
|
||||
index: "metricbeat-%{+yyyy.MM.dd}"
|
||||
|
||||
setup.template.name: "metricbeat"
|
||||
44
devenv/docker/blocks/elastic77/docker-compose.yaml
Normal file
44
devenv/docker/blocks/elastic77/docker-compose.yaml
Normal file
@@ -0,0 +1,44 @@
|
||||
# You need to run 'sysctl -w vm.max_map_count=262144' on the host machine
|
||||
|
||||
elasticsearch77:
|
||||
image: docker.elastic.co/elasticsearch/elasticsearch:7.7.1
|
||||
command: elasticsearch
|
||||
environment:
|
||||
- "discovery.type=single-node"
|
||||
ports:
|
||||
- "13200:9200"
|
||||
- "13300:9300"
|
||||
|
||||
fake-elastic77-data:
|
||||
image: grafana/fake-data-gen
|
||||
links:
|
||||
- elasticsearch77
|
||||
environment:
|
||||
FD_SERVER: elasticsearch77
|
||||
FD_DATASOURCE: elasticsearch7
|
||||
FD_PORT: 9200
|
||||
|
||||
filebeat77:
|
||||
image: docker.elastic.co/beats/filebeat:7.7.1
|
||||
command: filebeat -e -strict.perms=false
|
||||
volumes:
|
||||
- ./docker/blocks/elastic77/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro
|
||||
- /var/log:/var/log:ro
|
||||
- ../data/log:/var/log/grafana:ro
|
||||
|
||||
metricbeat77:
|
||||
image: docker.elastic.co/beats/metricbeat:7.7.1
|
||||
command: metricbeat -e -strict.perms=false
|
||||
user: root
|
||||
volumes:
|
||||
- ./docker/blocks/elastic77/metricbeat.yml:/usr/share/metricbeat/metricbeat.yml:ro
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
|
||||
kibana77:
|
||||
image: docker.elastic.co/kibana/kibana:7.7.1
|
||||
ports:
|
||||
- "5601:5601"
|
||||
links:
|
||||
- elasticsearch77
|
||||
environment:
|
||||
ELASTICSEARCH_HOSTS: http://elasticsearch77:9200
|
||||
3
devenv/docker/blocks/elastic77/elasticsearch.yml
Normal file
3
devenv/docker/blocks/elastic77/elasticsearch.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
script.inline: on
|
||||
script.indexed: on
|
||||
xpack.license.self_generated.type: basic
|
||||
1978
devenv/docker/blocks/elastic77/filebeat.yml
Normal file
1978
devenv/docker/blocks/elastic77/filebeat.yml
Normal file
File diff suppressed because it is too large
Load Diff
38
devenv/docker/blocks/elastic77/metricbeat.yml
Normal file
38
devenv/docker/blocks/elastic77/metricbeat.yml
Normal file
@@ -0,0 +1,38 @@
|
||||
metricbeat.config:
|
||||
modules:
|
||||
path: ${path.config}/modules.d/*.yml
|
||||
# Reload module configs as they change:
|
||||
reload.enabled: false
|
||||
|
||||
metricbeat.autodiscover:
|
||||
providers:
|
||||
- type: docker
|
||||
hints.enabled: true
|
||||
|
||||
metricbeat.modules:
|
||||
- module: docker
|
||||
metricsets:
|
||||
- "container"
|
||||
- "cpu"
|
||||
- "diskio"
|
||||
- "healthcheck"
|
||||
- "info"
|
||||
#- "image"
|
||||
- "memory"
|
||||
- "network"
|
||||
hosts: ["unix:///var/run/docker.sock"]
|
||||
period: 10s
|
||||
enabled: true
|
||||
|
||||
processors:
|
||||
- add_cloud_metadata: ~
|
||||
|
||||
output.elasticsearch:
|
||||
hosts: ["elasticsearch77:9200"]
|
||||
index: "metricbeat-%{+yyyy.MM.dd}"
|
||||
|
||||
setup.template.name: "metricbeat"
|
||||
setup.template.pattern: "metricbeat-*"
|
||||
setup.template.settings:
|
||||
index.number_of_shards: 1
|
||||
index.number_of_replicas: 1
|
||||
@@ -1 +0,0 @@
|
||||
elastic_version=8.4.1
|
||||
@@ -1,32 +0,0 @@
|
||||
|
||||
elasticsearch:
|
||||
image: docker.elastic.co/elasticsearch/elasticsearch:${elastic_version}
|
||||
environment:
|
||||
- "discovery.type=single-node"
|
||||
- "xpack.license.self_generated.type=basic"
|
||||
- "xpack.security.enabled=false"
|
||||
ports:
|
||||
- 9200:9200
|
||||
|
||||
kibana:
|
||||
image: docker.elastic.co/kibana/kibana:${elastic_version}
|
||||
environment:
|
||||
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
|
||||
ports:
|
||||
- 5601:5601
|
||||
|
||||
metricbeat-host:
|
||||
image: docker.elastic.co/beats/metricbeat-oss:${elastic_version}
|
||||
command: metricbeat -e -strict.perms=false
|
||||
user: root
|
||||
volumes:
|
||||
- ./docker/blocks/elasticstack/metricbeat.yml:/usr/share/metricbeat/metricbeat.yml:ro
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
|
||||
filebeat-host:
|
||||
image: docker.elastic.co/beats/filebeat-oss:${elastic_version}
|
||||
command: filebeat -e -strict.perms=false
|
||||
volumes:
|
||||
- ./docker/blocks/elasticstack/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro
|
||||
# - /var/log:/var/log:ro
|
||||
- ../data/log:/var/log/grafana:ro
|
||||
@@ -3,7 +3,6 @@
|
||||
ports:
|
||||
- "6831:6831/udp"
|
||||
- "16686:16686"
|
||||
- "14268:14268"
|
||||
# Additional loki to generate some traces
|
||||
# datasource URL: http://localhost:3100/
|
||||
loki:
|
||||
@@ -25,7 +24,7 @@
|
||||
promtail:
|
||||
image: grafana/promtail:master
|
||||
volumes:
|
||||
- ./docker/blocks/loki-promtail/promtail-config.yaml:/etc/promtail/docker-config.yaml
|
||||
- ./docker/blocks/loki/config.yaml:/etc/promtail/docker-config.yaml
|
||||
- /var/log:/var/log
|
||||
- ../data/log:/var/log/grafana
|
||||
command:
|
||||
|
||||
@@ -1687,8 +1687,8 @@ a5a8fed6-0bca-4646-9946-2fe84175353b t f account 0 f d0b8b6b6-2a02-412c-84d1-716
|
||||
77ff47f8-f578-477d-8c06-e70a846332f5 t f broker 0 f 589951e9-e77f-4d1d-90cd-796848190eff \N f \N f grafana openid-connect 0 f f ${client_broker} f client-secret \N \N \N t f f f
|
||||
805aebc8-9d01-42b6-bcce-6ce48ca63ef0 t f security-admin-console 0 t 27d2217e-9934-4971-93b8-77969e47ecf7 /admin/grafana/console/ f \N f grafana openid-connect 0 f f ${client_security-admin-console} f client-secret ${authAdminUrl} \N \N t f f f
|
||||
6bd2d943-9800-4839-9ddc-03c04930cd9f t f admin-cli 0 t da0811c3-5031-4f35-9dc5-441050461a37 \N f \N f grafana openid-connect 0 f f ${client_admin-cli} f client-secret \N \N \N f f t f
|
||||
09b79548-8426-4c0e-8e0b-7488467532c7 t t grafana-oauth 0 f d17b9ea9-bcb1-43d2-b132-d339e55872a8 http://127.0.0.1:8087 f http://127.0.0.1:8087 f grafana openid-connect -1 f f \N f client-secret http://127.0.0.1:8087 \N \N t f t f
|
||||
169f1dea-80f0-4a99-8509-9abb70ab0a5c t t sample-iframe-project 0 t c2ada58a-760e-40d7-8ddc-9ea69b465af2 \N f http://localhost:4200 f grafana openid-connect -1 f f \N f client-secret http://localhost:4200 \N \N t f t f
|
||||
09b79548-8426-4c0e-8e0b-7488467532c7 t t grafana-oauth 0 f d17b9ea9-bcb1-43d2-b132-d339e55872a8 http://env.grafana.local:8087 f http://env.grafana.local:8087 f grafana openid-connect -1 f f \N f client-secret http://env.grafana.local:8087 \N \N t f t f
|
||||
\.
|
||||
|
||||
|
||||
@@ -2243,7 +2243,6 @@ d4b2c483-1dd3-47f6-86bf-42548009918d \N password 74e29604-ff35-42bb-a26d-4d0b81e
|
||||
cb2bd4ed-94b8-4259-bcaa-9250c3fb28d3 \N password 6db3c5e5-b84b-4f9d-a7a8-8d05b03c929d 1657026827644 \N {"value":"q3Z59Nh/5bdezDEpCwEbMPu8d+VgJ5WetafXkR8l0FlsTTkSDQgW+j6GaM3seJR93p3/jCxyfsvZl062d1pq7w==","salt":"ohuHnjLnwF9dBZ38DRJJWg==","additionalParameters":{}} {"hashIterations":27500,"algorithm":"pbkdf2-sha256","additionalParameters":{}} 10
|
||||
b58e1964-6466-40b2-879c-982b724d7f9c \N password 88692d07-bb9a-46cf-844c-7ff5c529cd04 1657026904515 \N {"value":"+/0zWjiJyE3+dCOEf0SO6G3n1/LsFAVoDAZREKTfN4vQ5xJH8srJoCjxcgb+bI1crMr8gknDlFyGRy7CpYn2VQ==","salt":"v/2okNt3wGOZz+x4DjOCDQ==","additionalParameters":{}} {"hashIterations":27500,"algorithm":"pbkdf2-sha256","additionalParameters":{}} 10
|
||||
3ff7dd8f-a299-4b51-bf5d-99665ccfd313 \N password 8f58cbec-6e40-4bab-bff0-1c5ff899fe2e 1657026943075 \N {"value":"nMYodMJMiq/J8g9vRPktGc7WSWnOKr6leMDZX4p9K9KgAUYeXFDSu+d29PWWn0rFn93dL0PNdIdHWNQhfkIDMg==","salt":"rmi9WLHgarmIXGukecSIig==","additionalParameters":{}} {"hashIterations":27500,"algorithm":"pbkdf2-sha256","additionalParameters":{}} 10
|
||||
c9582964-cfdd-49a1-99fb-847604b0c78c \N password 1a85b7e0-4baa-420b-89f8-1cea43a540dd 1662480997923 \N {"value":"ViNTHbpBUNdtH1qGSlip7WFI8Z9lvcGQdbL8Yw48zUgB46jVFbD1eNrOw68p3ovDwfDCIJKm34EFNbw9/uzHSg==","salt":"Z9P8RfnrQwCn0xUTpWC2DQ==","additionalParameters":{}} {"hashIterations":27500,"algorithm":"pbkdf2-sha256","additionalParameters":{}} 10
|
||||
\.
|
||||
|
||||
|
||||
@@ -2600,7 +2599,6 @@ c49bddc6-ec92-4caa-bc04-57ba80a92eb9 grafana f ${role_offline-access} offline_ac
|
||||
c029a218-4519-4537-ae12-d8f3c27a0003 grafana f Grafana Server Admin serveradmin grafana \N grafana
|
||||
c9a776f9-2740-435f-a725-4dbcc17a6c91 grafana f Grafana Viewer viewer grafana \N grafana
|
||||
c4c74006-c346-48cf-8cf1-1617e3e1cde1 grafana f Grafana Editor editor grafana \N grafana
|
||||
31150c12-e9fe-4465-a792-816b7298a595 grafana f Grafana Server Administrator grafanaadmin grafana \N grafana
|
||||
\.
|
||||
|
||||
|
||||
@@ -3010,7 +3008,7 @@ df78645e-c32b-4160-b79f-42e622d71982 String jsonType.label
|
||||
|
||||
COPY public.realm (id, access_code_lifespan, user_action_lifespan, access_token_lifespan, account_theme, admin_theme, email_theme, enabled, events_enabled, events_expiration, login_theme, name, not_before, password_policy, registration_allowed, remember_me, reset_password_allowed, social, ssl_required, sso_idle_timeout, sso_max_lifespan, update_profile_on_soc_login, verify_email, master_admin_client, login_lifespan, internationalization_enabled, default_locale, reg_email_as_username, admin_events_enabled, admin_events_details_enabled, edit_username_allowed, otp_policy_counter, otp_policy_window, otp_policy_period, otp_policy_digits, otp_policy_alg, otp_policy_type, browser_flow, registration_flow, direct_grant_flow, reset_credentials_flow, client_auth_flow, offline_session_idle_timeout, revoke_refresh_token, access_token_life_implicit, login_with_email_allowed, duplicate_emails_allowed, docker_auth_flow, refresh_token_max_reuse, allow_user_managed_access, sso_max_lifespan_remember_me, sso_idle_timeout_remember_me) FROM stdin;
|
||||
master 60 300 60 \N \N \N t f 0 \N master 1643820855 \N f f f f EXTERNAL 1800 36000 f f 3cd285ea-0f6e-43b6-ab5c-d021c33a551b 1800 f \N f f f f 0 1 30 6 HmacSHA1 totp ef998ef5-ca12-45db-a252-2e71b1419039 1695e7d2-ad80-4502-8479-8121a6e2a2f0 5f6f801e-0588-4a6e-860a-35483f5c1ec7 954b046d-2b24-405e-84ee-c44ffe603df2 023dc515-c259-42bb-88a8-2e8d84abca92 2592000 f 900 t f 032b05cf-0007-44da-a370-b42039f6b762 0 f 0 0
|
||||
grafana 60 300 300 \N \N \N t f 0 \N grafana 1662482026 \N f f f f EXTERNAL 1800 36000 f f ef7f6eac-9fff-44aa-a86c-5125d52acc82 1800 f \N f f f f 0 1 30 6 HmacSHA1 totp a38aeb47-f27e-4e68-82ff-7cc7371a47a7 9d02badd-cb1c-4655-bf5e-f888861433ff b478ecfb-db7e-4797-a245-8fc3b4dec884 3085fb68-fc1f-4e1c-a8be-33fb45194b04 cbb4b3ca-ced6-4046-8b59-f1c3959c7948 2592000 f 900 t f 95e02703-f5bc-4e04-8bef-f6adc2d8173f 0 f 0 0
|
||||
grafana 60 300 300 \N \N \N t f 0 \N grafana 1643820879 \N f f f f EXTERNAL 1800 36000 f f ef7f6eac-9fff-44aa-a86c-5125d52acc82 1800 f \N f f f f 0 1 30 6 HmacSHA1 totp a38aeb47-f27e-4e68-82ff-7cc7371a47a7 9d02badd-cb1c-4655-bf5e-f888861433ff b478ecfb-db7e-4797-a245-8fc3b4dec884 3085fb68-fc1f-4e1c-a8be-33fb45194b04 cbb4b3ca-ced6-4046-8b59-f1c3959c7948 2592000 f 900 t f 95e02703-f5bc-4e04-8bef-f6adc2d8173f 0 f 0 0
|
||||
\.
|
||||
|
||||
|
||||
@@ -3161,8 +3159,8 @@ eed689c6-49da-4d91-98eb-cd495bcc07a3 /realms/master/account/*
|
||||
a5a8fed6-0bca-4646-9946-2fe84175353b /realms/grafana/account/*
|
||||
230081b5-9161-45c3-9e08-9eda5412f7f7 /realms/grafana/account/*
|
||||
805aebc8-9d01-42b6-bcce-6ce48ca63ef0 /admin/grafana/console/*
|
||||
09b79548-8426-4c0e-8e0b-7488467532c7 http://127.0.0.1:8088/oauth2/callback
|
||||
169f1dea-80f0-4a99-8509-9abb70ab0a5c http://localhost:4200/*
|
||||
09b79548-8426-4c0e-8e0b-7488467532c7 http://env.grafana.local:8088/oauth2/callback
|
||||
\.
|
||||
|
||||
|
||||
@@ -3327,7 +3325,6 @@ COPY public.user_entity (id, email, email_constraint, email_verified, enabled, f
|
||||
6db3c5e5-b84b-4f9d-a7a8-8d05b03c929d jwt-admin@example.org jwt-admin@example.org f t \N Admin JWT grafana jwt-admin 1657026796311 \N 0
|
||||
88692d07-bb9a-46cf-844c-7ff5c529cd04 jwt-editor@example.com jwt-editor@example.com f t \N Editor JWT grafana jwt-editor 1657026894275 \N 0
|
||||
8f58cbec-6e40-4bab-bff0-1c5ff899fe2e jwt-viewer@example.com jwt-viewer@example.com f t \N Viewer JWT grafana jwt-viewer 1657026933578 \N 0
|
||||
1a85b7e0-4baa-420b-89f8-1cea43a540dd jwt-grafanaadmin@example.com jwt-grafanaadmin@example.com t t \N Grafanaadmin JWT grafana jwt-grafanaadmin 1662480983434 \N 0
|
||||
\.
|
||||
|
||||
|
||||
@@ -3404,11 +3401,6 @@ f1311ecb-6a6a-49d6-bb16-5132daf93a64 8f58cbec-6e40-4bab-bff0-1c5ff899fe2e
|
||||
18a7066b-fe71-410e-9581-69f78347ec29 8f58cbec-6e40-4bab-bff0-1c5ff899fe2e
|
||||
c9a776f9-2740-435f-a725-4dbcc17a6c91 8f58cbec-6e40-4bab-bff0-1c5ff899fe2e
|
||||
c4c74006-c346-48cf-8cf1-1617e3e1cde1 88692d07-bb9a-46cf-844c-7ff5c529cd04
|
||||
c49bddc6-ec92-4caa-bc04-57ba80a92eb9 1a85b7e0-4baa-420b-89f8-1cea43a540dd
|
||||
0f3d47bb-002a-4cd0-a502-725f224308a7 1a85b7e0-4baa-420b-89f8-1cea43a540dd
|
||||
f1311ecb-6a6a-49d6-bb16-5132daf93a64 1a85b7e0-4baa-420b-89f8-1cea43a540dd
|
||||
18a7066b-fe71-410e-9581-69f78347ec29 1a85b7e0-4baa-420b-89f8-1cea43a540dd
|
||||
31150c12-e9fe-4465-a792-816b7298a595 1a85b7e0-4baa-420b-89f8-1cea43a540dd
|
||||
\.
|
||||
|
||||
|
||||
@@ -3443,8 +3435,8 @@ COPY public.username_login_failure (realm_id, username, failed_login_not_before,
|
||||
COPY public.web_origins (client_id, value) FROM stdin;
|
||||
2f521d09-7304-4b5e-a94b-7cc7300b8b50 +
|
||||
805aebc8-9d01-42b6-bcce-6ce48ca63ef0 +
|
||||
09b79548-8426-4c0e-8e0b-7488467532c7 http://127.0.0.1:8087
|
||||
169f1dea-80f0-4a99-8509-9abb70ab0a5c http://localhost:4200
|
||||
09b79548-8426-4c0e-8e0b-7488467532c7 http://env.grafana.local:8087
|
||||
\.
|
||||
|
||||
|
||||
54
devenv/docker/blocks/jwt_proxy/docker-compose.yaml
Normal file
54
devenv/docker/blocks/jwt_proxy/docker-compose.yaml
Normal file
@@ -0,0 +1,54 @@
|
||||
oauthkeycloakdb:
|
||||
image: postgres:12.2
|
||||
container_name: oauthkeycloakdb
|
||||
environment:
|
||||
POSTGRES_DB: keycloak
|
||||
POSTGRES_USER: keycloak
|
||||
POSTGRES_PASSWORD: password
|
||||
volumes:
|
||||
- ./docker/blocks/jwt_proxy/cloak.sql:/docker-entrypoint-initdb.d/cloak.sql
|
||||
restart: unless-stopped
|
||||
|
||||
oauthkeycloak:
|
||||
image: quay.io/keycloak/keycloak:12.0.1
|
||||
container_name: oauthkeycloak
|
||||
environment:
|
||||
DB_VENDOR: POSTGRES
|
||||
DB_ADDR: oauthkeycloakdb
|
||||
DB_DATABASE: keycloak
|
||||
DB_USER: keycloak
|
||||
DB_PASSWORD: password
|
||||
KEYCLOAK_USER: admin
|
||||
KEYCLOAK_PASSWORD: admin
|
||||
PROXY_ADDRESS_FORWARDING: "true"
|
||||
ports:
|
||||
- 8087:8080
|
||||
depends_on:
|
||||
- oauthkeycloakdb
|
||||
links:
|
||||
- "oauthkeycloakdb:oauthkeycloakdb"
|
||||
restart: unless-stopped
|
||||
|
||||
oauthproxy:
|
||||
image: docker.io/bitnami/oauth2-proxy:7.3.0
|
||||
container_name: oauthproxy
|
||||
command: [
|
||||
"--cookie-secret=yI-CWT5s4sBR2Zd0DDJJlTYc0aQ3jwGH15jYA18ZAQA=",
|
||||
"--upstream=http://localhost:3000",
|
||||
"--provider=keycloak",
|
||||
"--client-id=grafana-oauth",
|
||||
"--client-secret=d17b9ea9-bcb1-43d2-b132-d339e55872a8",
|
||||
"--login-url=http://127.0.0.1:8087/auth/realms/grafana/protocol/openid-connect/auth",
|
||||
"--redeem-url=http://127.0.0.1:8087/auth/realms/grafana/protocol/openid-connect/token",
|
||||
"--profile-url=http://127.0.0.1:8087/auth/realms/grafana/protocol/openid-connect/userinfo",
|
||||
"--validate-url=http://127.0.0.1:8087/auth/realms/grafana/protocol/openid-connect/userinfo",
|
||||
"--cookie-secure=false",
|
||||
"--http-address=0.0.0.0:8088",
|
||||
"--redirect-url=http://127.0.0.1:8088/oauth2/callback",
|
||||
"--pass-access-token=true",
|
||||
"--email-domain=*",
|
||||
]
|
||||
network_mode: "host"
|
||||
depends_on:
|
||||
- oauthkeycloak
|
||||
restart: unless-stopped
|
||||
86
devenv/docker/blocks/jwt_proxy/readme.md
Normal file
86
devenv/docker/blocks/jwt_proxy/readme.md
Normal file
@@ -0,0 +1,86 @@
|
||||
# OAUTH BLOCK
|
||||
## Devenv setup jwt auth
|
||||
|
||||
To launch the block, use the oauth source. Ex:
|
||||
|
||||
```bash
|
||||
make devenv sources="jwt_proxy"
|
||||
```
|
||||
|
||||
Here is the conf you need to add to your configuration file (conf/custom.ini):
|
||||
|
||||
```ini
|
||||
[auth]
|
||||
signout_redirect_url = http://127.0.0.1:8088/oauth2/sign_out
|
||||
|
||||
[auth.jwt]
|
||||
enabled = true
|
||||
header_name = X-Forwarded-Access-Token
|
||||
username_claim = login
|
||||
email_claim = email
|
||||
jwk_set_file = devenv/docker/blocks/oauth/jwks.json
|
||||
cache_ttl = 60m
|
||||
expected_claims = {"iss": "http://localhost:8087/auth/realms/grafana", "azp": "grafana-oauth"}
|
||||
auto_sign_up = true
|
||||
```
|
||||
|
||||
Access Grafana through:
|
||||
|
||||
```sh
|
||||
http://127.0.0.1:8088
|
||||
```
|
||||
|
||||
## Devenv setup jwt auth iframe embedding
|
||||
|
||||
- Add previous configuration and next snippet to grafana.ini
|
||||
|
||||
```ini
|
||||
[security]
|
||||
allow_embedding = true
|
||||
```
|
||||
|
||||
- Create dashboard and copy UID
|
||||
|
||||
- Clone [https://github.com/grafana/grafana-iframe-oauth-sample](https://github.com/grafana/grafana-iframe-oauth-sample)
|
||||
|
||||
- Change the dashboard URL in `grafana-iframe-oauth-sample/src/pages/restricted.tsx` to use the dashboard you created (keep URL query values)
|
||||
|
||||
- Start sample app from the `grafana-iframe-oauth-sample` folder with: `yarn start`
|
||||
|
||||
- Navigate to [http://localhost:4200](http://localhost:4200) and press restricted area
|
||||
|
||||
Note: You may need to grant the JWT user in grafana access to the datasources and the dashboard
|
||||
|
||||
## Backing up keycloak DB
|
||||
|
||||
In case you want to make changes to the devenv setup, you can dump keycloack's DB:
|
||||
|
||||
```bash
|
||||
cd devenv;
|
||||
docker-compose exec -T oauthkeycloakdb bash -c "pg_dump -U keycloak keycloak" > docker/blocks/jwt_proxy/cloak.sql
|
||||
```
|
||||
|
||||
## Connecting to keycloack:
|
||||
|
||||
- keycloak admin: http://localhost:8087
|
||||
- keycloak admin login: admin:admin
|
||||
- grafana jwt viewer login: jwt-viewer:grafana
|
||||
- grafana jwt editor login: jwt-editor:grafana
|
||||
- grafana jwt admin login: jwt-admin:grafana
|
||||
|
||||
# Troubleshooting
|
||||
|
||||
## Mac M1 Users
|
||||
|
||||
The new arm64 architecture does not build for the latest docker image of keycloack. Refer to https://github.com/docker/for-mac/issues/5310 for the issue to see if it resolved.
|
||||
Until then you need to build the docker image locally and then run `devenv`.
|
||||
|
||||
1. Remove any lingering keycloack image
|
||||
```sh
|
||||
$ docker rmi $(docker images | grep 'keycloack')
|
||||
```
|
||||
1. Build keycloack image locally
|
||||
```sh
|
||||
$ ./docker-build-keycloack-m1-image.sh
|
||||
```
|
||||
1. Start from beginning of this readme
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user