Commit 97717455 by Feanil Patel

Merge pull request #2429 from edx/feanil/new_relic_labels

Add labels to clusters in Newrelic
parents 14cea6e7 fe35c68b
......@@ -6,6 +6,7 @@
ENABLE_DATADOG: False
ENABLE_SPLUNKFORWARDER: False
ENABLE_NEWRELIC: False
CLUSTER_NAME: 'analytics-api'
roles:
- role: nginx
nginx_sites:
......
......@@ -6,6 +6,7 @@
ENABLE_DATADOG: False
ENABLE_SPLUNKFORWARDER: False
ENABLE_NEWRELIC: False
CLUSTER_NAME: 'ecommerce'
roles:
- role: nginx
nginx_sites:
......
......@@ -4,6 +4,7 @@
gather_facts: True
vars:
serial_count: 1
CLUSTER_NAME: 'edxapp'
serial: "{{ serial_count }}"
roles:
- aws
......
......@@ -7,6 +7,7 @@
elb_pre_post: true
# Number of instances to operate on at a time
serial_count: 1
CLUSTER_NAME: "commoncluster"
serial: "{{ serial_count }}"
pre_tasks:
- action: ec2_facts
......
......@@ -4,6 +4,7 @@
gather_facts: True
vars:
serial_count: 1
CLUSTER_NAME: 'forum'
serial: "{{ serial_count }}"
roles:
- aws
......
......@@ -6,6 +6,7 @@
ENABLE_DATADOG: False
ENABLE_SPLUNKFORWARDER: False
ENABLE_NEWRELIC: True
CLUSTER_NAME: 'insights'
roles:
- role: nginx
nginx_sites:
......
......@@ -6,6 +6,7 @@
ENABLE_DATADOG: False
ENABLE_SPLUNKFORWARDER: False
ENABLE_NEWRELIC: False
CLUSTER_NAME: 'programs'
roles:
- role: nginx
nginx_sites:
......
......@@ -12,6 +12,7 @@
elb_pre_post: true
# Number of instances to operate on at a time
serial_count: 1
CLUSTER_NAME: 'commoncluster'
serial: "{{ serial_count }}"
pre_tasks:
- action: ec2_facts
......
......@@ -9,6 +9,7 @@
elb_pre_post: true
# Number of instances to operate on at a time
serial_count: 1
CLUSTER_NAME: 'commoncluster'
serial: "{{ serial_count }}"
pre_tasks:
- action: ec2_facts
......
......@@ -30,7 +30,3 @@ newrelic_debian_pkgs:
newrelic_redhat_pkgs:
- newrelic-sysmond
newrelic_debian_plugin_pkgs:
- ruby-bundler
- rubygems
......@@ -55,10 +55,13 @@
with_items: newrelic_redhat_pkgs
when: ansible_distribution == 'Amazon'
- name: configure the agent with the license key
shell: >
nrsysmond-config --set license_key="{{ NEWRELIC_LICENSE_KEY }}"
ssl=true
- name: configure the agent
template:
src: "etc/newrelic/nrsysmond.cfg.j2"
dest: "/etc/newrelic/nrsysmond.cfg"
owner: "newrelic"
group: "newrelic"
mode: 0640
- name: ensure started and enabled
service: name=newrelic-sysmond state=restarted enabled=yes
#
# New Relic Server Monitor configuration file.
#
# Lines that begin with a # are comment lines and are ignored by the server
# monitor. For those options that have command line equivalents, if the
# option is specified on the command line it will over-ride any value set
# in this file.
#
#
# Option : license_key
# Value : 40-character hexadecimal string provided by New Relic. This is
# required in order for the server monitor to start.
# Default: none
#
license_key={{ NEWRELIC_LICENSE_KEY }}
#
# Option : loglevel
# Value : Level of detail you want in the log file (as defined by the logfile
# setting below. Valid values are (in increasing levels of verbosity):
# error - show errors only
# warning - show errors and warnings
# info - show minimal additional information messages
# verbose - show more detailed information messages
# debug - show debug messages
# verbosedebug - show very detailed debug messages
# Default: info
# Note : Can also be set with the -d command line option.
#
loglevel=info
#
# Option : logfile
# Value : Name of the file where the server monitor will store it's log
# messages. The amount of detail stored in this file is controlled
# by the loglevel option (above).
# Default: none. However it is highly recommended you set a value for this.
# Note : Can also be set with the -l command line option.
#
logfile=/var/log/newrelic/nrsysmond.log
#
# Option : proxy
# Value : The name and optional login credentials of the proxy server to use
# for all communication with the New Relic collector. In its simplest
# form this setting is just a hostname[:port] setting. The default
# port if none is specified is 1080. If your proxy requires a user
# name, use the syntax user@host[:port]. If it also requires a
# password use the format user:password@host[:port]. For example:
# fred:secret@proxy.mydomain.com:8181
# Default: none (use a direct connection)
#
#proxy=
#
# Setting: ssl
# Type : boolean
# Purpose: If you prefer the daemon to use the secure HTTP (https) protocol
# when communicating with the New Relic collector servers, set this
# to true.
# Default: true (as of version 1.4)
#
ssl=true
#
# Setting: hostname
# Type : string
# Purpose: Sets the name of the host (max 64 characters) that you wish to use
# for reporting. This is usually determined automatically on startup
# but you may want to change it if, for example, you have machine
# generated hostnames that are not visually useful (for example, the
# names generated by Docker containers).
# Default: The system configured host name
#
#hostname=myhost
#
# Setting: docker_connection
# Type : string
# Purpose: Determine how to communicate with the Docker API on the local host.
# Valid values are:
#
# uds:///path/to/socket
# unix:///path/to/socket
# /path/to/socket
# These three forms are all equivalent and are used to point to the
# UNIX-domain socket (UDS). The socket path must be absolute and the
# socket must be writeable.
#
# tcp://localhost:port
# http://localhost:port
# Use an unencrypted connection to the local host on the specified
# port. If the :port portion is missing it defaults to 2376. The
# host name MUST be localhost or 127.0.0.1. No other host name is
# valid.
#
# https://localhost:port
# Use an encrypted connection to the local host om the specified
# port. If the :port portion is missing it defaults to 2376. The
# host name MUST be localhost or 127.0.0.1. No other host name is
# valid. In order to use TLS authentication you may need to set
# the various key and certificate options below.
#
# If no value is set, attempt to use the default (/var/run/docker.sock)
# if it exists and is writable. If that fails, attempt to use the value
# of the environment variable DOCKER_HOST.
#
# You may need to add the user that you run LSM as to the docker
# group. Please consult the Docker web site for details and security
# implications.
# Default: empty
#docker_connection=
#
# Setting: docker_cert_path
# Type : string
# Purpose: Set the default location to look for the certificate, key and CA
# certificate for using TLS. If no value is set and the directory
# $HOME/.docker exists, that is used as the default value. LSM will
# look in this directory for the cert.pem, key.pem and cacert.pem
# files, and use them if present. If set, the environment variable
# $DOCKER_CERT_PATH will be used as the default value if no value
# is explicitly set here.
# Default: empty
#docker_cert_path=
#
# Setting: docker_cert
# docker_key
# docker_cacert
# Type : string
# Purpose: Set the name of the certificate, key and CA certificate files to
# use for TLS. If these are not absolute paths they are searched for
# in the directory determined by docker_cert_path above.
# Default: empty
#docker_cert=
#docker_key=
#docker_cacert=
#
# Setting: ssl_ca_bundle
# Type : string
# Purpose: Sets the location of a file containing CA certificates in PEM
# format. When set, the certificates in this file will be used
# to authenticate the New Relic collector servers. If ssl_ca_path
# is also set (see below), the certificates in this file will be
# searched first, followed by the certificates contained in the
# ssl_ca_path directory. This setting has no effect when ssl
# is set to false.
# Default: none
# Note : Can also be set with the -b command line option.
#
#ssl_ca_bundle=
#
# Setting: ssl_ca_path
# Type : string
# Purpose: Sets the location of a directory containing trusted CA certificates
# in PEM format. When set, the certificates in this directory will be
# used to authenticate the New Relic collector servers. If
# ssl_ca_bundle is also set (see above), it will be searched first
# followed by the certificates contained in ssl_ca_path. This
# setting has no effect when ssl is set to false.
# Default: none
# Note : Can also be set with the -S command line option.
#
#ssl_ca_path=
#
# Option : pidfile
# Value : Name of a file where the server monitoring daemon will store it's
# process ID (PID). This is used by the startup and shutdown script
# to determine if the monitor is already running, and to start it up
# or shut it down.
# Default: /tmp/nrsysmond.pid
# Note : Can also be set with the -p command line option.
#
#pidfile=/var/run/newrelic/nrsysmond.pid
#
# Option : collector_host
# Value : The name of the New Relic collector to connect to. This should only
# ever be changed on advise from a New Relic support staff member.
# The format is host[:port]. Using a port number of 0 means the default
# port, which is 80 (if not using the ssl option - see below) or 443
# if SSL is enabled. If the port is omitted the default value is used.
# Default: collector.newrelic.com
#
#collector_host=collector.newrelic.com
#
# Option : labels
# Value : A series of label_type/label_value pairings
# Each item in the pair is separated by a colon
# Each pair is separated by a semicolon
# e.g.
# labels = Environment:Production;DataCenter:EastUS;
# Default: none
#
#
{% set labels = "Enviornment:" + COMMON_ENVIRONMENT + ";Deployment:" + COMMON_DEPLOYMENT + ";" %}
{% if CLUSTER_NAME is defined %}
{% set labels = labels + "Cluster:" + CLUSTER_NAME + ";" %}
{% endif %}
labels={{ labels }}
#
# Option : disable_nfs
# Type : boolean
# Value : Set to true to disable NFS client statistics gathering.
# Default: false
#
#disable_nfs=false
#
# Option : disable_docker
# Type : boolean
# Value : Set to true to disable Docker container statistics gathering.
# Default: false
#
#disable_docker=false
#
# Option : cgroup_root
# Type : string
# Value : Set to the top level mount point for CGroup data files. Usually
# the daemon will auto-detect this but you can provide a specific
# path if, for example, you have multiple CGroup mounts.
# Default: Distribution dependent, but usually /sys/fs/cgroup or /cgroup.
#cgroup_root=
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment