{"id":13343811,"url":"https://github.com/mustafaabdullahk/zephyr-prometheus-example","last_synced_at":"2025-03-12T06:30:30.123Z","repository":{"id":237169673,"uuid":"793951516","full_name":"mustafaabdullahk/zephyr-prometheus-example","owner":"mustafaabdullahk","description":"zephyr prometheus library example application","archived":false,"fork":false,"pushed_at":"2024-04-30T10:12:56.000Z","size":127,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-24T16:49:22.546Z","etag":null,"topics":["example","example-project","prometheus-client","prometheus-metrics","zephyr-rtos","zephyrproject-rtos"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mustafaabdullahk.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-30T07:17:49.000Z","updated_at":"2024-08-17T13:30:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"d1dfaa8c-50e3-4de5-a93a-08125ad7fc9c","html_url":"https://github.com/mustafaabdullahk/zephyr-prometheus-example","commit_stats":null,"previous_names":["mustafaabdullahk/zephyr-prometheus-example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustafaabdullahk%2Fzephyr-prometheus-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustafaabdullahk%2Fzephyr-prometheus-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustafaabdullahk%2Fzephyr-prometheus-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mustafaabdullahk%2Fzephyr-prometheus-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mustafaabdullahk","download_url":"https://codeload.github.com/mustafaabdullahk/zephyr-prometheus-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243171374,"owners_count":20247876,"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":["example","example-project","prometheus-client","prometheus-metrics","zephyr-rtos","zephyrproject-rtos"],"created_at":"2024-07-29T19:32:01.271Z","updated_at":"2025-03-12T06:30:30.110Z","avatar_url":"https://github.com/mustafaabdullahk.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zephyr Prometheus Example Application\n \n\u003ca href=\"https://zephyrproject-rtos.github.io/example-application\"\u003e\n  \u003cimg alt=\"Documentation\" src=\"https://img.shields.io/badge/documentation-3D578C?logo=sphinx\u0026logoColor=white\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://zephyrproject-rtos.github.io/example-application/doxygen\"\u003e\n  \u003cimg alt=\"API Documentation\" src=\"https://img.shields.io/badge/API-documentation-3D578C?logo=c\u0026logoColor=white\"\u003e\n\u003c/a\u003e\n\nThis repository contains a Zephyr Prometheus example application. The main purpose of this\nrepository is to serve as a reference on how to structure Zephyr-based\napplications. Some of the features demonstrated in this example are:\n\n- Basic [Zephyr application][app_dev] skeleton\n- [Zephyr workspace applications][workspace_app]\n- [Zephyr modules][modules]\n- [West T2 topology][west_t2]\n- [Custom boards][board_porting]\n- Custom [devicetree bindings][bindings]\n- Out-of-tree [drivers][drivers]\n- Out-of-tree libraries\n- Example CI configuration (using GitHub Actions)\n- Custom [west extension][west_ext]\n- Doxygen and Sphinx documentation boilerplate\n- Zephyr [prometheus client library][prometheus_library]\n\nThis repository is versioned together with the [Zephyr main tree][zephyr]. This\nmeans that every time that Zephyr is tagged, this repository is tagged as well\nwith the same version number, and the [manifest](west.yml) entry for `zephyr`\nwill point to the corresponding Zephyr tag. For example, the `example-application`\nv2.6.0 will point to Zephyr v2.6.0. Note that the `main` branch always\npoints to the development branch of Zephyr, also `main`.\n\n[app_dev]: https://docs.zephyrproject.org/latest/develop/application/index.html\n[workspace_app]: https://docs.zephyrproject.org/latest/develop/application/index.html#zephyr-workspace-app\n[modules]: https://docs.zephyrproject.org/latest/develop/modules.html\n[west_t2]: https://docs.zephyrproject.org/latest/develop/west/workspaces.html#west-t2\n[board_porting]: https://docs.zephyrproject.org/latest/guides/porting/board_porting.html\n[bindings]: https://docs.zephyrproject.org/latest/guides/dts/bindings.html\n[drivers]: https://docs.zephyrproject.org/latest/reference/drivers/index.html\n[zephyr]: https://github.com/zephyrproject-rtos/zephyr\n[west_ext]: https://docs.zephyrproject.org/latest/develop/west/extensions.html\n[prometheus_library]: https://github.com/mustafaabdullahk/zephyrus/\n\n## Getting Started\n\nBefore getting started, make sure you have a proper Zephyr development\nenvironment. Follow the official\n[Zephyr Getting Started Guide](https://docs.zephyrproject.org/latest/getting_started/index.html).\n\n### Initialization\n\nThe first step is to initialize the workspace folder (``my-workspace``) where\nthe ``example-application`` and all Zephyr modules will be cloned. Run the following\ncommand:\n\n```shell\n# initialize my-workspace for the example-application (main branch)\nwest init -m https://github.com/mustafaabdullahk/zephyr-prometheus-example.git --mr main prom-workspace\n# update Zephyr modules\ncd prom-workspace\nwest update\n```\n\n### Tested boards\n\n|boards|status|\n|--------------|------|\n|stm32h747disco|OK|\n\n### Building and running\n\nTo build the application, run the following command:\n\n```shell\ncd example-application\nwest build -b $BOARD app\n```\n\nwhere `$BOARD` is the target board.\n\nYou can use the `custom_plank` board found in this\nrepository. Note that Zephyr sample boards may be used if an\nappropriate overlay is provided (see `app/boards`).\n\nA sample debug configuration is also provided. To apply it, run the following\ncommand:\n\n```shell\nwest build -b $BOARD app -- -DOVERLAY_CONFIG=debug.conf\n```\n\nOnce you have built the application, run the following command to flash it:\n\n```shell\nwest flash\n```\n\nexample output:\n\n```bash\n*** Booting Zephyr OS build v3.6.0-3205-g950382cb1717 ***\n[00:00:00.001,000] \u003cinf\u003e net_config: Initializing network\n[00:00:00.001,000] \u003cinf\u003e net_config: Waiting interface 1 (0x240010f0) to be up...\nPrometheus exposer listening on port 8080\n[00:00:01.686,000] \u003cinf\u003e net_config: Interface 1 (0x240010f0) coming up\n[00:00:01.686,000] \u003cinf\u003e net_config: Running dhcpv4 client...\nZephyr Example Application 1.0.0\n[00:00:04.688,000] \u003cinf\u003e net_dhcpv4: Received: 10.5.194.51\n[00:00:04.688,000] \u003cinf\u003e net_config: IPv4 address: 10.5.194.51\n[00:00:04.688,000] \u003cinf\u003e net_config: Lease time: 258944 seconds\n[00:00:04.688,000] \u003cinf\u003e net_config: Subnet: 255.255.0.0\n[00:00:04.688,000] \u003cinf\u003e net_config: Router: 10.5.0.1\nHandling connection\nmetric-\u003ename: test_counter\nmetric-\u003etype: 0\ncounter-\u003evalue: 1\ncounter-\u003enum_labels: 2\nHandling connection\nmetric-\u003ename: test_counter\nmetric-\u003etype: 0\ncounter-\u003evalue: 1\ncounter-\u003enum_labels: 2\n```\n\n### Testing\n\nTo execute Twister integration tests, run the following command:\n\n```shell\nwest twister -T tests --integration\n```\n\n### Documentation\n\nA minimal documentation setup is provided for Doxygen and Sphinx. To build the\ndocumentation first change to the ``doc`` folder:\n\n```shell\ncd doc\n```\n\nBefore continuing, check if you have Doxygen installed. It is recommended to\nuse the same Doxygen version used in [CI](.github/workflows/docs.yml). To\ninstall Sphinx, make sure you have a Python installation in place and run:\n\n```shell\npip install -r requirements.txt\n```\n\nAPI documentation (Doxygen) can be built using the following command:\n\n```shell\ndoxygen\n```\n\nThe output will be stored in the ``_build_doxygen`` folder. Similarly, the\nSphinx documentation (HTML) can be built using the following command:\n\n```shell\nmake html\n```\n\nThe output will be stored in the ``_build_sphinx`` folder. You may check for\nother output formats other than HTML by running ``make help``.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmustafaabdullahk%2Fzephyr-prometheus-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmustafaabdullahk%2Fzephyr-prometheus-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmustafaabdullahk%2Fzephyr-prometheus-example/lists"}