50
WSO2 API Manager sta1s1cs: integra1on with the ELK stack Dominique Debailleux Senior Architect EMOXA

WSO2Con EU 2016: Integrate APIM to Third-party Tools: Creating an Agent for ELK

Embed Size (px)

Citation preview

Page 1: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

WSO2APIManagersta1s1cs:integra1onwiththeELKstack

DominiqueDebailleuxSeniorArchitectEMOXA

Page 2: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

Agenda

•  APIManagementtools:whatisitabout?•  APIU1liza1onmetrics…whatfor?•  WSO2APIManagerinanutshell•  Sta1s1cs:WSO2DASapproach•  YetAnotherSolu1on?•  Drawmean•  PuJngitalltogether•  Onestepbeyond•  FAQ•  Almostforgot!•  WSO2APIM:opensource…andopenminded

Page 3: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

APIManagementtools:whatisitabout?

Page 4: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

APIManagementtooling:whatisitabout?

•  Ali%lereminder,justincaseyoulivedinacaveintheNunavutduringthelast3years…•  APImanagement(APIM)

–  Publishing,promo1ngandoverseeingAPIs–  Inasecure,scalableenvironment.–  Alsoincludesthecrea1onofendusersupportresourcesthatdefineand

documenttheAPI.•  APIMtoolsmainfocus:

–  Design&deployAPIs–  Exposethemtointernalandexternaldevelopers–  Ensurethattheyaresecuredandfunc1onal–  Getra1ng&u1liza1onfeedbacks

Page 5: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

APIManagementtooling:whatisitabout?

•  APIMtoolsbasics:–  Developerportal:engagementw/partnersordevelopers–  SLA&trafficmanagement–  Highavailability&scalability–  Consistencyacrossimplementa1onsandversions–  Cachingmechanism–  Security&authoriza1on–  Easytodeployandtest–  APIDocumenta1on–  Sta1s1cs&Analy1cs

Page 6: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

APIU1liza1onmetrics…whatfor?

Page 7: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

APIU1liza1onmetrics…whatfor?

•  Helptodiagnos1chowpeopleuseAPIsandgetinsightsforyourbusiness•  Alloworganiza1ons

–  tounderstandAPIu1liza1on–  tomakesuretheneedsofdevelopersandapplica1onsusingtheAPIare

beingmet–  toplanaccordinglyforfutureenhancementsorcapaci1es

•  Willalsobeusedtohelpbothmonitorandmone1zetheAPIsexposed

Page 8: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

APIU1liza1onmetrics…whatfor?

•  APIMtoolscollectandstorerun1meinforma1onaboutAPIsandtheirconsumerssuchas:–  howo\enareAPIsbeingused(average,peakrequests,response1me,…)–  whichAPIsarebeingused,–  whoisregistreredandisusingtheAPIs,–  SLAcomplianceorexpecta1on,–  …–  well,anydatathatismeaningfulltotheorganiza1ons

Page 9: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

WSO2APIManagerinanutshell

Page 10: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

WSO2APIManagerinanutshell

•  h^p://wso2.com/products/api-manager/

•  FreeandopensourceAPIMsolu1on–  Designs&publishesAPIsinminutes–  Includesadeveloperportalw/selfregistra1on(Applica1onStore)–  GovernsAPIs(lifecycle,visibility,versions)–  APIcrea1onandUsersregistra1onvalida1onthroughworkflows(WSO2

BPS)–  ProvidessecuritythroughAPIsaccesscontrol(OAuth2)–  …

Page 11: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

WSO2APIManagerinanutshell

•  FreeandopensourceAPIMsolu1on(cont’d)–  …–  On-premise&Saasversion–  HA&Scalable–  Limitedoverhead–  Highlyextensible&customizable–  ProvidesAnaly5cs(WSO2DAS)–  LeveragesonWSO2ESBandWSO2IS

Page 12: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

WSO2APIManagerinanutshell

•  Fourcomponentswhichcanbesplitondifferentservers

•  Publisher(managementwebapp)–  APIdesignandconfigura1on–  Publica1ontowardtheStoreandtheGateway

•  Store(portalwebapp)–  APIscatalogue–  Subscrip1ons–  Accesskeygenera1on(Oauthtoken+ClientID&secret)–  APIstest(sandbox&produc1on)

Page 13: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

WSO2APIManagerinanutshell

•  Gateway(run1mecomponent)–  APIProxy–  Appliespolicies(security,thro^ling)andcollectssta1s1cs–  Passesthewebservicecalltothebackend–  LeveragesonWSO2ESB

•  KeyManager(securitycomponent)–  Tokenmanagement–  Authoriza1onmanagement

Page 14: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

14

Backend

APIGatewayExtract

accesstokenValidate

accesstokenApplyQoSpolicies

Publishsta1s1cs

Customextensions

APIStore

KeyManager

APIPublisher

Client

Publisher

1

1’

2

2

3

4 5

6 7 8

9

Page 15: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

Sta1s1cs:WSO2DASapproach

Page 16: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

16

Backend

APIGatewayExtract

accesstokenValidate

accesstokenApplyQoSpolicies

Customextensions

