├── .gitignore
├── Gruntfile.js
├── LICENSE
├── README.md
├── dist
├── LICENSE
├── README.md
├── config_ctrl.d.ts
├── config_ctrl.js
├── config_ctrl.js.map
├── config_ctrl.ts
├── css
│ └── query_editor.css
├── datasource.d.ts
├── datasource.js
├── datasource.js.map
├── datasource.ts
├── druid.d.ts
├── img
│ └── druid_logo.png
├── module.d.ts
├── module.js
├── module.js.map
├── module.ts
├── partials
│ ├── config.html
│ └── query.editor.html
├── plugin.json
├── query_ctrl.d.ts
├── query_ctrl.js
├── query_ctrl.js.map
└── query_ctrl.ts
├── headers
├── common.d.ts
├── es6-shim
│ └── es6-shim.d.ts
├── mocha
│ └── mocha.d.ts
└── zone
│ └── zone.d.ts
├── img
├── AddDataSource.png
├── DruidPanel.png
├── ListDataSource.png
└── druid_logo.png
├── karma.conf.js
├── package-lock.json
├── package.json
├── specs
├── datasource_specs.ts
├── lib
│ ├── common.ts
│ ├── context_srv_stub.ts
│ ├── template_srv_stub.ts
│ └── time_srv_stub.ts
└── query_ctrl_specs.ts
├── src
├── config_ctrl.ts
├── css
│ └── query_editor.css
├── datasource.d.ts
├── datasource.ts
├── druid.d.ts
├── img
│ └── druid_logo.png
├── module.ts
├── partials
│ ├── config.html
│ └── query.editor.html
├── plugin.json
└── query_ctrl.ts
├── tsconfig.json
└── tslint.json
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | npm-debug.log
3 | .DS_Store
4 | .vscode
5 | .tscache
6 | .idea/
7 |
--------------------------------------------------------------------------------
/Gruntfile.js:
--------------------------------------------------------------------------------
1 | module.exports = function(grunt) {
2 | require('load-grunt-tasks')(grunt);
3 |
4 | var pkgJson = require('./package.json');
5 |
6 | grunt.loadNpmTasks('grunt-contrib-clean');
7 | grunt.loadNpmTasks('grunt-ts');
8 | grunt.loadNpmTasks('grunt-contrib-watch');
9 | grunt.loadNpmTasks('grunt-string-replace');
10 |
11 | grunt.initConfig({
12 | clean: ['dist'],
13 |
14 | copy: {
15 | dist_js: {
16 | expand: true,
17 | cwd: 'src',
18 | src: ['**/*.ts', '**/*.d.ts'],
19 | dest: 'dist'
20 | },
21 | dist_html: {
22 | expand: true,
23 | flatten: true,
24 | cwd: 'src/partials',
25 | src: ['*.html'],
26 | dest: 'dist/partials/'
27 | },
28 | dist_css: {
29 | expand: true,
30 | flatten: true,
31 | cwd: 'src/css',
32 | src: ['*.css'],
33 | dest: 'dist/css/'
34 | },
35 | dist_img: {
36 | expand: true,
37 | flatten: true,
38 | cwd: 'src/img',
39 | src: ['*.*'],
40 | dest: 'dist/img/'
41 | },
42 | dist_statics: {
43 | expand: true,
44 | flatten: true,
45 | src: ['src/plugin.json', 'LICENSE', 'README.md'],
46 | dest: 'dist/'
47 | }
48 | },
49 |
50 | ts: {
51 | default: {
52 | src: ['dist/**/*.ts', '!**/*.d.ts'],
53 | dest: 'dist',
54 | options: {
55 | module: 'system',
56 | target: 'es5',
57 | rootDir: 'dist/',
58 | declaration: true,
59 | emitDecoratorMetadata: true,
60 | experimentalDecorators: true,
61 | sourceMap: true,
62 | noImplicitAny: false,
63 | skipLibCheck: true
64 | }
65 | },
66 | },
67 |
68 | 'string-replace': {
69 | dist: {
70 | files: [{
71 | cwd: 'src',
72 | expand: true,
73 | src: ["**/plugin.json"],
74 | dest: 'dist'
75 | }],
76 | options: {
77 | replacements: [{
78 | pattern: '%VERSION%',
79 | replacement: pkgJson.version
80 | },{
81 | pattern: '%TODAY%',
82 | replacement: '<%= grunt.template.today("yyyy-mm-dd") %>'
83 | }]
84 | }
85 | }
86 | },
87 |
88 | watch: {
89 | files: ['src/**/*.ts', 'src/**/*.html', 'src/**/*.css', 'src/img/*.*', 'src/plugin.json', 'README.md'],
90 | tasks: ['default'],
91 | options: {
92 | debounceDelay: 250,
93 | },
94 | }
95 | });
96 |
97 | grunt.registerTask('default', [
98 | 'clean',
99 | 'copy:dist_js',
100 | 'ts',
101 | 'copy:dist_html',
102 | 'copy:dist_css',
103 | 'copy:dist_img',
104 | 'copy:dist_statics',
105 | 'string-replace'
106 | ]);
107 | };
108 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright {2018} {PayPal}
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # UPDATE
2 |
3 | We are working to refresh this codebase. Please see the [milestones](https://github.com/grafana-druid-plugin/druidplugin/milestones) for current estimated dates and related issues / projects for planned work.
4 |
5 | ## Grafana Version Compatibility:
6 | **Druid plugin version 0.0.3 and below are supported for Grafana: 3.x.x**
7 |
8 | **Druid plugin 0.0.4 and above are supported for Grafana: 4.x.x**
9 |
10 | **For latest versions, see https://github.com/grafadruid/druid-grafana**
11 |
12 | # Grafana plugin for [Druid](http://druid.io/) real-time OLAP database
13 |
14 | 
15 | 
16 | 
17 |
18 | ## Status
19 |
20 | This plugin is built on the top of an existing Druid plugin (https://github.com/grafana/grafana-plugins) which used to work on older Grafana versions. With the UI changes done on Grafana-3.0 the existing plugin stopped working. Lot of changes have been made to have it work on Grafana 3.0. It supports timeseries, group by, topN and Select queries.
21 |
22 | Lot of features might still not be implemented. Your contributions are welcome.
23 |
24 | ## Plugin development history
25 |
26 | This plugin was originally developed by Quantiply Corporation (Supported for Grafana versions < 2.5): https://github.com/grafana/grafana-plugins/tree/master/datasources/druid
27 |
28 | This plugin was further enhanced by Carl Bergquist (https://github.com/grafana/grafana/pull/3328) (to support it on Grafana version 2.5 & 2.6).
29 |
30 | I cloned the source from the Pull Request by Carl Bergquist and changed the plugin to have it work on Grafana-3.0.
31 |
32 | All the credits for the original code and enahcement to 2.5 goes to Quantiply and Carl Bergquist.
33 |
34 | Opensourcing all the changes done to the plugin to support Grafana-3.0.
35 |
--------------------------------------------------------------------------------
/dist/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright {2018} {PayPal}
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
--------------------------------------------------------------------------------
/dist/README.md:
--------------------------------------------------------------------------------
1 | # UPDATE
2 |
3 | We are working to refresh this codebase. Please see the [milestones](https://github.com/grafana-druid-plugin/druidplugin/milestones) for current estimated dates and related issues / projects for planned work.
4 |
5 | ## Grafana Version Compatibility:
6 | **Druid plugin version 0.0.3 and below are supported for Grafana: 3.x.x**
7 |
8 | **Druid plugin 0.0.4 and above are supported for Grafana: 4.x.x**
9 |
10 | # Grafana plugin for [Druid](http://druid.io/) real-time OLAP database
11 |
12 | 
13 | 
14 | 
15 |
16 | ## Status
17 |
18 | This plugin is built on the top of an existing Druid plugin (https://github.com/grafana/grafana-plugins) which used to work on older Grafana versions. With the UI changes done on Grafana-3.0 the existing plugin stopped working. Lot of changes have been made to have it work on Grafana 3.0. It supports timeseries, group by, topN and Select queries.
19 |
20 | Lot of features might still not be implemented. Your contributions are welcome.
21 |
22 | ## Plugin development history
23 |
24 | This plugin was originally developed by Quantiply Corporation (Supported for Grafana versions < 2.5): https://github.com/grafana/grafana-plugins/tree/master/datasources/druid
25 |
26 | This plugin was further enhanced by Carl Bergquist (https://github.com/grafana/grafana/pull/3328) (to support it on Grafana version 2.5 & 2.6).
27 |
28 | I cloned the source from the Pull Request by Carl Bergquist and changed the plugin to have it work on Grafana-3.0.
29 |
30 | All the credits for the original code and enahcement to 2.5 goes to Quantiply and Carl Bergquist.
31 |
32 | Opensourcing all the changes done to the plugin to support Grafana-3.0.
--------------------------------------------------------------------------------
/dist/config_ctrl.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | export declare class DruidConfigCtrl {
3 | static templateUrl: string;
4 | current: any;
5 | constructor($scope: any);
6 | }
7 |
--------------------------------------------------------------------------------
/dist/config_ctrl.js:
--------------------------------------------------------------------------------
1 | System.register([], function (exports_1, context_1) {
2 | "use strict";
3 | var DruidConfigCtrl;
4 | var __moduleName = context_1 && context_1.id;
5 | return {
6 | setters: [],
7 | execute: function () {
8 | DruidConfigCtrl = (function () {
9 | function DruidConfigCtrl($scope) {
10 | }
11 | DruidConfigCtrl.templateUrl = 'partials/config.html';
12 | return DruidConfigCtrl;
13 | }());
14 | exports_1("DruidConfigCtrl", DruidConfigCtrl);
15 | }
16 | };
17 | });
18 | //# sourceMappingURL=config_ctrl.js.map
--------------------------------------------------------------------------------
/dist/config_ctrl.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"config_ctrl.js","sourceRoot":"","sources":["config_ctrl.ts"],"names":[],"mappings":";;;;;;;;gBAME,yBAAY,MAAM;gBAClB,CAAC;gBAJM,2BAAW,GAAG,sBAAsB,CAAC;gBAK9C,sBAAC;aAAA,AAND;;QAOA,CAAC"}
--------------------------------------------------------------------------------
/dist/config_ctrl.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | export class DruidConfigCtrl {
4 | static templateUrl = 'partials/config.html';
5 | current: any;
6 |
7 | constructor($scope) {
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/dist/css/query_editor.css:
--------------------------------------------------------------------------------
1 | .min-width-10 {
2 | min-width: 10rem;
3 | }
4 |
5 | .min-width-12 {
6 | min-width: 12rem;
7 | }
8 |
9 | .min-width-20 {
10 | min-width: 20rem;
11 | }
12 |
13 | .gf-form-select-wrapper select.gf-form-input {
14 | height: 2.64rem;
15 | }
16 |
17 | .gf-form-select-wrapper--caret-indent.gf-form-select-wrapper::after {
18 | right: 0.775rem
19 | }
20 |
--------------------------------------------------------------------------------
/dist/datasource.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | import * as Druid from 'druid.d';
3 | export default class DruidDatasource {
4 | id: number;
5 | name: string;
6 | url: string;
7 | q: any;
8 | backendSrv: any;
9 | templateSrv: any;
10 | basicAuth: any;
11 | supportMetrics: any;
12 | periodGranularity: any;
13 | GRANULARITIES: any[][];
14 | filterTemplateExpanders: {
15 | "selector": string[];
16 | "regex": string[];
17 | "javascript": string[];
18 | "search": any[];
19 | };
20 | constructor(instanceSettings: any, $q: any, backendSrv: any, templateSrv: any);
21 | query(options: any): any;
22 | doQuery(from: any, to: any, granularity: any, target: any): any;
23 | splitCardinalityFields(aggregator: any): any;
24 | selectQuery(datasource: string, intervals: Array, granularity: Druid.Granularity, dimensions: Array, metric: Array, filters: Array, selectThreshold: Object): any;
25 | timeSeriesQuery(datasource: string, intervals: Array, granularity: Druid.Granularity, filters: Array, aggregators: Object, postAggregators: Object): any;
26 | topNQuery(datasource: string, intervals: Array, granularity: Druid.Granularity, filters: Array, aggregators: Object, postAggregators: Object, threshold: number, metric: string | Object, dimension: string | Object): any;
27 | groupByQuery(datasource: string, intervals: Array, granularity: Druid.Granularity, filters: Array, aggregators: Object, postAggregators: Object, groupBy: Array, limitSpec: Druid.LimitSpec): any;
28 | druidQuery(query: Druid.AbstractDruidQuery): any;
29 | getLimitSpec(limitNum: any, orderBy: any): {
30 | "type": string;
31 | "limit": any;
32 | "columns": any;
33 | };
34 | testDatasource(): any;
35 | getDataSources(): any;
36 | getDimensionsAndMetrics(datasource: any): any;
37 | getFilterValues(target: any, panelRange: any, query: any): any;
38 | get(relativeUrl: any, params?: any): any;
39 | buildFilterTree(filters: any): Druid.DruidFilter;
40 | getQueryIntervals(from: any, to: any): string[];
41 | getMetricNames(aggregators: any, postAggregators: any): any;
42 | formatTimestamp(ts: any): number;
43 | convertTimeSeriesData(md: any, metrics: any): any;
44 | getGroupName(groupBy: any, metric: any): any;
45 | convertTopNData(md: any, dimension: any, metric: any): any;
46 | convertGroupByData(md: any, groupBy: any, metrics: any): any;
47 | convertSelectData(data: any): any;
48 | dateToMoment(date: any, roundUp: any): any;
49 | computeGranularity(from: any, to: any, maxDataPoints: any): any;
50 | roundUpStartTime(from: any, granularity: any): any;
51 | replaceTemplateValues(obj: any, attrList: any): any;
52 | }
53 |
--------------------------------------------------------------------------------
/dist/datasource.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"datasource.js","sourceRoot":"","sources":["datasource.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;YAOM,qBAAqB,GAAG,uBAAuB,CAAC;YAEtD;gBA+BE,yBAAY,gBAAgB,EAAE,EAAE,EAAE,UAAU,EAAE,WAAW;oBArBzD,kBAAa,GAAG;wBACd,CAAC,QAAQ,EAAE,gBAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;wBACxC,CAAC,QAAQ,EAAE,gBAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;wBACxC,CAAC,gBAAgB,EAAE,gBAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;wBACjD,CAAC,eAAe,EAAE,gBAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;wBAChD,CAAC,MAAM,EAAE,gBAAM,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zB,OAAO,GAAG,gBAAM,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;qBACxC;yBAAM;wBACL,OAAO,GAAG,gBAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;qBAClE;oBACD,OAAO,OAAO,CAAC;gBACjB,CAAC;gBAED,+CAAqB,GAArB,UAAsB,GAAG,EAAE,QAAQ;oBAAnC,iBAKC;oBAJC,IAAM,eAAe,GAAG,QAAQ,CAAC,GAAG,CAAC,UAAA,IAAI;wBACvC,OAAO,KAAI,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;oBAC7C,CAAC,CAAC,CAAC;oBACH,OAAO,gBAAC,CAAC,MAAM,CAAC,gBAAC,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,gBAAC,CAAC,SAAS,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC;gBAC9E,CAAC;gBACH,sBAAC;YAAD,CAAC,AA3kBD,IA2kBC;;QACD,CAAC"}
--------------------------------------------------------------------------------
/dist/datasource.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | import _ from 'lodash';
4 | import moment from 'moment';
5 | import * as dateMath from 'app/core/utils/datemath';
6 | import * as Druid from 'druid.d'
7 |
8 | const DRUID_DATASOURCE_PATH = '/druid/v2/datasources';
9 |
10 | export default class DruidDatasource {
11 | id: number;
12 | name: string;
13 | url: string;
14 | q: any;
15 | backendSrv: any;
16 | templateSrv: any;
17 | basicAuth: any;
18 | supportMetrics: any;
19 | periodGranularity: any;
20 | GRANULARITIES = [
21 | ['second', moment.duration(1, 'second')],
22 | ['minute', moment.duration(1, 'minute')],
23 | ['fifteen_minute', moment.duration(15, 'minute')],
24 | ['thirty_minute', moment.duration(30, 'minute')],
25 | ['hour', moment.duration(1, 'hour')],
26 | ['day', moment.duration(1, 'day')],
27 | ['week', moment.duration(1, 'week')],
28 | ['month', moment.duration(1, 'month')],
29 | ['quarter', moment.duration(1, 'quarter')],
30 | ['year', moment.duration(1, 'year')]
31 | ];
32 | filterTemplateExpanders = {
33 | "selector": ['value'],
34 | "regex": ['pattern'],
35 | "javascript": ['function'],
36 | "search": []
37 | };
38 |
39 |
40 | /** @ngInject */
41 | constructor(instanceSettings, $q, backendSrv, templateSrv) {
42 | this.name = instanceSettings.name;
43 | this.id = instanceSettings.id;
44 | this.url = instanceSettings.url;
45 | this.backendSrv = backendSrv;
46 | this.q = $q;
47 | this.templateSrv = templateSrv;
48 | this.basicAuth = instanceSettings.basicAuth;
49 | instanceSettings.jsonData = instanceSettings.jsonData || {};
50 | this.supportMetrics = true;
51 | this.periodGranularity = instanceSettings.jsonData.periodGranularity;
52 | }
53 |
54 | query(options) {
55 | const from = this.dateToMoment(options.range.from, false);
56 | const to = this.dateToMoment(options.range.to, true);
57 |
58 | let promises = options.targets.map(target => {
59 | if (target.hide === true || _.isEmpty(target.druidDS) || (_.isEmpty(target.aggregators) && target.queryType !== "select")) {
60 | const d = this.q.defer();
61 | d.resolve([]);
62 | return d.promise;
63 | }
64 | const maxDataPointsByResolution = options.maxDataPoints;
65 | const maxDataPointsByConfig = target.maxDataPoints ? target.maxDataPoints : Number.MAX_VALUE;
66 | const maxDataPoints = Math.min(maxDataPointsByResolution, maxDataPointsByConfig);
67 | let granularity = target.shouldOverrideGranularity ? this.templateSrv.replace(target.customGranularity) : this.computeGranularity(from, to, maxDataPoints);
68 | //Round up to start of an interval
69 | //Width of bar chars in Grafana is determined by size of the smallest interval
70 | const roundedFrom = granularity === "all" ? from : this.roundUpStartTime(from, granularity);
71 | if (this.periodGranularity != "") {
72 | if (granularity === 'day') {
73 | granularity = { "type": "period", "period": "P1D", "timeZone": this.periodGranularity }
74 | }
75 | }
76 | return this.doQuery(roundedFrom, to, granularity, target);
77 | });
78 |
79 | return this.q.all(promises).then(results => {
80 | return { data: _.flatten(results) };
81 | });
82 | }
83 |
84 | doQuery(from, to, granularity, target) {
85 | let datasource = target.druidDS;
86 | let filters = target.filters;
87 | let aggregators = target.aggregators.map(this.splitCardinalityFields);
88 | let postAggregators = target.postAggregators;
89 | let groupBy = _.map(target.groupBy, (e) => { return this.templateSrv.replace(e) });
90 | let limitSpec = null;
91 | let metricNames = this.getMetricNames(aggregators, postAggregators);
92 | let intervals = this.getQueryIntervals(from, to);
93 | let promise = null;
94 |
95 | let selectMetrics = target.selectMetrics;
96 | let selectDimensions = target.selectDimensions;
97 | let selectThreshold = target.selectThreshold;
98 | if (!selectThreshold) {
99 | selectThreshold = 5;
100 | }
101 |
102 | if (target.queryType === 'topN') {
103 | let threshold = target.limit;
104 | let metric = target.druidMetric;
105 | let dimension = this.templateSrv.replace(target.dimension);
106 | promise = this.topNQuery(datasource, intervals, granularity, filters, aggregators, postAggregators, threshold, metric, dimension)
107 | .then(response => {
108 | return this.convertTopNData(response.data, dimension, metric);
109 | });
110 | }
111 | else if (target.queryType === 'groupBy') {
112 | limitSpec = this.getLimitSpec(target.limit, target.orderBy);
113 | promise = this.groupByQuery(datasource, intervals, granularity, filters, aggregators, postAggregators, groupBy, limitSpec)
114 | .then(response => {
115 | return this.convertGroupByData(response.data, groupBy, metricNames);
116 | });
117 | }
118 | else if (target.queryType === 'select') {
119 | promise = this.selectQuery(datasource, intervals, granularity, selectDimensions, selectMetrics, filters, selectThreshold);
120 | return promise.then(response => {
121 | return this.convertSelectData(response.data);
122 | });
123 | }
124 | else {
125 | promise = this.timeSeriesQuery(datasource, intervals, granularity, filters, aggregators, postAggregators)
126 | .then(response => {
127 | return this.convertTimeSeriesData(response.data, metricNames);
128 | });
129 | }
130 | /*
131 | At this point the promise will return an list of time series of this form
132 | [
133 | {
134 | target: ,
135 | datapoints: [
136 | [, ],
137 | ...
138 | ]
139 | },
140 | ...
141 | ]
142 |
143 | Druid calculates metrics based on the intervals specified in the query but returns a timestamp rounded down.
144 | We need to adjust the first timestamp in each time series
145 | */
146 | return promise.then(metrics => {
147 | let fromMs = this.formatTimestamp(from);
148 | metrics.forEach(metric => {
149 | if (!_.isEmpty(metric.datapoints[0]) && metric.datapoints[0][1] < fromMs) {
150 | metric.datapoints[0][1] = fromMs;
151 | }
152 | });
153 | return metrics;
154 | });
155 | };
156 |
157 | splitCardinalityFields(aggregator) {
158 | if (aggregator.type === 'cardinality' && typeof aggregator.fieldNames === 'string') {
159 | aggregator.fieldNames = aggregator.fieldNames.split(',')
160 | }
161 | return aggregator;
162 | }
163 |
164 | selectQuery(datasource: string, intervals: Array, granularity: Druid.Granularity,
165 | dimensions: Array, metric: Array, filters: Array,
166 | selectThreshold: Object) {
167 | let query: Druid.DruidSelectQuery = {
168 | "queryType": "select",
169 | "dataSource": datasource,
170 | "granularity": granularity,
171 | "pagingSpec": { "pagingIdentifiers": {}, "threshold": selectThreshold },
172 | "dimensions": dimensions,
173 | "metrics": metric,
174 | "intervals": intervals
175 | };
176 |
177 | if (filters && filters.length > 0) {
178 | query.filter = this.buildFilterTree(filters);
179 | }
180 |
181 | return this.druidQuery(query);
182 | };
183 |
184 | timeSeriesQuery(datasource: string, intervals: Array, granularity: Druid.Granularity,
185 | filters: Array, aggregators: Object, postAggregators: Object) {
186 | let query: Druid.DruidTimeSeriesQuery = {
187 | queryType: "timeseries",
188 | dataSource: datasource,
189 | granularity: granularity,
190 | aggregations: aggregators,
191 | postAggregations: postAggregators,
192 | intervals: intervals
193 | };
194 |
195 | if (filters && filters.length > 0) {
196 | query.filter = this.buildFilterTree(filters);
197 | }
198 |
199 | return this.druidQuery(query);
200 | };
201 |
202 | topNQuery(datasource: string, intervals: Array, granularity: Druid.Granularity,
203 | filters: Array, aggregators: Object, postAggregators: Object,
204 | threshold: number, metric: string | Object, dimension: string | Object) {
205 | const query: Druid.DruidTopNQuery = {
206 | queryType: "topN",
207 | dataSource: datasource,
208 | granularity: granularity,
209 | threshold: threshold,
210 | dimension: dimension,
211 | metric: metric,
212 | aggregations: aggregators,
213 | postAggregations: postAggregators,
214 | intervals: intervals
215 | };
216 |
217 | if (filters && filters.length > 0) {
218 | query.filter = this.buildFilterTree(filters);
219 | }
220 |
221 | return this.druidQuery(query);
222 | };
223 |
224 | groupByQuery(datasource: string, intervals: Array, granularity: Druid.Granularity,
225 | filters: Array, aggregators: Object, postAggregators: Object, groupBy: Array,
226 | limitSpec: Druid.LimitSpec) {
227 | const query: Druid.DruidGroupByQuery = {
228 | queryType: "groupBy",
229 | dataSource: datasource,
230 | granularity: granularity,
231 | dimensions: groupBy,
232 | aggregations: aggregators,
233 | postAggregations: postAggregators,
234 | intervals: intervals,
235 | limitSpec: limitSpec,
236 | };
237 |
238 | if (filters && filters.length > 0) {
239 | query.filter = this.buildFilterTree(filters);
240 | }
241 |
242 | return this.druidQuery(query);
243 | };
244 |
245 | druidQuery(query: Druid.AbstractDruidQuery) {
246 | const options = {
247 | method: 'POST',
248 | url: this.url + '/druid/v2/',
249 | data: query
250 | };
251 | return this.backendSrv.datasourceRequest(options);
252 | };
253 |
254 | getLimitSpec(limitNum, orderBy) {
255 | return {
256 | "type": "default",
257 | "limit": limitNum,
258 | "columns": !orderBy ? null : orderBy.map(col => {
259 | return { "dimension": col, "direction": "DESCENDING" };
260 | })
261 | };
262 | }
263 |
264 | testDatasource() {
265 | return this.get(DRUID_DATASOURCE_PATH).then(() => {
266 | return { status: "success", message: "Druid Data source is working", title: "Success" };
267 | });
268 | }
269 |
270 | //Get list of available datasources
271 | getDataSources() {
272 | return this.get(DRUID_DATASOURCE_PATH).then(response => {
273 | return response.data;
274 | });
275 | };
276 |
277 | getDimensionsAndMetrics(datasource) {
278 | return this.get(DRUID_DATASOURCE_PATH + datasource).then(response => {
279 | return response.data;
280 | });
281 | };
282 |
283 | getFilterValues(target, panelRange, query) {
284 | const topNquery: any = {
285 | "queryType": "topN",
286 | "dataSource": target.druidDS,
287 | "granularity": 'all',
288 | "threshold": 10,
289 | "dimension": target.currentFilter.dimension,
290 | "metric": "count",
291 | "aggregations": [{ "type": "count", "name": "count" }],
292 | "intervals": this.getQueryIntervals(panelRange.from, panelRange.to)
293 | };
294 |
295 | let filters = [];
296 | if (target.filters) {
297 | filters =
298 | filters = _.cloneDeep(target.filters);
299 | }
300 | filters.push({
301 | "type": "search",
302 | "dimension": target.currentFilter.dimension,
303 | "query": {
304 | "type": "insensitive_contains",
305 | "value": query
306 | }
307 | });
308 | topNquery.filter = this.buildFilterTree(filters);
309 |
310 | return this.druidQuery(topNquery);
311 | };
312 |
313 | get(relativeUrl, params?) {
314 | return this.backendSrv.datasourceRequest({
315 | method: 'GET',
316 | url: this.url + relativeUrl,
317 | params: params,
318 | });
319 | };
320 |
321 | buildFilterTree(filters): Druid.DruidFilter {
322 | //Do template variable replacement
323 | const replacedFilters = filters.map(filter => {
324 | return this.replaceTemplateValues(filter, this.filterTemplateExpanders[filter.type]);
325 | })
326 | .map(filter => {
327 | const finalFilter = _.omit(filter, 'negate');
328 | if (filter.negate) {
329 | return { "type": "not", "field": finalFilter };
330 | }
331 | return finalFilter;
332 | });
333 | if (replacedFilters) {
334 | if (replacedFilters.length === 1) {
335 | return replacedFilters[0];
336 | }
337 | return {
338 | "type": "and",
339 | "fields": replacedFilters
340 | };
341 | }
342 | return null;
343 | }
344 |
345 | getQueryIntervals(from, to) {
346 | return [from.toISOString() + '/' + to.toISOString()];
347 | }
348 |
349 | getMetricNames(aggregators, postAggregators) {
350 | const displayAggs = _.filter(aggregators, agg => {
351 | return agg.type !== 'approxHistogramFold' && agg.hidden != true;
352 | });
353 | return _.union(_.map(displayAggs, 'name'), _.map(postAggregators, 'name'));
354 | }
355 |
356 | formatTimestamp(ts) {
357 | return moment(ts).format('X') * 1000;
358 | }
359 |
360 | convertTimeSeriesData(md, metrics) {
361 | return metrics.map(metric => {
362 | return {
363 | target: metric,
364 | datapoints: md.map(item => {
365 | return [
366 | item.result[metric],
367 | this.formatTimestamp(item.timestamp)
368 | ];
369 | })
370 | };
371 | });
372 | }
373 |
374 | getGroupName(groupBy, metric) {
375 | return groupBy.map(dim => {
376 | return metric.event[dim];
377 | })
378 | .join("-");
379 | }
380 |
381 | convertTopNData(md, dimension, metric) {
382 | /*
383 | Druid topN results look like this:
384 | [
385 | {
386 | "timestamp": "ts1",
387 | "result": [
388 | {"": d1, "": mv1},
389 | {"": d2, "": mv2}
390 | ]
391 | },
392 | {
393 | "timestamp": "ts2",
394 | "result": [
395 | {"": d1, "": mv3},
396 | {"": d2, "": mv4}
397 | ]
398 | },
399 | ...
400 | ]
401 | */
402 |
403 | /*
404 | First, we need make sure that the result for each
405 | timestamp contains entries for all distinct dimension values
406 | in the entire list of results.
407 |
408 | Otherwise, if we do a stacked bar chart, Grafana doesn't sum
409 | the metrics correctly.
410 | */
411 |
412 | //Get the list of all distinct dimension values for the entire result set
413 | const dVals = md.reduce((dValsSoFar, tsItem) => {
414 | const dValsForTs = _.map(tsItem.result, dimension);
415 | return _.union(dValsSoFar, dValsForTs);
416 | }, {});
417 |
418 | //Add null for the metric for any missing dimension values per timestamp result
419 | md.forEach(tsItem => {
420 | const dValsPresent = _.map(tsItem.result, dimension);
421 | const dValsMissing = _.difference(dVals, dValsPresent);
422 | dValsMissing.forEach(dVal => {
423 | const nullPoint = {};
424 | nullPoint[dimension] = dVal;
425 | nullPoint[metric] = null;
426 | tsItem.result.push(nullPoint);
427 | });
428 | return tsItem;
429 | });
430 |
431 | //Re-index the results by dimension value instead of time interval
432 | const mergedData = md.map(item => {
433 | /*
434 | This first map() transforms this into a list of objects
435 | where the keys are dimension values
436 | and the values are [metricValue, unixTime] so that we get this:
437 | [
438 | {
439 | "d1": [mv1, ts1],
440 | "d2": [mv2, ts1]
441 | },
442 | {
443 | "d1": [mv3, ts2],
444 | "d2": [mv4, ts2]
445 | },
446 | ...
447 | ]
448 | */
449 | const timestamp = this.formatTimestamp(item.timestamp);
450 | const keys = _.map(item.result, dimension);
451 | const vals = _.map(item.result, metric).map(val => { return [val, timestamp]; });
452 | return _.zipObject(keys, vals);
453 | })
454 | .reduce((prev, curr) => {
455 | /*
456 | Reduce() collapses all of the mapped objects into a single
457 | object. The keys are dimension values
458 | and the values are arrays of all the values for the same key.
459 | The _.assign() function merges objects together and it's callback
460 | gets invoked for every key,value pair in the source (2nd argument).
461 | Since our initial value for reduce() is an empty object,
462 | the _.assign() callback will get called for every new val
463 | that we add to the final object.
464 | */
465 | return _.assignWith(prev, curr, (pVal, cVal) => {
466 | if (pVal) {
467 | pVal.push(cVal);
468 | return pVal;
469 | }
470 | return [cVal];
471 | });
472 | }, {});
473 |
474 | //Convert object keyed by dimension values into an array
475 | //of objects {target: , datapoints: }
476 | return _.map(mergedData, (vals, key) => {
477 | return {
478 | target: key,
479 | datapoints: vals
480 | };
481 | });
482 | }
483 |
484 | convertGroupByData(md, groupBy, metrics) {
485 | const mergedData = md.map(item => {
486 | /*
487 | The first map() transforms the list Druid events into a list of objects
488 | with keys of the form ":" and values
489 | of the form [metricValue, unixTime]
490 | */
491 | const groupName = this.getGroupName(groupBy, item);
492 | const keys = metrics.map(metric => {
493 | return groupName + ":" + metric;
494 | });
495 | const vals = metrics.map(metric => {
496 | return [
497 | item.event[metric],
498 | this.formatTimestamp(item.timestamp)
499 | ];
500 | });
501 | return _.zipObject(keys, vals);
502 | })
503 | .reduce((prev, curr) => {
504 | /*
505 | Reduce() collapses all of the mapped objects into a single
506 | object. The keys are still of the form ":"
507 | and the values are arrays of all the values for the same key.
508 | The _.assign() function merges objects together and it's callback
509 | gets invoked for every key,value pair in the source (2nd argument).
510 | Since our initial value for reduce() is an empty object,
511 | the _.assign() callback will get called for every new val
512 | that we add to the final object.
513 | */
514 | return _.assignWith(prev, curr, (pVal, cVal) => {
515 | if (pVal) {
516 | pVal.push(cVal);
517 | return pVal;
518 | }
519 | return [cVal];
520 | });
521 | }, {});
522 |
523 | return _.map(mergedData, (vals, key) => {
524 | /*
525 | Second map converts the aggregated object into an array
526 | */
527 | return {
528 | target: key,
529 | datapoints: vals
530 | };
531 | });
532 | }
533 |
534 | convertSelectData(data) {
535 | const resultList = _.map(data, "result");
536 | const eventsList = _.map(resultList, "events");
537 | const eventList = _.flatten(eventsList);
538 | const result = {};
539 | for (let i = 0; i < eventList.length; i++) {
540 | const event = eventList[i].event;
541 | const timestamp = event.timestamp;
542 | if (_.isEmpty(timestamp)) {
543 | continue;
544 | }
545 | for (const key in event) {
546 | if (key !== "timestamp") {
547 | if (!result[key]) {
548 | result[key] = { "target": key, "datapoints": [] };
549 | }
550 | result[key].datapoints.push([event[key], timestamp]);
551 | }
552 | }
553 | }
554 | return _.values(result);
555 | }
556 |
557 | dateToMoment(date, roundUp) {
558 | if (date === 'now') {
559 | return moment();
560 | }
561 | date = dateMath.parse(date, roundUp);
562 | return moment(date.valueOf());
563 | }
564 |
565 | computeGranularity(from, to, maxDataPoints) {
566 | const intervalSecs = to.unix() - from.unix();
567 | /*
568 | Find the smallest granularity for which there
569 | will be fewer than maxDataPoints
570 | */
571 | const granularityEntry = _.find(this.GRANULARITIES, gEntry => {
572 | return Math.ceil(intervalSecs / gEntry[1].asSeconds()) <= maxDataPoints;
573 | });
574 |
575 | return granularityEntry[0];
576 | }
577 |
578 | roundUpStartTime(from, granularity) {
579 | const duration = _.find(this.GRANULARITIES, gEntry => {
580 | return gEntry[0] === granularity;
581 | })[1];
582 | let rounded = null;
583 | if (granularity === 'day') {
584 | rounded = moment(+from).startOf('day');
585 | } else {
586 | rounded = moment(Math.ceil((+from) / (+duration)) * (+duration));
587 | }
588 | return rounded;
589 | }
590 |
591 | replaceTemplateValues(obj, attrList) {
592 | const substitutedVals = attrList.map(attr => {
593 | return this.templateSrv.replace(obj[attr]);
594 | });
595 | return _.assign(_.clone(obj, true), _.zipObject(attrList, substitutedVals));
596 | }
597 | }
598 |
--------------------------------------------------------------------------------
/dist/druid.d.ts:
--------------------------------------------------------------------------------
1 | export interface AbstractDruidQuery {
2 | dataSource: string;
3 | intervals: Array;
4 | granularity: Granularity;
5 | queryType: string;
6 | filter?: DruidFilter;
7 | aggregations?: Object;
8 | postAggregations?: Object;
9 | context?: Object;
10 | }
11 |
12 | export enum Granularity {
13 | all = 'all',
14 | none = 'none',
15 | second = 'second',
16 | minute = 'minute',
17 | fifteen_minute = 'fifteen_minute',
18 | thirty_minute = 'thirty_minute',
19 | hour = 'hour',
20 | day = 'day',
21 | week = 'week',
22 | month = 'month',
23 | quarter = 'quarter',
24 | year = 'year'
25 | }
26 |
27 | export interface LimitSpec {
28 | type: 'default';
29 | limit: number;
30 | columns: Array;
31 | }
32 |
33 | export interface OrderByColumnSpec {
34 | dimension: string;
35 | direction: 'ascending' | 'descending';
36 | dimensionOrder: 'lexicographic' | 'alphanumeric' | 'strlen' | 'numeric';
37 | }
38 |
39 | export interface DruidGroupByQuery extends AbstractDruidQuery {
40 | queryType: 'groupBy';
41 | dimensions: Array;
42 | limitSpec?: LimitSpec;
43 | having?: Object;
44 | }
45 |
46 | export interface DruidTimeSeriesQuery extends AbstractDruidQuery {
47 | queryType: 'timeseries';
48 | descending?: 'true' | 'false';
49 | }
50 |
51 | export interface DruidTopNQuery extends AbstractDruidQuery {
52 | queryType: 'topN';
53 | dimension: string | Object;
54 | threshold: number;
55 | metric: string | Object;
56 | }
57 |
58 | export interface DruidSelectQuery extends AbstractDruidQuery {
59 | pagingSpec: {
60 | pagingIdentifiers: {};
61 | threshold: Object;
62 | };
63 | dimensions: Array;
64 | metrics: Array;
65 | }
66 |
67 | export interface DruidFilterLogical {
68 | type: 'or' | 'and';
69 | fields: DruidFilter[];
70 | }
71 |
72 | export interface DruidFilterNot {
73 | type: 'not';
74 | field: DruidFilter;
75 | }
76 |
77 | export interface DruidFilterSelect {
78 | type: 'selector';
79 | dimension: string;
80 | value: string;
81 | }
82 |
83 | export interface DruidFilterIn {
84 | type: string;
85 | dimension: string;
86 | values: Array;
87 | }
88 |
89 | export interface DruidFilterRegex {
90 | type: 'regex';
91 | dimension: string;
92 | pattern: string;
93 | }
94 |
95 | export type DruidFilter = DruidFilterLogical | DruidFilterSelect | DruidFilterRegex | DruidFilterIn | DruidFilterNot;
--------------------------------------------------------------------------------
/dist/img/druid_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grafana-druid-plugin/druidplugin/33af5d544755a7bbcf7d72fcbd9673ef66a2840c/dist/img/druid_logo.png
--------------------------------------------------------------------------------
/dist/module.d.ts:
--------------------------------------------------------------------------------
1 | import DruidDatasource from './datasource';
2 | import { DruidQueryCtrl } from './query_ctrl';
3 | import { DruidConfigCtrl } from './config_ctrl';
4 | export { DruidDatasource as Datasource, DruidQueryCtrl as QueryCtrl, DruidConfigCtrl as ConfigCtrl };
5 |
--------------------------------------------------------------------------------
/dist/module.js:
--------------------------------------------------------------------------------
1 | System.register(["./datasource", "./query_ctrl", "./config_ctrl"], function (exports_1, context_1) {
2 | "use strict";
3 | var datasource_1, query_ctrl_1, config_ctrl_1, DruidAnnotationsQueryCtrl;
4 | var __moduleName = context_1 && context_1.id;
5 | return {
6 | setters: [
7 | function (datasource_1_1) {
8 | datasource_1 = datasource_1_1;
9 | },
10 | function (query_ctrl_1_1) {
11 | query_ctrl_1 = query_ctrl_1_1;
12 | },
13 | function (config_ctrl_1_1) {
14 | config_ctrl_1 = config_ctrl_1_1;
15 | }
16 | ],
17 | execute: function () {
18 | exports_1("Datasource", datasource_1.default);
19 | exports_1("QueryCtrl", query_ctrl_1.DruidQueryCtrl);
20 | exports_1("ConfigCtrl", config_ctrl_1.DruidConfigCtrl);
21 | DruidAnnotationsQueryCtrl = (function () {
22 | function DruidAnnotationsQueryCtrl() {
23 | }
24 | DruidAnnotationsQueryCtrl.templateUrl = 'partials/annotations.editor.html';
25 | return DruidAnnotationsQueryCtrl;
26 | }());
27 | }
28 | };
29 | });
30 | //# sourceMappingURL=module.js.map
--------------------------------------------------------------------------------
/dist/module.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"module.js","sourceRoot":"","sources":["module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;oCAAO,oBAAe;mCACd,2BAAc;oCACd,6BAAe;;gBAEvB;gBAEA,CAAC;gBADQ,qCAAW,GAAG,kCAAkC,CAAC;gBAC1D,gCAAC;aAAA,AAFD;QASA,CAAC"}
--------------------------------------------------------------------------------
/dist/module.ts:
--------------------------------------------------------------------------------
1 | import DruidDatasource from './datasource';
2 | import {DruidQueryCtrl} from './query_ctrl';
3 | import {DruidConfigCtrl} from './config_ctrl';
4 |
5 | class DruidAnnotationsQueryCtrl {
6 | static templateUrl = 'partials/annotations.editor.html';
7 | }
8 |
9 | export {
10 | DruidDatasource as Datasource,
11 | DruidQueryCtrl as QueryCtrl,
12 | DruidConfigCtrl as ConfigCtrl
13 | };
14 |
--------------------------------------------------------------------------------
/dist/partials/config.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Druid Settings
4 |
5 | Period Granularity
6 |
7 |
119 | This enables the to query hourly data in different timezone.
120 |