Skip to content

Instantly share code, notes, and snippets.

@ctrombley
Last active February 4, 2021 22:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ctrombley/a368908338cbe7b4287045fed7ea2f46 to your computer and use it in GitHub Desktop.
Save ctrombley/a368908338cbe7b4287045fed7ea2f46 to your computer and use it in GitHub Desktop.
Recipe definition with recommendationPreReq section
name: language-agent
displayName: Some languaage agent
description: New Relic install recipe for some laanguage agent
repository: https://github.com/newrelic/whatever
installTargets:
- type: ...
os: ...
platform: ...
# keyword convention for dealing with search terms that could land someone on this instrumentation project
keywords:
- ...
preInstall:
version: "3"
silent: true
tasks:
default:
cmds:
- task: installLSI
- task: findProcess
installLSI:
cmds:
- |
echo "install LSI"
yum install newrelic-lsi
findProcesses:
cmds:
- |
echo "find process"
# newrelic-lsi --discover
export JAVA_PROCESS=12345|mycommand,45678|someothercommand
# Prompts for input from the user. These variables then become
# available to go-task in the form of {{.VAR_NAME}}
inputVars:
- name: "JAVA_PID_TO_INSTRUMENT"
prompt: "Would you like to instrument PID ((.JAVA_PROCESS.PID}}?"
# NRQL the newrelic-cli will use to validate the agent/integration this recipe
# installed is successfully sending data to New Relic
validationNrql: "SELECT count(*) from Transaction where appName like '{{.APPNAME}}' SINCE 10 minutes ago"
install:
version: "3"
silent: true
tasks:
default:
cmds:
- task: instrumentJavaApp
instrumentJavaApp:
cmds:
- |
echo "doing a thing"
newrelic-lsi --instrument {{.JAVA_PID_TO_INSTRUMENT}}
name: language-agent
displayName: Some languaage agent
description: New Relic install recipe for some laanguage agent
repository: https://github.com/newrelic/whatever
installTargets:
- type: ...
os: ...
platform: ...
# keyword convention for dealing with search terms that could land someone on this instrumentation project
keywords:
- ...
// All of the commands in this section must return with a successful exit
// code for this recipe to be designated as recommended.
// The stdout/stderr streams will be suppressed since the user should not
// know anything about this recipe until is has been designated as rrecommended.
// (They can optionally be surfaced if the log level is set to verbose.)
recommendationPreReq:
version: "3"
silent: true
tasks:
default:
cmds:
- task: isRecommended
isRecommended:
cmds:
- |
echo "determine if the recipe is recommended"
install:
version: "3"
silent: true
tasks:
default:
cmds:
- task: install
install:
cmds:
- |
echo "doing a thing"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment