{"id":26057661,"url":"https://github.com/wavefronthq/cloud-foundry-sampleapp","last_synced_at":"2025-03-08T11:58:15.627Z","repository":{"id":23696158,"uuid":"99626265","full_name":"wavefrontHQ/cloud-foundry-sampleapp","owner":"wavefrontHQ","description":"Wavefront Cloud Foundry (Spring Boot) Sample Application","archived":false,"fork":false,"pushed_at":"2023-07-13T11:10:06.000Z","size":42,"stargazers_count":1,"open_issues_count":2,"forks_count":2,"subscribers_count":28,"default_branch":"master","last_synced_at":"2023-07-13T12:24:49.604Z","etag":null,"topics":["cloud-foundry","monitoring","spring-boot","wavefront"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/wavefrontHQ.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}},"created_at":"2017-08-07T22:34:42.000Z","updated_at":"2023-03-22T18:13:30.000Z","dependencies_parsed_at":"2023-01-13T23:43:08.854Z","dependency_job_id":null,"html_url":"https://github.com/wavefrontHQ/cloud-foundry-sampleapp","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavefrontHQ%2Fcloud-foundry-sampleapp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavefrontHQ%2Fcloud-foundry-sampleapp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavefrontHQ%2Fcloud-foundry-sampleapp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavefrontHQ%2Fcloud-foundry-sampleapp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wavefrontHQ","download_url":"https://codeload.github.com/wavefrontHQ/cloud-foundry-sampleapp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242546038,"owners_count":20147096,"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":["cloud-foundry","monitoring","spring-boot","wavefront"],"created_at":"2025-03-08T11:58:14.896Z","updated_at":"2025-03-08T11:58:15.612Z","avatar_url":"https://github.com/wavefrontHQ.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e **Warning**\n\u003e\n\u003e This repository is no longer maintained.\n\n# Wavefront Cloud Foundry Sample Spring Boot Application\n\nThis project describes how to send application metrics from a Spring Boot app running in PCF to a Wavefront proxy.\n\n## Requirements\n* A Wavefront proxy deployed in PCF as part of the [Wavefront by VMware Nozzle for PCF](https://network.pivotal.io/products/wavefront-nozzle/)\n* A Wavefront proxy service instance provisioned in PCF using the [Wavefront Service Broker for PCF](http://docs.pivotal.io/partners/wavefront-nozzle/installing.html#marketplace).\n* Java \u003e= 1.8\n* Maven\n\n## Wavefront Proxy\n\nThe rest of this document assumes the wavefront proxy service instance provisioned in PCF is called `wfproxy-service`. Replace the service name accordingly if different.\n\n## Application Manifest\n\nA `manifest.yml` file is used to provide parameters to a PCF application. The developer needs to identify the wavefront proxy running in PCF and add it to the manifest file.\n\nHere is a sample manifest file:\n\n```\n---\n services:\n  - wfproxy-service\n```\n\n## Maven pom.xml File\n\nUpdate the Maven `pom.xml` file to include the wavefrontHQ public repositories and dependencies `dropwizard-metrics-3.1`. It should also include `spring-boot-maven-plugin` and `maven-shade-plugin`.\n\n## Parse VCAP_SERVICES\n\nThe `VCAP_SERVICES` present in the manifest file (or externally bound to the application using `cf bind-services ...` command) are passed to the application as environment variable. It is parsed to retrieve the wavefront-proxy `hostname` and `port`:\n\n```\nVCAP_SERVICES =\n{\n  \"wavefront-proxy\": [\n    {\n      \"credentials\": {\n        \"hostname\": \"10.202.1.15\",\n        \"port\": 2878\n      },\n      \"syslog_drain_url\": null,\n      \"volume_mounts\": [],\n      \"label\": \"wavefront-proxy\",\n      \"provider\": null,\n      \"plan\": \"standard\",\n      \"name\": \"wfproxy-service\",\n      \"tags\": [\n        \"wavefront\",\n        \"metrics\"\n      ]\n    }\n  ]\n}\n```\n\n## Send metrics from the application\n\nMost of the sample code is present in the `MetricSystem.java` file. It determines all the metrics to be reported and adds them to the `metricRegistry`. The `WavefrontReporter` is then used to send the metrics to the proxy.\n\n```\nWavefrontReporter wfReporter = WavefrontReporter.forRegistry(metricRegistry)\n    .withSource(\"springboot\")\n    .prefixedWith(\"pcf\")\n    .bindToCloudFoundryService(\"wavefront-proxy\", true);\nwfReporter.start(10,  TimeUnit.SECONDS);\n```\nThe `wavefront-proxy` is the name of the wavefront proxy service running in PCF. The Wavefront\ntile should be used to install the wavefront proxy service. Once the tile is installed, the\ndefault name of the wavefront proxy service will be `wavefront-proxy`.\n\nThere are additional overloaded methods available in `WavefrontReporter` class, which can be used\n to bind to wavefront proxy (e.g., `bindToCloudFoundryService()`).\n\n## Build and push the application\n\n```\nmvn clean install -DskipTests\ncf login -a \u003cpcf-api-url\u003e --skip-ssl-validation --sso\ncf push wavefront-sample-app -f src/main/resources/manifest.yml -p target/springboot-0.0.1-SNAPSHOT.jar\ncf logs wavefront-sample-app --recent\n```\nIf the manifest does not have wavefront-proxy service info, then the service can be bound to it\nlater using the following commands:\n```\ncf bind-service wavefront-sample-app wfproxy-service\ncf restage wavefront-sample-app\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwavefronthq%2Fcloud-foundry-sampleapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwavefronthq%2Fcloud-foundry-sampleapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwavefronthq%2Fcloud-foundry-sampleapp/lists"}