Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Kadira integration #2152

Closed
GavinLilly opened this issue Feb 1, 2019 · 12 comments
Closed

Feature Request: Kadira integration #2152

GavinLilly opened this issue Feb 1, 2019 · 12 comments

Comments

@GavinLilly
Copy link
Contributor

Issue

Server Setup Information:

  • Did you test in newest Wekan?: No
  • For new Wekan install, did you configure root-url correctly https://github.com/wekan/wekan/wiki/Settings ? Yes
  • Wekan version: 1.98
  • If this is about old version of Wekan, what upgrade problem you have?: None. We just can't update often in our organisation
  • Operating System: RHEL 7
  • Deployment Method(snap/docker/sandstorm/mongodb bundle/source): Docker swarm
  • Http frontend if any (Caddy, Nginx, Apache, see config examples from Wekan GitHub wiki first): Nginx inside Docker Swarm
  • Node Version: 8.15
  • MongoDB Version: 3.2
  • ROOT_URL environment variable http(s):https://(subdomain).example.com(/suburl): https://Wekan.internal.domain.name

Problem description:
I've tried setting up Kadira to analyse Wekan performance but it just doesn't seem to work. I added the KADIRA_OPTIONS_ENDPOINT environment variable and pointed it at the Kadira Engine URL but no data is being sent. From what I've seen there should be something inside the application which initiates the Kadira connection (Kadira.Connect see here). Has anyone else used Kadira already with Wekan?

@xet7
Copy link
Member

xet7 commented Feb 1, 2019

I did begin to test Kadira, but did not finish setting it up completely. At that time I did add links to Kadira here:
https://github.com/wekan/wekan/wiki/Debugging

There is no actual Kadira integration yet in Wekan.

About performance, latest Wekan v2.13 that was released today loads only visible cards with infinite scrolling code, so it could help with big Wekan boards, and maybe also with performance, but I don't know yet, because I have not yet done testing with big boards.

@xet7 xet7 changed the title Is Kadira integration working? Feature Request: Kadira integration Feb 1, 2019
@GavinLilly
Copy link
Contributor Author

Ok that explains a lot.

I'll create the integration for Kadira in a PR but I have no way to test it at the moment as we don't have a suitable test environment in our organisation at the moment

@GavinLilly
Copy link
Contributor Author

I've managed to add Kadira to the Wekan build but then when trying to run I get an error TypeError: Cannot read property 'toLowerCase' of undefined.

I'm still trying to debug it at the moment (which is difficult in itself when using Docker) but hopefully will have something new soon

@GavinLilly
Copy link
Contributor Author

GavinLilly commented Feb 11, 2019

It looks like it could be an issue in the Kadira code that isn't being fixed because Kadira isn't being maintained any longer meteorhacks/kadira#259

@xet7
Copy link
Member

xet7 commented Feb 11, 2019

@GavinLilly

Can you see from webbrowser inspect where in code that TypeError is? For example, some lines of code from above to below so the same could be found from source code, with some keyword search, like using script find.sh that is at https://github.com/wekan/wekan , and using it to find same code from kadira repo recursively.

@xet7
Copy link
Member

xet7 commented Feb 11, 2019

@GavinLilly

How did you setup Kadira? I would like to also try it on my server.

@GavinLilly
Copy link
Contributor Author

I'll post up a how-to when I get home as I did it on my personal server. I noticed that the mdg:meteor-apm-agent package is actually a supported fork of Kadira by the Meteor people so I'm going to try that instead. It looks like it has a fix for the issue I experienced

@xet7
Copy link
Member

xet7 commented Feb 11, 2019

From GitHub network it seems that newest maintained repo is here:
https://github.com/meteor/meteor-apm-agent

@GavinLilly
Copy link
Contributor Author

Yea I'm building a new version now using meteor-apm-agent. Will report back soon

@GavinLilly
Copy link
Contributor Author

GavinLilly commented Feb 11, 2019

Ok I had a few issues building but they seem to be corrected now. It was having trouble running when the wekan-ldap package was enabled (I guess some compatibility issue). For now I've removed it so I can test if meteor-apm works and I can confirm it does. I can see all Kadira metric in a dashboard.
So to recap I have meteor-apm-agent as a package on Wekan and a Kadira stack running in Docker. To get Kadira running I ran the following in docker-compose:

