Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable prometheus jmx agent when running on ECS #121

Merged
merged 23 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [3.0.17] - 2024-01-31
### Added
- Enable prometheus jmx agent when running on ECS by exporting `EXPORTER_OPTS`

## [3.0.16] - 2024-01-11
### Added
- Added snapshot.yaml for pushing docker image from feature branch.
Expand Down
4 changes: 4 additions & 0 deletions files/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,14 @@ if [[ -n $RANGER_AUDIT_DB_URL ]]; then
fi
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

# enable prometheus jmx agent when running on ECS
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 }')
update_property.py hive.service.metrics.class com.expediagroup.apiary.extensions.metastore.metrics.CodahaleMetrics /etc/hive/conf/hive-site.xml
Expand Down
Loading