@aaronbassett/netlify-plugin-development 中文文档教程

发布于 3年前 浏览 27 项目主页 更新于 3年前

New Relic Experimental header

New Relic Netlify Plugin GitHub GitHub issues GitHub pull requests GitHub last commit npm (scoped) npm npms.io (quality) Libraries.io dependency status for latest release, scoped npm package Lines of code

监控您的 Netlify 构建过程和Jamstack 应用程序性能与 New Relic,无需冗长的手动设置。

New Relic Netlify 插件:

  • Notifies New Relic on Netlify build events including: Pre Build, Post Build, Sucess, and Failure.
  • Installs the browser agent across your static pages
  • Adds a release version to each deployment for easier monitoring and debugging

Installation

有关详细安装说明,请参阅“使用 New Relic Netlify 插件和快速入门快速启动您的 Jamstack 监控”

UI Installation

UI 安装 是开始使用插件的最快方式,不需要对项目代码进行任何修改。

File-based Installation

或者,要使用 基于文件的安装 进行安装,请将以下行添加到您的 netlify.toml 文件:

package = "@newrelic/netlify-plugin"

  [plugins.inputs]
    newrelicAccountId = "123456"
    newrelicLicenseKey = "12345678901234567890"
    newrelicBrowserLicenseKey = "ABCD-0987654321"
    newrelicAppId = "123456789"
    enableBrowserMonitoring = true

替换 newrelicAccountIdnewrelicLicenseKeynewrelicBrowserLicenseKeynewrelicAppId< 的值/code> 与您的 New Relic 帐户 ID、您的摄取和浏览器摄取许可证密钥以及您的 New Relic 浏览器应用程序 ID。

Install the Netlify quickstart

为了充分利用 Netlify 集成,您还应该安装 New Relic Netlify quickstart。 您可以在 New Relic I/O 的快速入门页面上找到更多信息。

Settings

该插件允许通过环境变量或您的 netlify.toml 自定义以下设置。

netlify.toml key Environment variable name Description Required for Default value
failBuildOnPluginError FAILBUILDONPLUGINERROR Fail the whole build if the plugin has an error true
newrelicAccountId NEWRELICACCOUNTID New Relic Account ID event tracking & browser monitoring undefined
newrelicLicenseKey NEWRELICINGESTLICENSE_KEY New Relic Ingest License Key event tracking undefined
newrelicBrowserLicenseKey NEWRELICBROWSERLICENSE_KEY New Relic Ingest License Key event tracking undefined
newrelicAppId NEWRELICAPPID New Relic APM App ID browser monitoring undefined
recordEventsForPreviews RECORDEVENTSFOR_PREVIEWS Set this to true if you want to record events for deploy previews false
skipEvent.onPreBuild SKIPPREBUILD_EVENT Set this to true to skip recording onPreBuild custom events false
skipEvent.onBuild SKIPBUILDEVENT Set this to true to skip recording onBuild custom events false
skipEvent.onPostBuild SKIPPOSTBUILD_EVENT Set this to true to skip recording onPostBuild custom events false
skipEvent.onSuccess SKIPSUCCESSEVENT Set this to true to skip recording onSuccess custom events false
skipEvent.onError SKIPERROREVENT Set this to true to skip recording onError custom events false
skipEvent.onEnd SKIPENDEVENT Set this to true to skip recording onEnd custom events false
enableBrowserMonitoring ENABLEBROWSERMONITORING Attempt to inject the browser monitor script tag into any HTML pages false
enableBrowserMonitoringForPreviews ENABLEBROWSERMONITORINGFORPREVIEWS Set this to true if you want to enable browser monitoring for deploy previews false
distributedTracingEnabled DISTRIBUTEDTRACINGENABLED Enable distributed tracing for browser requests true
cookiesEnabled COOKIES_ENABLED Enable cookies for browser monitoring true
htmlInjectionConcurrency HTMLINJECTIONCONCURRENCY Number of concurrently pending promises to use when injecting browser agent 5
revisionTemplate REVISION_TEMPLATE Deploy marker revision and release version id structure (EJS string) <% if(git.commits[0].message){ % ><%= git.commits[0].message.slice(0,25) % >-<% } % ><%= process.env.CONTEXT % >-<%= process.env.COMMITREF.slice(0, 7) % >-<%= process.env.DEPLOYID.slice(-6) % >-<%= process.env.BUILD_ID.slice(-6) % >

Support

该插件是 New Relic experimental 的一部分。 该项目正在公开开发中,我们欢迎所有反馈和贡献。

提出问题或通过新遗迹探索者中心

Contributing

我们鼓励您为改进 New Relic Netlify 插件做出贡献!

请记住,当您提交拉取请求时,您需要使用 CLA-Assistant 通过点击来签署 CLA。 每个项目只需签署一次 CLA。

如果您有任何疑问,或执行我们的企业 CLA(如果您代表公司做出贡献),请给我们发送电子邮件至 opensource@newrelic.com。

A note about vulnerabilities

正如我们的安全政策中所述,New Relic 致力于保护我们客户及其数据的隐私和安全。 我们相信,由安全研究人员提供协调一致的信息披露并与安全社区合作是实现我们安全目标的重要手段。

