Kong / galileo-agent-node

Node.js agent for Galileo - API Analytics
https://getgalileo.io
MIT License
9 stars 4 forks source link

Will this work with Koa? #29

Closed urbaitel closed 8 years ago

urbaitel commented 8 years ago

Trying to get this working with Koa instead of express. Not having any real luck yet. Thoughts?

ahmadnassri commented 8 years ago

can you provide some debugging / log info you're seeing?

try with NODE_DEBUG=galileo env flag.

urbaitel commented 8 years ago
GALILEO 3197: [agent] plugin options: {
 "logBody": false,
 "failLog": "/dev/null",
 "failLogName": "galileo-agent-errors.log",
 "limits": {
  "bodySize": 10000,
  "retry": 0,
  "retryTime": 5,
  "flush": 2,
  "connection": 30
 },
 "queue": {
  "batch": 1,
  "entries": 1
 },
 "collector": {
  "host": "collector.galileo.mashape.com",
  "port": 443,
  "path": "/1.1.0/single",
  "ssl": true
 }
}, ########## . test
urbaitel commented 8 years ago

All of my endpoints are now returning 404 errors when adding galileo agent, via code:

var galileo = require('galileo-agent')
var agent = galileo('##########', process.env.NODE_ENV, {
  queue: {
    batch: 1, // turn batching on
    entries: 1 // number of entries per batch
  }
})
app.use(agent)
therebelrobot commented 8 years ago

Hey there @urbaitel! This agent was tested and is designed to support native HTTP, Express, and Restify, and the test cases are built around those technologies. It isn't tested with nor is really supported for other server technologies like Koa or Hapi as of yet. If you'd like to take a look at what would be needed to expand it out to Koa, we do accept PRs. We have published the Galileo Agent specification, which you can use as reference either for expanding this or to build a separate koa specific agent if you like.

Alternatively, you can use an http proxy, like Kong, to pass information into Galileo.