1 2 Previous Next 25 Replies Latest reply on Aug 28, 2017 11:48 AM by Russell Goldin

    Open Source InfluxDB WDC

    Russell Goldin

      Hi everyone,

       

      I built a WDC for InfluxDB that I'd like to share with everyone.  I have it hosted on Github (instructions = https://tagyoureit.github.io/InfluxDB_WDC) with web access to the WDC through the direct URL InfluxDB Feed

       

      InfluxDB_WDC.jpg

       

      Here are some of the features that are built into the connector:

      • HTTP/HTTPS
      • Basic Auth / No Auth
      • Ability to bring back data with aggregation at different intervals or bring back raw data

       

      Limitation:

      • Only admins are able to retrieve the list of databases.  If you want to enable access from users with read/write only security you will need to start with an admin user to retrieve the databases.  After that, if you publish to Tableau Server you can embed (or prompt with) different users.  If there is a need, it could be possible to alter the WDC to allow a user to manually enter a database.

       

      See my notes in the instructions page above about some notes on aggregation.  Looking forward to your feedback,

      Russ

        • 1. Re: Open Source InfluxDB WDC
          Lénaïc Riédinger

          Amazing job Russell Goldin!

           

          Love it, I moved it to our Web Data Connector space, for everyone to see & use.

          Cheers,

           

          ----------

          Lénaïc RIÉDINGER, Global Community Engineer Tableau

          Tableau Community Forums | Knowledge Base

          If you see a Helpful or Correct response, please mark it thanks to the buttons below the targeted post!

          • 2. Re: Open Source InfluxDB WDC
            Sharna Bourke

            I am getting the following error:

            Error loading database{"readyState":0,"responseText":"","status":0,"statusText":"error"}

             

            Any ideas?

            I am logging in as Admin

            • 3. Re: Open Source InfluxDB WDC
              Russell Goldin

              Yes... it depends on when you are getting the error.  Try the following, and in each of these, replace "localhost:8086" with your server:port combination.

               

              1.  Make sure you can reach the database with the HTTP calls.  Run

                 curl -i 'http://localhost:8086/ping'

              in a terminal prompt.  (This is on Mac/Linux.  If you are on Windows, you can skip to the next step and see if you get a response or download a cURL program for Windows.)  This is my response.  This tells me that the server is up and running and it is version 1.2.4.

              $ curl -i 'http://localhost:8086/ping'

              HTTP/1.1 204 No Content

              Content-Type: application/json

              Request-Id: ebed4c59-51c4-11e7-8003-000000000000

              X-Influxdb-Version: v1.2.4

              Date: Thu, 15 Jun 2017 12:19:47 GMT

               

              2.  Can you see the databases?  Run one of the following from a web browser:

              Without auth: http://localhost:8086/query?q=show+databases

              With auth: http://localhost:8086/query?q=show+databases&u=<USERNAME>&p=<PASSWORD> (replace the <VARIABLES> with your own values)

               

              Result should be like:

              {"results":[{"statement_id":0,"series":[{"name":"databases","columns":["name"],"values":[["_internal"],["pool"],["pool_test"],["food"],["food_data"],["system"]]}]}]}

               

              3.  Can you see the measurements in the DB?

              Without auth: http://localhost:8086/query?q=show+measurements&db=<DATABASE>

              With auth: http://localhost:8086/query?q=show+measurements&db=<DATABASE>&u=<USERNAME>&p=<PASSWORD>

               

              Results should be like:

              {"results":[{"statement_id":0,"series":[{"name":"measurements","columns":["name"],"values":[["chlorinator"],["circuits"],["pumps"],["temperatures"]]}]}]}

               

              If you can return data from these, you should be able to also get back the fields and tags.  Let me know at what point you see this error.  If it is when you are trying to get data back, if you can post some samples of your data.  I think you might have trouble with step 2 above based on the error message you posted.

              • 4. Re: Open Source InfluxDB WDC
                Russell Goldin

                So... after all of that I just ran into the same issue.  Very interesting that I didn't encounter it before.  I added some code to further support CORS, (which is updated on the hosted connector), but I was still seeing the issue with full refreshes (but not incremental ones).  I was also able to create a new connection and retrieve data, so this one might be hard to nail down but I'll work with the Devs here to see what we can come up with.

                 

                Try it again and see if it works differently for you.  Also, if you have a local web server you might want to try and host it locally.

                 

                Russ

                • 5. Re: Open Source InfluxDB WDC
                  Russell Goldin

                  Sharna,

                   

                  Try this again.  This was very trick to track down this issue, but if you want to see what it was you can read my bug report on Github.  Please try it again now and it should work (fingers crossed).

                   

                  Russ

                  • 6. Re: Open Source InfluxDB WDC
                    Sharna Bourke

                    Russell,

                    Admire your commitment to finding the issue! It is working amazing. Best connector yet

                     

                    Thanks

                     

                    Sharna

                    • 7. Re: Open Source InfluxDB WDC
                      Russell Goldin

                      Fantastic!  I hope that you'll be able to share some of the fantastic dashboards that you're excited to be building. 

                      • 8. Re: Open Source InfluxDB WDC
                        Russell Goldin

                        I updated the code on the WDC.  The biggest change is that it will restore the previous values when you edit a connection.  Alerts are now dismissible and have more information (in certain situations).  And there are "," separators in the progress indicator for # of rows being processed.

                        • 9. Re: Open Source InfluxDB WDC
                          Sharna Bourke

                          Hi Russel,

                           

                          I have a new one for you.

                           

                          I am getting this error: TypeError: undefined is not an object (evaluating 'tags.results[0].series[0]') file: https://tagyoureit.github.io/InfluxDB_WDC/InfluxDB_WDC.js line: 50.

                           

                          I can successfully connect to the connector and load databases. However, when I select a database and click load data I get the error.

                           

                          Interestingly, I only get it on some databases and others load successfully.

                          • 10. Re: Open Source InfluxDB WDC
                            Russell Goldin

                            Is it a very large database?  Can you run this query and post the results?

                             

                            http://<server>:8086/query?q=SHOW+TAG+KEYS+FROM+"<measurement>"&db=<database>

                             

                            If you have lots of measurements, see if there are any that don't follow this pattern:

                             

                            {"results":[{"statement_id":0,"series":[{"name":"test","columns":["tagKey"],"values":[["name"],["status"],["superTest"]]}]}]}

                             

                            EG, if there are multiple series or multiple result sets that could be an issue that we need to address. 

                            • 11. Re: Open Source InfluxDB WDC
                              Rishma Gupta

                              Hi Russell,

                               

                              I am trying to add this connector for integrating influxdb with tableau. And unable to understand the exact installation steps.

                               

                              I have installed tableau and downloaded influxdb_WDC-gh-pages from Github. Could you please guide me where to keep this connector along with path and what link should I use to open the connector. Sorry I am new to tableau .

                               

                              Thanks,

                              • 12. Re: Open Source InfluxDB WDC
                                Russell Goldin

                                I would suggest that you just use the hosted version, but here are your three options:

                                 

                                Using the hosted version

                                1. Open Tableau Desktop
                                2. Choose Web Data Connector
                                3. Enter https://tagyoureit.github.io/InfluxDB_WDC/InfluxDB.html as the URL for your connector.  Off you go!

                                 

                                Or, install it on a local machine

                                1. Download the GitHub site as you did
                                2. Install a web server such as MAMP
                                3. You'll need to follow the specific instructions for whichever web server you choose, but the link would be something like http://localhost:8888/gh-pages/InfluxDB_WDC/InfluxDB.html
                                4. Follow steps 1-3 above, but put in your local address as it corresponds to your local server

                                 

                                Or, install the connector on your Tableau server.  You can follow these directions.  But you need to have help from your server admin to do this.

                                 

                                You might be wondering about security concerns.  With the hosted version, the only thing you load from the public web is the connector itself.  All communications between your desktop machine and InfluxDB are still on your local network.  Nothing gets passed back to Github or Tableau.

                                 

                                hope this helps

                                • 13. Re: Open Source InfluxDB WDC
                                  Rishma Gupta

                                  Thank you Russell.

                                   

                                  I have connected the web connector . I see the database are loaded.

                                   

                                  But I see the error later on clicking the load data to tableau:

                                   

                                  Error creating object for class TableInfo. The input data for one of the contained objects is invalid. Either invalid data are present or required fields are empty for class ColumnInfo. Required fields and respective data types are: { (Name : 'id', Type : QString, IsRequired : true), (Name : 'dataType', Type : QString, IsRequired : true), (Name : 'alias', Type : QString, IsRequired : false), (Name : 'hidden', Type : bool, IsRequired : false), (Name : 'description', Type : QString, IsRequired : false), (Name : 'isPrimaryKey', Type : bool, IsRequired : false), (Name : 'foreignKey', Type : QVariantMap, IsRequired : false), (Name : 'columnRole', Type : QString, IsRequired : false), (Name : 'columnType', Type : QString, IsRequired : false), (Name : 'aggType', Type : QString, IsRequired : false), (Name : 'geoRole', Type : QString, IsRequired : false), (Name : 'defaultFormat', Type : QVariantMap, IsRequired : false), (Name : 'filterable', Type : bool, IsRequired : false) }

                                   

                                  Please help.

                                  • 14. Re: Open Source InfluxDB WDC
                                    Russell Goldin

                                    Can you post your schema (including data types) and some sample data.  I am not sure why that error is being thrown.

                                    1 2 Previous Next