如果您认为您在该项目或任何 New Relic 的产品或网站中发现了安全漏洞,我们欢迎并非常感谢您通过 HackerOne 向 New Relic 报告该漏洞

License

New Relic Netlify 插件根据 Apache 2.0 许可证获得许可。

New Relic Experimental header

New Relic Netlify Plugin GitHub GitHub issues GitHub pull requests GitHub last commit npm (scoped) npm npms.io (quality) Libraries.io dependency status for latest release, scoped npm package Lines of code

Monitor your Netlify build process and Jamstack application performance with New Relic, without the need for lengthy manual set up.

The New Relic Netlify Plugin:

  • Notifies New Relic on Netlify build events including: Pre Build, Post Build, Sucess, and Failure.
  • Installs the browser agent across your static pages
  • Adds a release version to each deployment for easier monitoring and debugging

Installation

For detailed installation instructions see "Jumpstart your Jamstack monitoring with the New Relic Netlify plugin and quickstart"

UI Installation

UI installation is the quickest way to start using the plugin, and does not require any modifications to your project's code.

File-based Installation

Alternatively, to install with file-based installation, add the following lines to your netlify.toml files:

package = "@newrelic/netlify-plugin"

  [plugins.inputs]
    newrelicAccountId = "123456"
    newrelicLicenseKey = "12345678901234567890"
    newrelicBrowserLicenseKey = "ABCD-0987654321"
    newrelicAppId = "123456789"
    enableBrowserMonitoring = true

Replace the values for newrelicAccountId, newrelicLicenseKey, newrelicBrowserLicenseKey, and newrelicAppId with your New Relic Account ID, the ingest and browser ingest license key you, and your New Relic Browser App ID.

Install the Netlify quickstart

To get the most out of your Netlify integration you should also install the New Relic Netlify quickstart. You can find more information on the quickstart page on New Relic I/O.

Settings

The plugin allows for customisation of the following settings via environment variables or your netlify.toml.

netlify.toml key Environment variable name Description Required for Default value
failBuildOnPluginError FAILBUILDONPLUGINERROR Fail the whole build if the plugin has an error true
newrelicAccountId NEWRELICACCOUNTID New Relic Account ID event tracking & browser monitoring undefined
newrelicLicenseKey NEWRELICINGESTLICENSE_KEY New Relic Ingest License Key event tracking undefined
newrelicBrowserLicenseKey NEWRELICBROWSERLICENSE_KEY New Relic Ingest License Key event tracking undefined
newrelicAppId NEWRELICAPPID New Relic APM App ID browser monitoring undefined
recordEventsForPreviews RECORDEVENTSFOR_PREVIEWS Set this to true if you want to record events for deploy previews false
skipEvent.onPreBuild SKIPPREBUILD_EVENT Set this to true to skip recording onPreBuild custom events false
skipEvent.onBuild SKIPBUILDEVENT Set this to true to skip recording onBuild custom events false
skipEvent.onPostBuild SKIPPOSTBUILD_EVENT Set this to true to skip recording onPostBuild custom events false
skipEvent.onSuccess SKIPSUCCESSEVENT Set this to true to skip recording onSuccess custom events false
skipEvent.onError SKIPERROREVENT Set this to true to skip recording onError custom events false
skipEvent.onEnd SKIPENDEVENT Set this to true to skip recording onEnd custom events false
enableBrowserMonitoring ENABLEBROWSERMONITORING Attempt to inject the browser monitor script tag into any HTML pages false
enableBrowserMonitoringForPreviews ENABLEBROWSERMONITORINGFORPREVIEWS Set this to true if you want to enable browser monitoring for deploy previews false
distributedTracingEnabled DISTRIBUTEDTRACINGENABLED Enable distributed tracing for browser requests true
cookiesEnabled COOKIES_ENABLED Enable cookies for browser monitoring true
htmlInjectionConcurrency HTMLINJECTIONCONCURRENCY Number of concurrently pending promises to use when injecting browser agent 5
revisionTemplate REVISION_TEMPLATE Deploy marker revision and release version id structure (EJS string) <% if(git.commits[0].message){ % ><%= git.commits[0].message.slice(0,25) % >-<% } % ><%= process.env.CONTEXT % >-<%= process.env.COMMITREF.slice(0, 7) % >-<%= process.env.DEPLOYID.slice(-6) % >-<%= process.env.BUILD_ID.slice(-6) % >

Support

The plugin is part of New Relic experimental. The project is being developed in the open and we welcome all feedback and contributions.

Please raise an issue or contact us via the New Relic Explorers Hub.

Contributing

We encourage your contributions to improve the New Relic Netlify Plugin!

Keep in mind when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. You only have to sign the CLA one time per project.

If you have any questions, or to execute our corporate CLA, required if your contribution is on behalf of a company, please drop us an email at opensource@newrelic.com.

A note about vulnerabilities

As noted in our security policy, New Relic is committed to the privacy and security of our customers and their data. We believe that providing coordinated disclosure by security researchers and engaging with the security community are important means to achieve our security goals.

If you believe you have found a security vulnerability in this project or any of New Relic's products or websites, we welcome and greatly appreciate you reporting it to New Relic through HackerOne.

License

The New Relic Netlify plugin is licensed under the Apache 2.0 License.

更多

友情链接

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文