DevOpsDay
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Help
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    2
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # 微服務在雲原生環境的可觀測性應用 - 李泰穎 Tommy {%hackmd @DevOpsDay/BJXaW1_k6 %} > 從這裡開始寫 > cloud native 與microservice architecture的時代, 痛點在於如何快速找出問題, 把損失降到最低 ## 建構雲原生平台的可觀測性 - Opensource Observability stack 服務技術堆疊方案 - 三大遙測支柱:Log、Metrics、Tracing - 使用 Grafana 統整 Log、Metrics、Tracing - OpenTelemetry 在 Tracing 的三種應用模式 Manual, Auto, Injection - 2022年進入CNCF是一個高度自動化的解決方案的開始 ## API互相呼叫會產生出很複雜的網路, 如果某個API的節點發生問題會很難找出問題 - SLA定義,把損失降低 ## 技術堆疊 - 透過Grafana來整合所有遙測資料的呈現. - k8s 可觀測性稍延不足,所以需要技術堆疊 - Opensource Observability stack: - Istio, kiali(Istio管理資料與流量from prometheus), OPT, Prometheus, Grafana Loki, Grafana Tempo(pipeline), Grafana - Istio Service mesh 機制 - sidecar mode - pods互相溝通的所有流量資訊都需要經過 sidecar (envoy) - 輕量級網路代理 - 應用程序無感知 - 協助解耦 - 可讓 Prometheus 取得 metrics。 - Rolling update: 利用流量控制測試服務版本 - Prometheus(istio -> prometheus server -> Grafana and Kiali) - 分為 pull \ push 方式取得監控數據 - 自己寫exporter讓系統吐metric出來 - 讓 ServiceMonitor通知prome server去哪裡拿 - Enable Istio sidecar 就可以自己做到metrics 而不用自己寫exporter,prome server就會知道要去sidecar拿metric - OpenTelemetry(OPT -> Tempo -> Grafana) - 此專案項目推動三大觀測性支柱:Log、Metrics、Tracing - 期許標準化、收集數據流程 - Loki 藉由 log stdout 機制,取得微服務log - fluentB collect from node - fluentD filter - OPT藉由Tempo作為grafana data source以呈現之 - 在不同的系統與服務之間進行數據交換與集成 - 傳播組件與搜集組件 - 有三種實現方式:Manual, Auto, Injection(推薦) - Manual:侵入式修改程式,自行處理 Tracing ID傳遞需求 - Auto:半侵入式 rebuild image - Injection:非侵入式的在 yaml 檔案上宣告 inject.(lung)即可(java, .net, nodejs, python, golang...) ref: https://github.com/open-telemetry/opentelemetry-operator#opentelemetry-auto-instrumentation-injection - - Log - 能透過fluentbit, fluentd來採集後, 送至Grafana Loki - Grafana - 三種資料來源:Loki、Prometheus、Tempo(from OpenTelemetry)12 factor ## Deepflow - 2022年度進入 CNCF ,是一個高度自動化的可觀測性平台解決方案 - DeepFlow 是使用eBPF技術 - 僅包含網路的Log; 程式Log要自己印出來 ## 總結 - Developer 要會寫 yaml, PromQL, Span, LogQL 還要學會 K8s - Cloud Native Non-Functional Requirements - 整個目的與重點: - 非侵入式:不要造成開發人員開發的負擔、建議使用Istio與OPT injection model - 統一管理介面:透過 Grafana 獲得一致性的資訊 - Grafana Dashboard: 右邊放Tempo、左邊放Loki (有人能支援圖片嗎XDD 完全看不到字) ![](https://hackmd.io/_uploads/B1H6j9R1a.png) 以上是一個共筆版本 ################################## 以下是另外一個共筆版本 ### Roadmap of Opensource Observability Stack in k8s ### 微服務service mesh 的特點 ![](https://hackmd.io/_uploads/BkjZn9CJT.jpg) ### Service Mesh Sidecar Enable Metrics Collection ![](https://hackmd.io/_uploads/HJtBn9Rk6.jpg) Basic Architecture of Prometheus Before ![](https://hackmd.io/_uploads/BJnlncCya.png) (ref: https://prometheus.io/docs/tutorials/getting_started/) ### 可觀測性三大支柱 - Logging - Matrics - Tracing * Logs:透過「文字」將在某個時間下發生的事件、實料、和有意義的 資訊記錄起來 * Metrics:透過视紧一定時間之内量化後的數據•常用的Metrics有 Query per second (QPS) 、Transaction per second (TPs) •而常用的Business metrics有Daily active users (DAU)等等 * Tracing: 為 「a tree of spans 」 •Tracing記錄觀每個功能其應用程式完整的執行過程。由於執行過程會充滿著「上下游的呼叫關像」若將這些呼叫開係記錄起來便形成了一棵樹 ![](https://hackmd.io/_uploads/Hy6Oh5Cyp.jpg) 要如何在複雜的網路環境中快速找到可能的錯誤 ? OpenTelemetry提供一個標準化的流程與套件. ### Opensource Observability Stack 元件交互 ![](https://hackmd.io/_uploads/r1jl69C1p.jpg) OpenTelemetry collector主要是收集與分發遙測資料的中介服務. # Demo1 : Logs observability - 12 factor standard output ![](https://hackmd.io/_uploads/rkcW0qAJT.jpg) ![](https://hackmd.io/_uploads/rkgNRqCy6.jpg) 能透過Loki的LogQL來搜尋到我們要的log # Demo2 : metrics observability ![](https://hackmd.io/_uploads/ryJd0cRJa.jpg) 能透過istio 來做流量控管, 做測試 # Demo3 : tracing observability ![](https://hackmd.io/_uploads/SJExJjAkp.jpg) # OpenTelemtry ![](https://hackmd.io/_uploads/H1HZJiCkp.jpg) ## Otel 3種模式: Manual, auto, injection mode ![](https://hackmd.io/_uploads/H1aS1oCk6.jpg) ### Manual Mode 以 Python 為例需要將 module import,自行開發每個 Spec 並自行處理 TracingID 傳遞的問題。 - 維運成本高、非常麻煩 ![](https://hackmd.io/_uploads/Hk1d1oC16.jpg) ### Auto Mode 半侵入式,Build Image 時將相關模塊引入。 ![](https://hackmd.io/_uploads/Skv2JoRk6.jpg) ``` opentelemetry-instrument python xxx ``` ### Inject Mode 在 YAML 檔案上面宣告,目前只支持 Java、.NET、node.js、Python、golang 僅需在 K8s manifest 上描述,做到非侵入式啟動觀測。 ![](https://hackmd.io/_uploads/r1FlgiAya.jpg) [OTel inejction]( https://opentelemetry.io/docs/kubernetes/operator/automatic/) # DeepFlow 啟用 eBPF 技術 採集網路拓墣的資訊與應用程式的三大遙測資料結合 ![](https://hackmd.io/_uploads/BkZwxo0yp.jpg) ## Architecture ![](https://hackmd.io/_uploads/BJd6es0k6.jpg) # 總結 ![](https://hackmd.io/_uploads/r1lgZoRJT.jpg) 「沒有比以前輕鬆,比以前加倍痛苦」 --> 今天重點 XD ## 聊天室: ithome 502 QQ 用 Istio 網路速度會有影響嗎? 會有但基本可無視, 畢竟要過sidecar 真的有人分享圖片 太神拉 感謝 投影片字好小 >< 字的顏色很淡 眼睛不好 XD 字真的有點小... 第一排燈有可能關掉嗎?不知道關掉後會不會好一點 會, 他的顏色太淺, 關掉會比較舒服 有工作人員在看共筆嗎? 我是共筆的, 看有沒有現場人員 部"屬" XD "布" 屬 xD 完全看不到字 +1 講者有要release投影片嗎 第三排就幾乎啥字都看不到惹QQ 唯一支持 Datadog datadog好用是好用 就是有點傷錢包 拜託前兩排的聽眾幫忙拍一下投影片貼上來...後面完全看不到字 >< 感謝圖片支援

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully