-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from newrelic-experimental/docs/infra-apm
docs: add cluster init script examples and documentation
- Loading branch information
Showing
4 changed files
with
227 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
# Define the newrelic version, jar path, and config path | ||
|
||
NEW_RELIC_VERSION="current" # update if you want to use a specific version | ||
NEW_RELIC_JAR_PATH="/databricks/jars/newrelic-agent.jar" | ||
NEW_RELIC_CONFIG_FILE="/databricks/jars/newrelic.yml" | ||
|
||
# Download the newrelic java agent | ||
curl -o $NEW_RELIC_JAR_PATH -L https://download.newrelic.com/newrelic/java-agent/newrelic-agent/$NEW_RELIC_VERSION/newrelic-agent.jar | ||
|
||
NEW_RELIC_APP_NAME="Databricks" | ||
|
||
if [ "$DB_IS_DRIVER" = "TRUE" ]; then | ||
NEW_RELIC_APP_NAME+=" Driver" | ||
else | ||
NEW_RELIC_APP_NAME+=" Executor" | ||
fi | ||
|
||
# Create agent config file | ||
sudo cat <<EOM > $NEW_RELIC_CONFIG_FILE | ||
common: &default_settings | ||
app_name: $NEW_RELIC_APP_NAME | ||
license_key: $NEW_RELIC_LICENSE_KEY | ||
agent_enabled: true | ||
labels: "databricksClusterId:$DB_CLUSTER_ID;databricksClusterName:$DB_CLUSTER_NAME;databricksIsDriverNode:$DB_IS_DRIVER;databricksIsJobCluster:$DB_IS_JOB_CLUSTER" | ||
production: | ||
<<: *default_settings | ||
EOM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
# Define the config path | ||
|
||
NEW_RELIC_CONFIG_FILE="/etc/newrelic-infra.yml" | ||
|
||
# Add New Relic's Infrastructure Agent gpg key | ||
curl -fsSL https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/newrelic-infra.gpg | ||
|
||
# Create a manifest file | ||
echo "deb https://download.newrelic.com/infrastructure_agent/linux/apt/ jammy main" | sudo tee -a /etc/apt/sources.list.d/newrelic-infra.list | ||
|
||
# Run an update | ||
sudo apt-get update | ||
|
||
# Install the New Relic Infrastructure agent | ||
sudo apt-get install newrelic-infra -y | ||
|
||
# Create the agent config file | ||
sudo cat <<EOM >> $NEW_RELIC_CONFIG_FILE | ||
license_key: $NEW_RELIC_LICENSE_KEY | ||
custom_attributes: | ||
databricksClusterId: $DB_CLUSTER_ID | ||
databricksClusterName: $DB_CLUSTER_NAME | ||
databricksIsDriverNode: $DB_IS_DRIVER | ||
databricksIsJobCluster: $DB_IS_JOB_CLUSTER | ||
EOM | ||
|
||
# Start the agent | ||
sudo systemctl start newrelic-infra |