Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Tracking Deployments with New Relic

B5b0f56c5edce4c54f1fea72e31d8378?s=47 Nic Benders
May 29, 2015

Tracking Deployments with New Relic

(From Velocity 2015) A quick guide to using New Relic's deployment marker feature as part of a Continuous Deployment system.


Nic Benders

May 29, 2015


  1. Tracking Deployments! with New Relic! 1 ! Nic Benders! Director

    of Engineering!
  2. 2 Confidential ©2008-15 New Relic, Inc. All rights reserved. This

    document and the information herein (including any information that may be incorporated by reference) is provided for informational purposes only and should not be construed as an offer, commitment, promise or obligation on behalf of New Relic, Inc. (“New Relic”) to sell securities or deliver any product, material, code, functionality, or other feature. Any information provided hereby is proprietary to New Relic and may not be replicated or disclosed without New Relic’s express written permission. Such information may contain forward-looking statements within the meaning of federal securities laws. Any statement that is not a historical fact or refers to expectations, projections, future plans, objectives, estimates, goals, or other characterizations of future events is a forward-looking statement. These forward-looking statements can often be identified as such because the context of the statement will include words such as “believes,” “anticipates,” “expects” or words of similar import. Actual results may differ materially from those expressed in these forward-looking statements, which speak only as of the date hereof, and are subject to change at any time without notice. Existing and prospective investors, customers and other third parties transacting business with New Relic are cautioned not to place undue reliance on this forward-looking information. The achievement or success of the matters covered by such forward-looking statements are based on New Relic’s current assumptions, expectations, and beliefs and are subject to substantial risks, uncertainties, assumptions, and changes in circumstances that may cause the actual results, performance, or achievements to differ materially from those expressed or implied in any forward-looking statement. Further information on factors that could affect such forward-looking statements is included in the filings we make with the SEC from time to time. Copies of these documents may be obtained by visiting New Relic’s Investor Relations website at ir.newrelic.com or the SEC’s website at www.sec.gov. New Relic assumes no obligation and does not intend to update these forward-looking statements, except as required by law. New Relic makes no warranties, expressed or implied, in this document or otherwise, with respect to the information provided.
  3. 3 Everyday We’re Hustling ���������� ���������� ����������� ���������� ����������������� �����������

  4. 4 Everyday We’re Hustling ���������� ���������� ����������� ���������� ������������ �����������������

  5. 5 Everyday We’re Hustling ������ �������������� ���������� ���������� ����������� ����������

    ������������ ����������������� �����������
  6. 6 Continuous Deployment

  7. 7 Deploys in context

  8. 8 Continuous Deployment

  9. 9 Recording Deployments

  10. 10 The API REST style, send POST with parameters to:

    https://api.newrelic.com/ deployments.xml get back XML representation of your
 new Deploy object. Account License Key goes in the X-Api-Key header. Send either the application’s name or it’s ID as a POST parameter
 APP_NAME: ! Must match what is in the newrelic.yml file! ! APP_ID:! Can be found in the URL on rpm.newrelic.com! Optional fields supported:
 USER: ! Who did the deploy? Our Capistrano helper defaults to $USER, but can be anything.! ! REVISION: What was deployed?! ! CHANGELOG: Up to 64k of text that will be shown on the Change log page. https://docs.newrelic.com/docs/apm/new-relic-apm/maintenance/deployment-notifications
  11. 11 Using cURL curl -v \ -H "X-Api-Key: 07df07df07df07df07df07df07df07df07df07df07df07df" \

    -d "deployment[app_id]=12345" \ -d "deployment[description]=Cool deployment" \ https://api.newrelic.com/deployments.xml
  12. 12 Using the Ruby or Java Agent CLI to record

    a deployment # Ruby Agent newrelic deployments [options] # Java Agent java -jar newrelic.jar deployment [options]
  13. 13 Using Capistrano with the Ruby Agent # # Capfile

    # require 'capistrano/setup' # Include default deployment tasks require 'capistrano/deploy' require 'capistrano/console' require 'capistrano/rbenv' require 'capistrano/bundler' # New Relic Agent tasks require 'new_relic/recipes' # # config/deploy.rb # before 'deploy:finished', 'newrelic:notice_deployment'
  14. 14 Understanding Capistrano Tasks deploy deploy:starting [before] deploy:ensure_stage deploy:set_shared_assets deploy:check

    deploy:started deploy:updating git:create_release deploy:symlink:shared deploy:updated [before] deploy:bundle [after] deploy:migrate deploy:compile_assets deploy:normalize_assets deploy:publishing deploy:symlink:release deploy:published deploy:finishing deploy:cleanup deploy:finished deploy:log_revision deploy deploy:starting [before] deploy:ensure_stage deploy:set_shared_assets deploy:check deploy:started deploy:reverting deploy:revert_release deploy:reverted [after] deploy:rollback_assets deploy:publishing deploy:symlink:release deploy:published deploy:finishing_rollback deploy:cleanup_rollback deploy:finished deploy:log_revision http://capistranorb.com/documentation/getting-started/flow/
  15. 15 Deploys in context

  16. 16 Continuous Deployment

  17. 17 Deploy detail

  18. 18 Deploy detail

  19. 19 Recording Deployments

  20. Thanks! ©2008-15 New Relic, Inc. All rights reserved.