{"id":19168827,"url":"https://github.com/nikoshet/monitoring-spark-on-docker","last_synced_at":"2025-07-24T07:39:45.537Z","repository":{"id":198450530,"uuid":"295648352","full_name":"nikoshet/monitoring-spark-on-docker","owner":"nikoshet","description":"Spark Monitoring With Prometheus And Grafana Using Docker","archived":false,"fork":false,"pushed_at":"2020-11-09T10:06:25.000Z","size":263,"stargazers_count":8,"open_issues_count":0,"forks_count":8,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T14:52:18.665Z","etag":null,"topics":["docker","docker-compose","grafana","hadoop","hdfs","monitoring","node-exporter","prometheus","spark"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nikoshet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-09-15T07:26:20.000Z","updated_at":"2025-04-21T07:02:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"5cc7ab5e-40a3-444f-892e-da4f79282f29","html_url":"https://github.com/nikoshet/monitoring-spark-on-docker","commit_stats":null,"previous_names":["nikoshet/monitoring-spark-on-docker"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nikoshet/monitoring-spark-on-docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikoshet%2Fmonitoring-spark-on-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikoshet%2Fmonitoring-spark-on-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikoshet%2Fmonitoring-spark-on-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikoshet%2Fmonitoring-spark-on-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nikoshet","download_url":"https://codeload.github.com/nikoshet/monitoring-spark-on-docker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikoshet%2Fmonitoring-spark-on-docker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266808556,"owners_count":23987450,"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","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["docker","docker-compose","grafana","hadoop","hdfs","monitoring","node-exporter","prometheus","spark"],"created_at":"2024-11-09T09:43:56.824Z","updated_at":"2025-07-24T07:39:45.509Z","avatar_url":"https://github.com/nikoshet.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Monitoring Apache Spark and HDFS on Docker with Prometheus and Grafana\n\n## Goal\nThe goal of this project is to:\n- Create a Docker Container that runs Spark on top of HDFS\n- Use Prometheus to get metrics from Spark applications and Node-exporter\n- Use Grafana to display the metrics collected\n\n## Configuration\n- Hadoop Configurations for core-sites.xml and hadoop-env.sh are set [here](https://github.com/nikoshet/monitoring-spark-on-docker/blob/0b363ce7f0586ea9041e270e1a4fb7abfb6e52b5/Spark/install.sh#L27).\n- Spark Configurations for spark-env.sh and spark-defaults.conf are set [here](https://github.com/nikoshet/monitoring-spark-on-docker/blob/0b363ce7f0586ea9041e270e1a4fb7abfb6e52b5/Spark/install.sh#L53).\n- Environment variables for Spark/Hadoop versions and library paths are set [here](https://github.com/nikoshet/monitoring-spark-on-docker/blob/0b363ce7f0586ea9041e270e1a4fb7abfb6e52b5/Spark/Dockerfile#L6).\n\n## Notes\n- Spark version running is 3.0.1, and HDFS version is 3.2.0.\n- For all available metrics for Spark monitoring see [here](https://spark.apache.org/docs/2.2.0/monitoring.html#metrics).\n- The containerized environment consists of a Master, a Worker, a DataNode, a NameNode and a SecondaryNameNode.\n- To track metrics across Spark apps, appName needs to be set up or else the spark.metrics.namespace will be spark.app.id that changes after every invocation of the app.\n- Main Python Application running is app.py that is an example application computing number pi. For your own application/use of HDFS please do changes accordingly.\n- Dockerfile for Spark/Hadoop is also available [here](https://hub.docker.com/repository/docker/nikoshet/spark-hadoop/general) in order to add it in docker-compose.yaml file as seen [here](https://github.com/nikoshet/monitoring-spark-on-docker/blob/820dee01d771e8cf6ec3a7b27ede8aa0eeef2214/docker-compose.yaml#L54).\n\n## Usage\nAssuming that Docker is installed, simply execute the following command to build and run the Docker Containers:\n```\ndocker-compose build \u0026\u0026 docker-compose up\n```\n## Screenshots\n- Example dashboard for Spark Metrics:\n\u003cdiv style=\"display:block;margin:auto;height:80%;width:80% text-align:center;\"\u003e\n  \u003cimg src=\"./screenshot/spark-dashboard.png\"\u003e\n\u003c/div\u003e\n\n- All available services from Service Discovery in Prometheus:\n\u003cdiv style=\"display:block;margin:auto;height:40%;width:40%; text-align:center;\"\u003e\n  \u003cimg src=\"./screenshot/services.png\"\u003e\n\u003c/div\u003e\n\n## Troobleshooting\nPlease file issues if you run into any problems.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikoshet%2Fmonitoring-spark-on-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikoshet%2Fmonitoring-spark-on-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikoshet%2Fmonitoring-spark-on-docker/lists"}