{"id":22475445,"url":"https://github.com/philips/monitoring-containerized-apps","last_synced_at":"2026-01-07T13:03:16.065Z","repository":{"id":66550488,"uuid":"106652155","full_name":"philips/monitoring-containerized-apps","owner":"philips","description":null,"archived":false,"fork":false,"pushed_at":"2017-10-18T05:21:22.000Z","size":2,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T20:31:36.008Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/philips.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-12T06:14:16.000Z","updated_at":"2019-07-11T01:17:17.000Z","dependencies_parsed_at":"2023-02-28T13:30:48.921Z","dependency_job_id":null,"html_url":"https://github.com/philips/monitoring-containerized-apps","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philips%2Fmonitoring-containerized-apps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philips%2Fmonitoring-containerized-apps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philips%2Fmonitoring-containerized-apps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philips%2Fmonitoring-containerized-apps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/philips","download_url":"https://codeload.github.com/philips/monitoring-containerized-apps/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245891339,"owners_count":20689316,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-06T13:17:01.755Z","updated_at":"2026-01-07T13:03:11.034Z","avatar_url":"https://github.com/philips.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# monitoring-containerized-apps\n\nAll of these demos were done with the CoreOS Tectonic Sandbox which is a local environment for CoreOS's Enterprise Kubernetes platform. You can follow along at home with your Linux/macOS/Windows machine with this setup as well just [download Tectonic Sandbox](https://coreos.com/tectonic/sandbox).\n\n[Slides](https://docs.google.com/presentation/d/1y0TYNiwpjFMjTgg7eBM5kz59Fey4r0Yj9IgQcNHDsDY/edit#slide=id.g28a5cb30c5_0_8197)\n\n## Setting up an app to monitor\n\nBased on the application monitoring guide on [CoreOS Tectonic\ndocs](https://coreos.com/tectonic/docs/latest/tectonic-prometheus-operator/user-guides/application-monitoring.html).\n\n```\nkubectl run --image quay.io/coreos/prometheus-example-app example-app --expose --port 8080 -l app=example-app\n```\n\n## Setting up the Service Label\n\n```\nkubectl label service example-app tier=frontend\n```\n\nVisit\nhttp://localhost:8001/api/v1/namespaces/default/services/monitor-app/proxy/\n\n## Setting up a Service Monitor Using Labels\n\nThe ServiceMonitor targets what to monitor with label selectors.\n\n```\napiVersion: monitoring.coreos.com/v1alpha1\nkind: ServiceMonitor\nmetadata:\n  name: frontend\n  labels:\n    tier: frontend\nspec:\n  selector:\n    matchLabels:\n      tier: frontend\n  endpoints:\n  - port: '8080'\n```\n\nThe Prometheus resource creates a new Prometheus instances.\n\n```\napiVersion: monitoring.coreos.com/v1alpha1\nkind: Prometheus\nmetadata:\n  name: frontend\n  labels:\n    prometheus: frontend\nspec:\n  version: v1.7.1\n  serviceAccountName: prometheus-frontend\n  serviceMonitorSelector:\n    matchLabels:\n      tier: frontend\n  ruleSelector:\n    matchLabels:\n      prometheus: frontend\n  resources:\n    requests:\n      memory: 400Mi\n  alerting:\n    alertmanagers:\n    - namespace: tectonic-system\n      name: alertmanager-main\n      port: web\n```\n\nAnd the ServiceAccount and ClusterRoleBinding give the Prometheus instance access to the Kubernetes API.\n\n```\napiVersion: v1\nkind: ServiceAccount\nmetadata:\n  name: prometheus-frontend\n```\n\n```\napiVersion: rbac.authorization.k8s.io/v1beta1\nkind: ClusterRoleBinding\nmetadata:\n  name: prometheus\nroleRef:\n  apiGroup: rbac.authorization.k8s.io\n  kind: ClusterRole\n  name: prometheus-k8s\nsubjects:\n- kind: ServiceAccount\n  name: prometheus-frontend\n  namespace: default\n```\n\n```\nkind: ConfigMap\napiVersion: v1\nmetadata:\n  name: example-app\n  labels:\n    prometheus: frontend\ndata:\n  alerting.rules: |\n    ALERT HighErrorRate\n      IF sum by(service, code) (http_requests_total{code=\"404\"}) \u003e 1000\n      LABELS {\n        severity = \"critical\",\n      }\n      ANNOTATIONS {\n        summary = \"High Error Rate\",\n        description = \"{{ $labels.service }} is experiencing high error rates.\",\n      }\n```\n\nConnect to the Prometheus setup on http://localhost:9090\n\n```\nkubectl get pods -l app=prometheus -o name | \\\n\tsed 's/^.*\\///' | \\\n\txargs -I{} kubectl port-forward {} 9090:9090\n```\n\n\n## Put some load on it\n\nThe boom load testing tool is fast and easy to use. Get it now:\n\n```\ngo get -u github.com/rakyll/boom\n```\n\nNow put some 200 OK request load on it:\n\n```\nhttp://localhost:8001/api/v1/namespaces/default/services/example-app:8080/proxy/\n```\n\n## Infrastructure Monitoring\n\nSee https://console.tectonicsandbox.com/prometheus and https://console.tectonicsandbox.com/alertmanager\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilips%2Fmonitoring-containerized-apps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilips%2Fmonitoring-containerized-apps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilips%2Fmonitoring-containerized-apps/lists"}