Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Prometheus setup with long term storage

Prometheus setup with long term storage

Ryotaro Tamura

July 22, 2019
Tweet

More Decks by Ryotaro Tamura

Other Decks in Programming

Transcript

  1. 5JNF4FSJFT http_requests_total{instance="webproxy-1", code="200", method="get", path="/"} http_requests_total{instance=“webproxy-1", code="200", method="get", path=“/status"} http_requests_total{instance="webproxy-3",

    code="200", method="get", path="/status"} {__name__="http_requests_total", instance="webproxy-1", code="200", method="get", path="/"} {__name__="http_requests_total", instance="webproxy-1", code="200", method="get", path=“/status"} {__name__="http_requests_total", instance="webproxy-3", code="200", method="get", path="/status"} ϝτϦοΫͷ໊લ΋಺෦తʹ͸ϥϕϧ ϥϕϧ͸ऩूͨ͠ϝτϦοΫʹ෇༩͞Εͨ৘ใ
  2. *OEFY w֤#MPDLͷதͰ͸4FSJFTʹݻ༗ͷ*%ׂ͕ΓৼΒΕ͍ͯΔ http_requests_total{instance="webproxy-1", code="200", method="get", path="/"} http_requests_total{instance=“webproxy-1", code="200", method="get", path=“/status"}

    http_requests_total{instance="webproxy-3", code="200", method="get", path="/status"} ID: 4 ID: 5 ID: 10 w*OEFY͸ϥϕϧͱ஋ͷશ૊Έ߹ΘͤʹରԠ͢ΔιʔτࡁΈͷ*%ϦετΛ࣋ͭ code=“200”: [ 3, 4, 5, 8, 10 ... ] path=“/“: [ 2, 4, 100, 901 ... ] path=“/status”: [ 5, 10, 11, 125, 12099 ... ] ...
  3. code=“200”: [ 3, 4, 5, 8, 10 ... ] path=“/“:

    [ 2, 4, 100, 901 ... ] path=“/status”: [ 5, 10, 11, 125, 12099 ... ] *OEFY w*OEFY͸ϥϕϧͱ஋ͷશ૊Έ߹ΘͤʹରԠ͢ΔιʔτࡁΈϦετΛ࣋ͭ w1SPN2-Ͱࢦఆ͞ΕͨϥϕϧͷϦετΛऔಘͯ͠ڞ௨͢Δ*%Λಛఆ PromQL: http_requests_total{code=“200”, path=“/status“} code=“200”: [ 3, 4, 5, 8, 10 ... ] path=“/status”: [ 5, 10, 11, 125, 12099 ... ] intersect: [ 5, 10 ]
  4. *OHFTUFS w%JTUSJCVUPS͔Βड͚औͬͨαϯϓϧΛ$IVOLTUPSFʹอଘ͢Δ w*OEFY%ZOBNP%# #JHUBCMF $BTTBOESB w$IVOL%ZOBNP%# #JHUBCMF $BTTBOESB ($4 4

    wաڈ࣌ؒ෼ͷαϯϓϧΛอ࣋͢ΔηϛεςʔτϑϧͳαʔϏε w௚ۙͷσʔλಡΈࠐΈͷߴ଎Խ w$IVOLTUPSF΁ͷॻ͖ࠐΈ૿෯Λճආ 8SJUFEFBNQMJpDBUJPO  wϊʔυ͸جຊతʹಠཱͯ͠ಈ࡞͢Δ͕ɺϩʔϦϯάΞοϓσʔτ࣌ͷΈྫ֎త ʹάϧʔϓ͔Βग़Δϊʔυ͕ࢀՃ͢ΔϊʔυʹΠϯϝϞϦͷσʔλΛసૹ͢Δ
  5. ॻ͖ࠐΈ૿෯ wྫ%ZOBNP%#ͷ8$6 8SJUF$BQBDJUZ6OJU  w8$6͋ͨΓ,#·Ͱͷॻ͖ࠐΈ͕ඵؒճՄೳ wςʔϒϧʹରͯ͠8$6ͷ਺Λࢦఆ͢Δ ར༻ྉۚʹӨڹ  w,#ͷॻ͖ࠐΈΛճͰߦ͏৔߹͸8$6Λফඅ͢Δ wॻ͖ࠐΈαΠζͷ୺਺͸੾Γ্͛ΒΕΔ

    ,#ˠ,#  wখ͍͞αΠζͷσʔλΛࡉ͔͘ॻ͖ࠐΜͰ͍Δͱ8$6ΛΑΓଟ͘ফඅ͢Δ w,#Λճॻ͖ࠐΉͱ8$6ফඅ਺͸ w,#ʹ·ͱΊͯճͰॻ͖ࠐΉͱ8$6ফඅ਺͸