kadira-engine:
    ## This is the endpoint where Meteor app sends performance data
    image: vladgolubev/kadira-engine
    ports:
      - "11011:11011"
    environment:
      - PORT=11011
      - MONGO_URL=mongodb:https://wekandb:27017/kadira?replicaSet=kadira
      - MONGO_SHARD_URL_one=mongodb:https://wekandb:27017/kadira?replicaSet=kadira
    networks:
      - wekan-tier
    restart: always

  kadira-rma:
    ## This computes statistics databases every minute.
    image: vladgolubev/kadira-rma
    environment:
      - MONGO_URL=mongodb:https://wekandb:27017/kadira
    networks:
      - wekan-tier
    restart: always

  kadira-ui:
    ## Meteor app that presents the Kadira user interface.
    image: vladgolubev/kadira-ui
    ports:
      #- "80:4000"
      - "4000:4000"
    environment:
      - MONGO_URL=mongodb:https://wekandb:27017/kadira
      - MONGO_SHARD_URL_one=mongodb:https://wekandb:27017/kadira
    networks:
      - wekan-tier
    restart: always

Essentially I followed the outline at https://github.com/edemaine/kadira-compose but instead of running the full Kadira stack I picked and chose the engine, rma and ui and put it into the same docker-compose as my test Wekan instance.
I've created a branch in my forked repo https://github.com/GavinLilly/wekan/tree/kadira-integration. If I can figure out the conflict with Wekan-LDAP then I'll create a pull request

@GavinLilly
Copy link
Contributor Author

I'm not having much luck debugging this error. I see where it's happening but I don't see why the code is being called when Kadira is part of the build. Posting here in case anyone has any idea

W20190212-21:41:12.564(0)? (STDERR) /home/gavin/.meteor/packages/meteor-tool/.1.6.0_1.1w8g1l.5l89c++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:280
W20190212-21:41:12.565(0)? (STDERR)                                             throw(ex);
W20190212-21:41:12.565(0)? (STDERR)                                             ^
W20190212-21:41:12.566(0)? (STDERR)
W20190212-21:41:12.566(0)? (STDERR) TypeError: Cannot read property 'toLowerCase' of undefined
W20190212-21:41:12.566(0)? (STDERR)     at DocSzCacheItem.value (packages/wekan:wekan-ldap/server/sync.js:13:41)
W20190212-21:41:12.567(0)? (STDERR)     at DocSzCache.getSize (packages/mdg_meteor-apm-agent.js:2187:15)
W20190212-21:41:12.567(0)? (STDERR)     at Cursor.cursorProto.(anonymous function) (packages/mdg_meteor-apm-agent.js:3394:45)
W20190212-21:41:12.567(0)? (STDERR)     at Cursor.kadira_Cursor_fetch [as fetch] (packages/mdg_meteor-apm-agent.js:3740:32)
W20190212-21:41:12.567(0)? (STDERR)     at ns.Collection.<anonymous> (packages/matb33_collection-hooks.js:635:79)
W20190212-21:41:12.568(0)? (STDERR)     at ns.Collection.collection.(anonymous function) [as upsert] (packages/matb33_collection-hooks.js:146:21)
W20190212-21:41:12.569(0)? (STDERR)     at Meteor.startup (models/accountSettings.js:26:21)
W20190212-21:41:12.569(0)? (STDERR)     at Function.time (/usr/local/src/wekan/.meteor/local/build/programs/server/profile.js:309:28)
W20190212-21:41:12.569(0)? (STDERR)     at /usr/local/src/wekan/.meteor/local/build/programs/server/boot.js:423:13
W20190212-21:41:12.570(0)? (STDERR)     at /usr/local/src/wekan/.meteor/local/build/programs/server/boot.js:464:5
W20190212-21:41:12.570(0)? (STDERR)     at Function.run (/usr/local/src/wekan/.meteor/local/build/programs/server/profile.js:510:12)
W20190212-21:41:12.570(0)? (STDERR)     at /usr/local/src/wekan/.meteor/local/build/programs/server/boot.js:462:11

@GavinLilly
Copy link
Contributor Author

Ok I found the bug. There was a conflict in the getValue prototype naming between Kadira and wekan-ldap (they both have that prototype). I'm not sure how the conflict crossed between packages but as a fix I've renamed the prototype in wekan-ldap and it seems to work.

I'll create a separate issue in the wekan-ldap repo and pull requests in both for the fix and Kadira integration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants