Commit Graph

1164 Commits

Author SHA1 Message Date
Nigel Deakin
c0dec594ef Add calls metric (#637)
* Add new Prometheus metric fn_api_calls

* Change fn_api_calls to a counter
2018-01-03 10:42:37 -06:00
CI
76ca562b6d fnserver: 0.3.265 release [skip ci] 2018-01-02 22:54:57 +00:00
CI
746a2cf4cf fnserver: 0.3.264 release [skip ci] 2018-01-02 22:09:33 +00:00
Denis Makogon
60d2ca234f Ship call logs to the user as text/plain instead of JSON (#615)
* Ship call logs to the user as text/plain instead of JSON

* Fixing swagger doc

* c.String instead of c.JSON

* Make Logs API backward compatible

* Loop over accepted MIME types

* Bump swagger API version

* Fix client build script

 previous version was producing the following "couldn't find a swagger spec"

* Logs API regression test

* Write response body without buffering

* Switch JSON and text/plain cases

* Handle Accepted content types properly

* More solid response content type handling

* Write HTTP 406 with corresponding error body

* Remove unused import

* Use handleErrorResponse
2018-01-02 16:01:22 -06:00
CI
ee5092c247 fnserver: 0.3.263 release [skip ci] 2018-01-02 21:41:08 +00:00
CI
45dfb0d586 fnserver: 0.3.262 release [skip ci] 2018-01-02 21:24:03 +00:00
Tolga Ceylan
fe80b50e30 fn: tests: revert a hack for agent shutdown (#632)
Reverting due to fix for #623
2018-01-02 15:17:44 -06:00
CI
a49bd43cb2 fnserver: 0.3.261 release [skip ci] 2018-01-02 21:07:01 +00:00
CI
9dfb6a4561 fnserver: 0.3.260 release [skip ci] 2018-01-02 19:39:07 +00:00
CI
1357119b67 fnserver: 0.3.259 release [skip ci] 2018-01-02 18:48:36 +00:00
Denis Makogon
faaf5846ce Use retry func while trying to ping SQL datastore (#630)
* Use retry func while trying to ping SQL datastore

 - implements retry func specifically for SQL datastore ping
 - fmt fixes
 - using sqlx.Db.PingContext instead of sqlx.Db.Ping
 - propogate context to SQL datastore

* Rely on context from ServerOpt

* Consolidate log instances

* Cleanup

* Fix server usage in API tests
2018-01-02 12:32:10 -06:00
CI
f675c00d93 fnserver: 0.3.258 release [skip ci] 2018-01-02 17:05:52 +00:00
CI
0bfd18a7c4 fnserver: 0.3.257 release [skip ci] 2017-12-26 17:20:10 +00:00
Reed Allman
683fef8c2e allow user configured agent in full node (#627)
* allow user configured agent in full node

this should keep the old default behavior but allow users to pass in a
configured agent to configure the server themselves, without having to worry
about a russian agent being a british agent.

also closes any agent given to an api node.

closes #623

* don't close agent in runner test
2017-12-26 11:04:14 -06:00
CI
ce6945aa3e fnserver: 0.3.256 release [skip ci] 2017-12-23 21:22:21 +00:00
CI
3ece05bc23 fnserver: 0.3.255 release [skip ci] 2017-12-23 16:28:09 +00:00
CI
5008188bfd fnserver: 0.3.254 release [skip ci] 2017-12-23 16:15:00 +00:00
Reed Allman
f51792ae5e Timestamps on apps / routes (#614)
* route updated_at

* add app created at, fix some route updated_at bugs

* add app updated_at

TODO need to add tests through front end
TODO for validation we don't really want to use the validate wrapper since
it's a programmer error and not a user error, hopefully tests block this.

* add tests for timestamps to exist / change on apps&routes

* route equals at done, fix tests wit dis

* fix up the equals sugar

* add swagger

* fix rebase

* precisely allocate maps in clone

* vetted

* meh

* fix api tests
2017-12-23 09:57:36 -06:00
CI
f6243fc6cb fnserver: 0.3.253 release [skip ci] 2017-12-22 21:09:05 +00:00
Tolga Ceylan
feeeca3321 fn: agent shutdown improvements (#622) 2017-12-22 12:52:31 -08:00
CI
4f586533c9 fnserver: 0.3.252 release [skip ci] 2017-12-21 22:12:31 +00:00
CI
77f68a69a9 fnserver: 0.3.251 release [skip ci] 2017-12-21 19:49:38 +00:00
Reed Allman
a8a3e143c7 unexport all data abstractions on Server (#618)
this patch has no behavior changes, changes are:

* server.Datastore() -> server.datastore
* server.MQ -> server.mq
* server.LogDB -> server.logstore
* server.Agent -> server.agent

these were at a minimum not uniform. further, it's probably better to force
configuration through initialization in `server.New` to ensure thread safety
of referencing if someone does want to modify these as well as forcing things
into our initialization path and reducing the surface area of the Server
abstraction.
2017-12-21 13:21:02 -06:00
CI
14d0f10515 fnserver: 0.3.250 release [skip ci] 2017-12-21 18:56:23 +00:00
CI
9ca2905cdb fnserver: 0.3.249 release [skip ci] 2017-12-21 17:58:17 +00:00
Travis Reeder
fdb4188146 Adds before/after app get/list. And some bug fixes/cleanup. (#610)
* Adds before/after app get/list. And some bug fixes/cleanup.

* Fix test
2017-12-21 09:32:03 -08:00
CI
c646a5cc5e fnserver: 0.3.248 release [skip ci] 2017-12-20 18:39:27 +00:00
Tolga Ceylan
7290579e7d fn: tests: adding hot container timeout and huge memory cases (#611)
* fn: adding hot container timeout and huge memory cases

*) switching TestRouteRunnerTimeout to fn-test-utils to handle
    both hot and cold.
*) in server_test added content-length handling as protocol http
    does not create content-length if it is not present.
2017-12-20 10:11:57 -08:00
CI
bf1500bb56 fnserver: 0.3.247 release [skip ci] 2017-12-20 04:58:20 +00:00
CI
299eb625c7 fnserver: 0.3.246 release [skip ci] 2017-12-20 03:02:25 +00:00
CI
b4d10d0cc3 fnserver: 0.3.245 release [skip ci] 2017-12-19 23:24:14 +00:00
CI
b1b64a6f04 fnserver: 0.3.244 release [skip ci] 2017-12-19 18:41:44 +00:00
CI
1ec17c8b0b fnserver: 0.3.243 release [skip ci] 2017-12-16 00:07:44 +00:00
Tolga Ceylan
25a72146f5 slot tracking improvements (#562)
* fn: remove 100 msec sleep for hot containers

*) moved slot management to its own file
*) slots are now implemented with LIFO semantics, this is important since we do
   not want to round robin hot containers. Idle hot containers should timeout properly.
*) each slot queue now stores a few basic stats such as avg time a call spent in a given
   state and number of running/launching containers, number of waiting calls in those states.
*) first metrics in these basic stats are discarded to avoid initial docker pull/start spikes.
*) agent now records/updates slot queue state and how much time a call stayed in that state.
*) waitHotSlot() replaces the previous wait 100 msec logic where it sends a msg to
   hot slot go routine launchHot() and waits for a slot
*) launchHot() is now a go routine for tracking containers in hot slots, it determines
   if a new containers is needed based on slot queue stats.
2017-12-15 15:50:07 -08:00
CI
fa0439640c fnserver: 0.3.242 release [skip ci] 2017-12-15 22:48:48 +00:00
Tolga Ceylan
419298e1c0 Async hot hdr fix (#604)
* fn: for async hot requests ensure/fix content-length/type

* fn: added tests for FromModel for content type/length

* fn: restrict the content-length fix to async in FromModel()
2017-12-15 14:32:25 -08:00
CI
477ae570a2 fnserver: 0.3.241 release [skip ci] 2017-12-15 18:49:25 +00:00
Nigel Deakin
f1fc040948 Fix spans for prometheus (#606) 2017-12-15 10:31:57 -08:00
CI
1ef2108acc fnserver: 0.3.240 release [skip ci] 2017-12-15 03:41:38 +00:00
Tolga Ceylan
3b12f3fa3d Fn deadline (#591)
* fn: added fn_deadline as RFC3339
2017-12-14 19:25:36 -08:00
CI
2fc96fef8d fnserver: 0.3.239 release [skip ci] 2017-12-14 21:59:49 +00:00
Reed Allman
404250a417 loggy loo for node type on startup (#602)
* loggy loo for node type on startup

* additional english verse

* update to most recent suggestion
2017-12-14 13:43:21 -08:00
CI
76283dd6ae fnserver: 0.3.238 release [skip ci] 2017-12-14 21:27:07 +00:00
Tolga Ceylan
eccce881a6 fn: exclude timeouts from failed error count (#590)
* fn: exclude timeouts from failed error count
2017-12-14 13:10:07 -08:00
CI
e1b6212d28 fnserver: 0.3.237 release [skip ci] 2017-12-14 15:42:55 +00:00
CI
20b73b3452 fnserver: 0.3.236 release [skip ci] 2017-12-14 00:47:58 +00:00
Reed Allman
fab788b539 makes span use init() to run before server.New (#597) 2017-12-13 16:31:19 -08:00
CI
4f7ccab0eb fnserver: 0.3.235 release [skip ci] 2017-12-13 18:44:33 +00:00
Dario Domizioli
6ba8bf4488 Change runner api env var to FN_RUNNER_API_URL (#592) 2017-12-13 10:28:19 -08:00
CI
1aed099d7d fnserver: 0.3.234 release [skip ci] 2017-12-13 00:13:18 +00:00