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

Observability and OpenTelemetry

Observability and OpenTelemetry

More Decks by NearMeの技術発表資料です

Transcript

  1. 1 What is Observability? We want to know “Why is

    it slow?” “What is using so much RAM” “When did this problem start?” “Where is the root cause?” “How do I fix this?” Hard for distributed system!
  2. 2 The Historical Three Browser Tabs of Observability Logs Texts

    that are directly output from program indicating the working status. Metrics Numbers or normalized string indicating indicating resource usage or program status. Often with soft context. Tracing Correlated metrics with hard context, user transactions. Learning OpenTelemetry Young, T. and Parker, A.
  3. 3 OpenTelemetry - Unified Protocol We have too many tools

    and formats. Prometheus, Cloudwatch, DataDog, Jaeger, etc. They historically require different instrumentations and agents install on hardware or software. Migration means code changes. OpenTelemetry provides a vendors or open source providers independent protocol. Learning OpenTelemetry Young, T. and Parker, A.
  4. 5 OpenTelemetry - Collector Architecture https://opentelemetry.io/docs/collector/architecture/ Receivers port data to

    collector. Processors aggregate and filter data. Exporters pipe data to backends
  5. 6 SDK sends data to collector. OpenTelemetry - Instrumentation Architecture

    API provides endpoint for generating telemetry data. Library needs to implement API. Applications needs to have SDK and/or API. https://opentelemetry.io/docs/langu ages/js/getting-started/nodejs/
  6. 8 Hands-on Prerequisite - Install Pulumi: Download & Install Pulumi

    - Install Minikube: minikube start - Install Docker Desktop: Docker Desktop: The #1 Containerization Tool for Developers - Install Nodejs 20+: Node.js — Download Node.js®
  7. 9 Setup Steps 1. `git clone https://github.com/yukimotochern/nearme-study-session.git` - You may

    have pulled it previous study session for Nx. Just `git pull origin main` 2. `npm install` 3. (optional for types) `npx nx run-many -t prisma-generate` 4. `minikube start --cpus=6 --memory=10g`(this stack is heavy…) 5. `cp open-telemetry-intro/pulumi/.env.example open-telemetry-intro/pulumi/.env` 6. Fill in the `DOCKER_PASSWORD` to `open-telemetry-intro/pulumi/env`. I will paste in google meeting chat. 7. (optionally run the app in docker) a. `npm run open-telemetry-intro:npm install` b. `npm run open-telemetry-intro:dev` 8. `npx nx dev open-telemetry-intro-pulumi`
  8. 10 Testing 1. Open post api `minikube service $(kubectl get

    svc -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' | grep '^post-svc-' | head -n 1)` 2. Append`?password=password1&[email protected]&title=hi` to the url and refresh. Refresh a few more times. 3. Open Signoz frontend `minikube service signoz-frontend -n signoz`
  9. 11 Cleanup 1. `minikube delete` if you don’t have other

    important resources. 2. `rm -r ~/.pulumi` if you want to eliminate local pulumi backend completely. 3. If you ran the app with Docker `npm run open-telemetry-intro:down`