Skip to content

Commit

Permalink
Pushing metrics now
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhrubajyoti Sadhu committed Feb 5, 2024
1 parent ec5c84b commit f1f7857
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ RUN yum -y install java-1.8.0-openjdk \
wget \
zip \
unzip \
curl \
jq \
tar \
net-tools \
Expand Down
2 changes: 1 addition & 1 deletion files/jmx-exporter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ lowercaseOutputName: true
lowercaseOutputLabelNames: true
attrNameSnakeCase: true
rules:
- pattern: ".*"
- pattern: ".*"
14 changes: 2 additions & 12 deletions files/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,15 @@ fi

if [ -n "$ENABLE_METRICS" ]; then
update_property.py hive.metastore.metrics.enabled true /etc/hive/conf/hive-site.xml
#configure to send metrics to cloudwatch when running on ECS
if [ -n "$ECS_CONTAINER_METADATA_URI" ]; then

export HADOOP_CLIENT_OPTS="$HADOOP_CLIENT_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=8088"

# enable prometheus jmx agent when running on ECS
export HADOOP_CLIENT_OPTS="$HADOOP_CLIENT_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=8088"
export EXPORTER_OPTS="-javaagent:/usr/lib/apiary/jmx_prometheus_javaagent-${EXPORTER_VERSION}.jar=8080:/etc/hive/conf/jmx-exporter.yaml"
export CLOUDWATCH_NAMESPACE="${INSTANCE_NAME}-metastore"
export ECS_TASK_ID=$(wget -q -O - ${ECS_CONTAINER_METADATA_URI}/task|jq -r .TaskARN|awk -F/ '{ print $NF }')

#this is populating something in 8080
# Enable it to send metrics to Cloudwatch
#update_property.py hive.service.metrics.class com.expediagroup.apiary.extensions.metastore.metrics.CodahaleMetrics /etc/hive/conf/hive-site.xml
echo "This is the curl command"
curl -v localhost:8080/metrics 2>&1 > curl_output.txt
cat curl_output.txt
echo "cat curl_output.txt"

fi
#enable prometheus jmx agent when running on kubernetes
if [ -n "$KUBERNETES_SERVICE_HOST" ]; then
Expand Down Expand Up @@ -223,5 +215,3 @@ fi

export HADOOP_OPTS="-XshowSettings:vm -Xms${HADOOP_HEAPSIZE}m $EXPORTER_OPTS"
su hive -s/bin/bash -c "/usr/lib/hive/bin/hive --service metastore --hiveconf javax.jdo.option.ConnectionURL=jdbc:mysql://${MYSQL_DB_HOST}:3306/${MYSQL_DB_NAME} --hiveconf javax.jdo.option.ConnectionUserName='${MYSQL_DB_USERNAME}' --hiveconf javax.jdo.option.ConnectionPassword='${MYSQL_DB_PASSWORD}'"


0 comments on commit f1f7857

Please sign in to comment.