Running a own Kadira instance Update: now with a guide!


Can you share if there were an specific steps you did to setup your local mongodb? After uninstall and reinstall of mongodb, i see similar errors as thbaz above. Since you were able to send data to local mongodb, may be there is something that we are missing while setting up our instance.

“connecting to the Mongo Metrics Cluster” does this hint something ?

kadira-engine_1 | starting apm-engine on port 11011
kadira-engine_1 | DDONE
kadira-engine_1 | Error connecting to the Mongo Metrics Cluster
kadira-engine_1 |
kadira-engine_1 | /app/node_modules/mongodb/lib/mongo_client.js:338
kadira-engine_1 | throw err
kadira-engine_1 | ^
kadira-engine_1 | MongoError: failed to connect to server [] on first connect [MongoError: connect ECONNREFUSED]


Hi, out of curiosity, was there a reason you choose to setup Mongo db on mlabs for your example ?
Are there any specific infra requirements that needs to be setup before kadira can connect to local mongodb instance. I am getting errors when attempting to connect to local mongodb.

The first error comes from the engine and is as below ? ‘Error connecting to the Mongo Metrics Cluster’


Would you mind posting your nginx configuration? I have everything up and running but I can’t seem to get an SSL proxy properly running on the 11011 port, although I can get one on the UI port


are you pointing to a local instance of MongoDb?


No, I setup a replicaset on Digital Ocean. Was going to use mlab but as others in this thread have noted, Kadira eats a fair amount of data and I need to connect several apps to it


If your are kadira instance is able to connect to the replicaset, can you please share the configuration setups as I am also exploring to setup a self hosted mongodb, but was getting error connecting to stand alone mongodb


My kadira is running with a custom replicaset hosted on AWS. 1 thing to keep in mind. All replicaset members should allow from external IP’s by setting the bind_ip = in the mongod.conf. Read more here.

Also I’ve noticed that setting up the replicaset and making it work for remote databases required me to give aliases to the replicaset members. So when referencing the set with the mongo string I refer to them as:

export MONGO_DATA_URL="mongodb://mongo-a,mongo-b,mongo-c/kadira-data?readPreference=primary&replicaSet=mySet"

Then I change the host file on each member’s server to refer to the right IP address and done. Meteor is sometimes complaining about not being able to connect to the primary instance using the connection string. Above solves it and might solve it for you as well.

Also a nice benefit is the fact that you don’t have to put the IP’s of each members in there. You can now simply swap members with different IP’s. It only requires you to change the host files. To simply this even more, you can use an internal DNS service like AWS Route53 to do the aliasing part. Simply connect the right IP to the right internal DNS record.


This is a great way to do it! For simplicity sake I just added the three replset members as subdomains so I don’t have to manage to the /etc/hosts file. I then lock all the traffic down via firewall and only allow the Kadira server to connect to them.

Question: Do you have SSL up and running for both the UI and the engine? I seem to only be able to get it running for the UI and I’m not keen on sending all my data to Kadira over plain HTTP


You can find instructions for setting up a replica set here. Definitely requires some sysadmin knowledge if you’re going to do it on a VPS


I’ve put my kadira engine on a private subnet accesible via a loadbalancer. The loadbalancer has port 443 open woth an ssl certificat. So the opions endpoint becomes kadira-https://api.yourdomain.something


For future reference, we did not set the engine setting correctly. after adding the export options url in the file:
export EXPORT_OPTIONS_URL="http://[YOUR DROPLET IP]:11011"
it is running fine now.
thanks to the full guide @sergiotapia


I have Kadira installed and running and data is going to with no problems but the kadira ui is not reactive. does anyone have a reactive version running?


Has anyone thought about a local Kadira instance?

Honestly, it’s never made a lot of sense to me that Kadira was a SaaS tool. I understand that Arunoda at one time thought it was a possible revenue generating opportunity; but performance profiling is usually something that’s available in Integrated Development Environments like Visual Studio.

Now that people have a good handle on how to replicate the original configuration; can we start thinking about how to slim it down and remove features? Alerting? Nginx? Replica sets? Docker images? They’re all SaaS scaling features. None of them materially help us profile our app and make it faster.

How can we go about making a super slim trimmed-down version of Kadira? Maybe something that can be connected to existing databases without sharding? Or run on a local development instance? Or added as a Chrome extension?


That’s exactly what I’m trying to do. It just takes some time given that i’m not earning anything with it and its not my core business either. Running it locally for my doesn’t help. It needs to monitor, provide alerts and I want to see errors from yesterday when I didn’t look at the application.


Sounds like there are some different use cases… SaaS, production monitoring, and performance profiling during development. The ubuntu guides are for SaaS, but are stumbling blocks if you only want monitoring and profiling.


This is what I would be looking for – no need for a SaaS here.


Could some one make the CPU Profiler and Kadira Debug work on their self hosted Kadira instance ?


I20170705-17:33:25.719(5.5)? Kadira: Remote CPU profiling started for 10 secs.
I20170705-17:33:37.483(5.5)? Kadira: Uploding the taken CPU profile.
I20170705-17:33:39.461(5.5)? Exception while invoking method ‘kadira.profileCpu’ Error: getaddrinfo ENOTFOUND

I see the above when i try to call the Kadira CPU profiler, any clues what is going wrong ?


Request for new kadira client fork (basically a roundup of intresting forks in the wild)


I’ve made a Gist explaining how I got to put Kadira up and running, thanks a lot for whom replied here before, really helped me.