{"id":20194758,"url":"https://github.com/newrelic-experimental/nr-apigee-integration","last_synced_at":"2025-03-03T07:45:47.953Z","repository":{"id":233562337,"uuid":"699833394","full_name":"newrelic-experimental/nr-apigee-integration","owner":"newrelic-experimental","description":"Reusable configuration to provide observability of Apigee proxies through New Relic, using W3C Trace Context distributed tracing, metrics, and logs in context.","archived":false,"fork":false,"pushed_at":"2024-12-19T14:46:29.000Z","size":85,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-01-13T19:19:38.232Z","etag":null,"topics":["apigee","apigee-proxy","newrelic","observability"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/newrelic-experimental.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2023-10-03T12:40:06.000Z","updated_at":"2024-12-19T14:46:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"d1fe8367-824c-4e8a-b0b1-3a84a13cf775","html_url":"https://github.com/newrelic-experimental/nr-apigee-integration","commit_stats":null,"previous_names":["newrelic-experimental/nr-apigee-integration"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newrelic-experimental%2Fnr-apigee-integration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newrelic-experimental%2Fnr-apigee-integration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newrelic-experimental%2Fnr-apigee-integration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newrelic-experimental%2Fnr-apigee-integration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/newrelic-experimental","download_url":"https://codeload.github.com/newrelic-experimental/nr-apigee-integration/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241629741,"owners_count":19993708,"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":["apigee","apigee-proxy","newrelic","observability"],"created_at":"2024-11-14T04:13:57.766Z","updated_at":"2025-03-03T07:45:47.936Z","avatar_url":"https://github.com/newrelic-experimental.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![New Relic Experimental header](https://github.com/newrelic/opensource-website/raw/master/src/images/categories/Experimental.png)](https://opensource.newrelic.com/oss-category/#new-relic-experimental)\n# nr-apigee-integration\nThis repository contains reusable configuration to provide observability of [Apigee](https://cloud.google.com/apigee/docs/api-platform/get-started/what-apigee) proxies through New Relic, using [W3C Trace Context](https://www.w3.org/TR/trace-context/) distributed tracing, metrics, and logs in context.\n\n## Installation\nAssumes an Apigee-X environment, but there is no reason this shouldn't work with Apigee Edge, aside from credentials.\n### Prerequisites\n* [maven](https://maven.apache.org/) - the deployment of proxies makes use of the [apigee-deploy-maven-plugin](https://github.com/apigee/apigee-deploy-maven-plugin)\n* [gcloud CLI](https://cloud.google.com/sdk/docs/install)\n\n### Configuration properties file\nUpdate the [newrelic.properties.sample](newrelic.properties.sample) properties file to provide the configuration for your environment, and rename it `newrelic.properties`. **Important do not commit this new file to git!** (It should be ignored in `.gitignore` already.)\nThe newrelic.properties file contains the following value:\n* LICENSE_KEY: your New Relic [Ingest License API key](https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/#license-key)\n\nCreate, or update a property set named `NewRelicPropSet` for your environment using [props.sh](props.sh) -c or -u for create, and update respectively. Use [props.sh](props.sh) -r to verify the property set has been created successfully. Use [props.sh](props.sh) -d to delete the property set.\n\nNote that in production environments you may wish to use Apigee [secrets](https://cloud.google.com/apigee/docs/api-platform/publish/import-existing-consumer-keys-and-secrets) rather than [property sets](https://cloud.google.com/apigee/docs/api-platform/cache/property-sets).\n\n### Maven configuration\nIf you are using the New Relic EU region, instead of the US region, change the host endpoint values.\n* For logging edit the [config.json](sharedflows/src/gateway/nr-logging-sharedflow/config.json) file. Use either `newrelic.syslog.nr-data.net` or `newrelic.syslog.eu.nr-data.net` depending on whether your New Relic account is hosted in the US or EU region respectively  \n* For tracing edit the [config.json](sharedflows/src/gateway/nr-trace-api-sharedflow/config.json) file. Use either `trace-api.newrelic.com` or `trace-api.eu.newrelic.com` depending on whether your New Relic account is hosted in the US or EU region respectively\n\nTo configure the slow requests auto sample time edit the [config.json](sharedflows/src/gateway/nr-instrumentation-sharedflow/config.json) file. This is the time, in milliseconds, that will initiate auto-sampling of slow proxy requests. Suggested `5000`ms (5 seconds)\n\n### Environment variables\nSet the following environment variables:\n* APIGEE_ORG: the name of your Apigee organization, e.g `silicon-shape-123456`\n* APIGEE_ENV: your agigee environment. The proxies can be configured per environment, e.g. `dev`\n\nIf the environment variables are not set, they can alternatively be provided in the following file locations:\n* [props.sh](props.sh)\n* deploy.sh for each of the proxies \n\n### Deploying the properties file, shared flows and example proxies in a single script\nWith the environment variables set, run [deploy.sh](deploy.sh).\n\n### Shared flows\nThe instrumentation examples in this repository make use of [shared flows](https://cloud.google.com/apigee/docs/api-platform/fundamentals/shared-flows).\n\nExample API proxies are contained in the [examples](examples) directory. The example proxies are dependent on the following shared flows:\n* nr-instrumentation-sharedflow\n* nr-instrumentation-obfuscation-sharedflow\n* nr-log-api-sharedflow\n* nr-logging-sharedflow\n* nr-metric-api-sharedflow\n* nr-trace-api-sharedflow\n\nTo install the shared flows independently:\n1. Execute the [deploy.sh](sharedflows/src/gateway/nr-instrumentation-obfuscation-sharedflow/deploy.sh) script from within the [sharedflows/src/gateway/nr-instrumentation-obfuscation-sharedflow](sharedflows/src/gateway/nr-instrumentation-obfuscation-sharedflow) directory.\n2. Execute the [deploy.sh](sharedflows/src/gateway/nr-instrumentation-sharedflow/deploy.sh) script from within the [sharedflows/src/gateway/nr-instrumentation-sharedflow](sharedflows/src/gateway/nr-instrumentation-sharedflow) directory.\n3. Execute the [deploy.sh](sharedflows/src/gateway/nr-log-api-sharedflow/deploy.sh) script from within the [sharedflows/src/gateway/nr-log-api-sharedflow](sharedflows/src/gateway/nr-log-api-sharedflow) directory.\n4. Execute the [deploy.sh](sharedflows/src/gateway/nr-logging-sharedflow/deploy.sh) script from within the [sharedflows/src/gateway/nr-logging-sharedflow](sharedflows/src/gateway/nr-logging-sharedflow) directory.\n5. Execute the [deploy.sh](sharedflows/src/gateway/nr-metric-api-sharedflow/deploy.sh) script from within the [sharedflows/src/gateway/nr-metric-api-sharedflow](sharedflows/src/gateway/nr-metric-api-sharedflow) directory.\n6. Execute the [deploy.sh](sharedflows/src/gateway/nr-trace-api-sharedflow/deploy.sh) script from within the [sharedflows/src/gateway/nr-trace-api-sharedflow](sharedflows/src/gateway/nr-trace-api-sharedflow) directory.\n\n### Example proxies\nTo install the example proxies independently:\n1. Execute the [deploy.sh](examples/newrelic-log/deploy.sh) script from within the [examples/newrelic-log](examples/newrelic-log) directory.\n2. Execute the [deploy.sh](examples/newrelic-logging/deploy.sh) script from within the [examples/newrelic-logging](examples/newrelic-logging) directory.\n3. Execute the [deploy.sh](examples/newrelic-metric/deploy.sh) script from within the [examples/newrelic-metric](examples/newrelic-metric) directory.\n4. Execute the [deploy.sh](examples/newrelic-trace/deploy.sh) script from within the [examples/newrelic-trace](examples/newrelic-trace) directory.\n5. Execute the [deploy.sh](examples/newrelic-trace-and-logging/deploy.sh) script from within the [examples/newrelic-trace-and-logging](examples/newrelic-trace-and-logging) directory.\n6. Execute the [deploy.sh](examples/newrelic-trace-and-metric-and-log/deploy.sh) script from within the [examples/newrelic-trace-and-metric-and-log](examples/newrelic-trace-and-metric-and-log) directory.\n7. Execute the [deploy.sh](examples/newrelic-trace-and-metric-and-log-obfuscate/deploy.sh) script from within the [examples/newrelic-trace-and-metric-and-log-obfuscate](examples/newrelic-trace-and-metric-and-log-obfuscate) directory.\n\n## Synthetics tests for the example API proxies\nTerraform configuration is available to create synthetics monitors to exercise the sample API proxies. Take a look at the [README.md](synthetics-tests/README.md) file in the [synthetics-tests](synthetics-tests) directory for more information.\n\n## Acknowledgements\nThe distributed tracing instrumentation code here owes much to the https://github.com/sri-shetty/DT-Apigee-Proxy repository.\n\n# Support\n\nNew Relic has open-sourced this project. This project is provided AS-IS WITHOUT WARRANTY OR DEDICATED SUPPORT. Issues and contributions should be reported to the project here on GitHub.\n\nWe encourage you to bring your experiences and questions to the [Explorers Hub](https://discuss.newrelic.com) where our community members collaborate on solutions and new ideas.\n\n## Issues / enhancement requests\n\nIssues and enhancement requests can be submitted in the [Issues tab of this repository](../../issues). Please search for and review the existing open issues before submitting a new issue.\n\n# Contributing\n\nContributions are encouraged! If you submit an enhancement request, we'll invite you to contribute the change yourself. Please review our [Contributors Guide](CONTRIBUTING.md).\n\nKeep in mind that when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant.\n\n# Open source license\nThis project is distributed under the [Apache 2 license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewrelic-experimental%2Fnr-apigee-integration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnewrelic-experimental%2Fnr-apigee-integration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewrelic-experimental%2Fnr-apigee-integration/lists"}