Publishsta1s1cs

Client

Publisher

5

1

2 3

4

APIPublisherAPIStore

APIMsta1s1cstables

request responsefault

othereventstreams

2

32’

3’

2’’

3’’

2’’

3’’

5

Streamdatatable

Summarydatatable

Eventflow

Page 17: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

17

Backen

d APIMsta1s1cstables

BAMmediator

Workflowexecutor

In

APIMgtUsageHandler

Out

APIMgtResponseHandler

Fault

APIMgtFaultHandler

APIMgtUsageDataBridgeDataPublisher

mediate(mc)

mediate(mc)

mediate(mc)

publishEvent(DTO)

APIGateway(ESBinside)

Publishsta1s1cs

Usagepublisher

RequestPublisherDTO

Streamdatatable

Summarydatatable

SPAR

K

Analy1cs

Eventreceivers

Eventstore

Processedeventstore

Page 18: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

APIMgtUsageDataPublisher

+publishEvent(RequestPublisherDTO)+publishEvent(ResponsePublisherDTO)+publishEvent(FaultPublisherDTO)

APIMgtUsageDataBridgeDataPublisher

RequestPublisherDTO

Requeststreamdefini=on

ResponsePublisherDTO

Responsestreamdefini=on

FaultPublisherDTO

Faultstreamdefini=on

APIMgtFaulHandler

+mediate(MessageContext)

APIMgtUsageHandler

+mediate(MessageContext)

APIMgtResponseHandler

+mediate(MessageContext)

DASPublisherimplementa1on

Handlers&Mediators

StreamDTOs

Page 19: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

YetAnotherSolu1on?

Page 20: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

YetAnotherSolu1on?

•  DASisagreatso\warebutwhatifonealreadyhasaBAMandSAMsolu1oninplace?

•  Opera1vesarenoteagertoaddasecond(third,…)tool•  Someonlyneedplainsta1s1cswithfirstlevelhistorycapabili1es

(summupsandsimpleaggrega1ons)thatmaynotrequirehighcompu1nganalysismodel

•  …notnecessarily->userstory

Page 21: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

APIMgtUsageDataPublisher

+publishEvent(RequestPublisherDTO)+publishEvent(ResponsePublisherDTO)+publishEvent(FaultPublisherDTO)

YourAPIMgtUsagePublisher

RequestPublisherDTO

Requeststreamdefini=on

ResponsePublisherDTO

Responsestreamdefini=on

FaultPublisherDTO

Faultstreamdefini=on

APIMgtFaulHandler

+mediate(MessageContext)

APIMgtUsageHandler

+handleRequest(MessageContext)

APIMgtResponseHandler

+mediate(MessageContext)

YOURPublisherimplementa1on

YoukeepthesameStreamDTOs

Page 22: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

22

Backen

d

BAMmediator

Workflowexecutor

In

APIMgtUsageHandler

Out

APIMgtResponseHandler

Fault

APIMgtFaultHandler

YourAPIMgtUsageDataPublisher

mediate(mc)

mediate(mc)

mediate(mc)

publishEvent(DTO)

APIGateway(ESBinside)

Publishsta1s1cs

Usagepublisher

RequestPublisherDTO

Yourpreferredanaly1cssolu1on

goesthere

Withsomeadjustments

here

Page 23: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

Drawmean

Page 24: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

•  ELK–  PipelineofthreeopensourceprojectsElas1csearch,Logstashand

Kibana–  Takedatafromanysource,anyformat–  Search,analyze,–  Visualizeitinreal1me

Drawmean

Page 25: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

•  Logstash:3stagespipeline–  Inputs-Responsibleforcollectthedatafromvarioussourcessuch

aslogs,syslogfiles,shippers,beats,redis,…–  Filters–makescondi1onaltransforma1ons(grok,drop,clone,

1me,geoip,…)like•  parsing–usingregularexpressions–,•  addingfieldsortags,•  formaJngstructureslikeJSON,…

–  Outputs-sendsthedatatovariousdes1na1ons,likeaElas1cSearchcluster,filesortoolslikegraphiteornagios

Drawmean

Page 26: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

•  Elas1csearch:RESTfuldataindexerandsearchengine–  Solu1ontomakesearchesandanalysisonasetofdataviaaquery

language–  Addressesstructured,unstrucureddataand1meseries–  Distributed,reliableandscalable–  Easymanagement(elas1csearch-headtools)–  LeveragesonLucene

Drawmean

Page 27: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

•  Kibana:web-basedlightandeasy-to-usedashboardtool–  QueriesElas1csearchindexesanddiscoversdata–  Letyouinteractwithdataviagraphics(selec1ons,filters,1me

zooming–  Histograms,piecharts,1meseriesandevengeomapscreatedand

populatedonthefly–  Visualsthatcanbecombinedintodashboards–  SecuredaccessviaShieldplugin

Drawmean

Page 28: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

Drawmean

Beats,tcp,h^p,udp,jmx,puppet…

Jdbc,Couchdb,Sqlite,Redis,ES…

Kaua,Rabbitmq,Pipe,…

File,Log4j,…

55outputplugins…

50inputplugins…

Page 29: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

PuJngitalltogether

Page 30: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

APIMgtUsageDataPublisher

+publishEvent(RequestPublisherDTO)+publishEvent(ResponsePublisherDTO)+publishEvent(FaultPublisherDTO)

APIMgtUsageLogPublisher

+publishEvent(RequestPublisherDTO){log.info(datafromRequestPublisherDTO);}…

RequestPublisherDTO

Requeststreamdefini=on

ResponsePublisherDTO

Responsestreamdefini=on

FaultPublisherDTO

Faultstreamdefini=on

APIMgtFaulHandler

+mediate(MessageContext)

APIMgtUsageHandler

+handleRequest(MessageContext)

APIMgtResponseHandler

+mediate(MessageContext)

LOGPublisherimplementa1on

Page 31: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

31

Backen

d

BAMmediator

Workflowexecutor

In

APIMgtUsageHandler

Out

APIMgtResponseHandler

Fault

APIMgtFaultHandler

APIMgtUsageLogPublisher

mediate(mc)

mediate(mc)

mediate(mc)

publishEvent(DTO)

APIGateway(ESBinside)

Publishsta1s1cs

Usagepublisher

RequestPublisherDTO

statslogfiles

Page 32: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

PuJngitalltogether

Logstashoutputw/sta1s1cs

Page 33: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

PuJngitalltogether

Page 34: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

PuJngitalltogether

Page 35: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

PuJngitalltogether

Page 36: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

PuJngitalltogether

Page 37: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

PuJngitalltogether

•  Easyuh?–  Oneclasstocreate–  Oneconfigura1onlinetomodify–  Somefunwith–  That’sit

•  Let’strysomethingmorechallenging

Page 38: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

Onestepbeyond

Page 39: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

Onestepbeyond

•  WhatifIwanttoenrichtheprovidedsta1s1cswithmyownones?–  Nocorrela1onbetweenrequestandresponse–  Nospaceforyoubeloveddata

•  Well,let’srestartfromtheclassdiagram

Page 40: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

APIMgtUsageExtendedLogPublisher

+publishEvent(ExtendedRequestPublisherDTO)+publishEvent(ExtendedResponsePublisherDTO)+publishEvent(ExtendedFaultPublisherDTO)

ExtendedRequestPublisherDTO

Requeststreamdefini=on

ExtendedResponsePublisherDTO

Responsestreamdefini=on

ExtendedFaultPublisherDTO

Faultstreamdefini=on

APIMgtFaulLogHandler

+mediate(MessageContext)

APIMgtUsageLogHandler

+handleRequest(MessageContext)

APIMgtResponseLogHandler

+mediate(MessageContext)

ExtendedLogPublisher

RequestPublisherDTO

Requeststreamdefini=on

ResponsePublisherDTO

Responsestreamdefini=on

FaultPublisherDTO

Faultstreamdefini=on

Extrafieldstolog•  Correla1onId•  BusinessData

+getextravaluesfromthe

mc

Exis1ngsta1s1csdata

Page 41: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

41

Backen

d

BAMmediator

Workflowexecutor

In

APIMgtUsageLogHandler

Out

APIMgtResponseLogHandler

Fault

APIMgtFaultLogHandler

APIMgtUsageExtendedLogPublisher

mediate(mc)

mediate(mc)

mediate(mc)

publishEvent(DTO)

APIGateway(ESBinside)

Publishsta1s1cs

Usagepublisher

ExtendedRequestPublisherDTO

WSO2APIMlogfiles

APImedia1onisimpacted

Page 42: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

Onestepbeyond Request

Response

Logstashoutputw/businessdataand

correla1onid

Logstashoutputw/sta1s1cs

Page 43: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

Onestepbeyond

Page 44: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

FAQ

Page 45: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

FAQ

•  WhatifIwanttopopulatetheWSO2APIMsta1s1cstablesanyway?–  DASapproach,–  DIYapproach

•  WhatifIdon't(wantto)usetheELKstack?•  Whataboutthe1.xversions?•  WhatifIrepublishtheAPI(“onestepbeyond”case)?•  Whatabouttheoverhead?

Page 46: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

Almostforgot!

Page 47: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

Almostforgot

•  WSO2PreferredPartner•  WSO2TrainingFrance•  UsingWSO2solu1onsSince2013•  BarcelonaWSO2Con2014speaker•  SOAArchitects

co-authorsofthebook“SOA–aguideforarchitects”

Page 48: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

WSO2APIM:opensource…andopenminded

Page 49: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

WSO2APIM:opensource…andopenminded

•  WSO2APIMistherighttooltomanageyourAPIs.•  MostAPIToolshavetoconnecttoanexis1ngecosysteminplace•  WSO2APIMhasprovenitscapabili1estoembracereallifecases

andtoadapt.•  Extensioncapabili1esofWSO2APIMisunchallengedand"part

ofitsstrength”•  An“elas1c”solu1on…inaway

Page 50: WSO2Con EU 2016: Integrate APIM to Third-party Tools:  Creating an Agent for ELK

ThankYou!

#WSO2ConEU

Shareyourfeedbackforthissessionwso2con.com/app