Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Support custom metrics rules for PrometheusSink #3493

Conversation

thinker0
Copy link
Member

@thinker0 thinker0 commented Mar 21, 2020

#3445

Support custom metrics rules for PrometheusSink

AS-IS

  • Prometheus Metrics (apache-storm-kafka-client Spot)
heron_instance_bytes_received_1
heron_client_stmgr_10_hello_messages_to_stmgrs
heron_kafkaoffset_ad_dmp_dpa_event_integration_partition_100_earliesttimeoffset
heron_kafkaoffset_ad_dmp_dpa_event_integration_partition_100_latestcompletedoffset
heron_kafkaoffset_ad_dmp_dpa_event_integration_partition_100_latestemittedoffset
heron_kafkaoffset_ad_dmp_dpa_event_integration_partition_100_latesttimeoffset
heron_kafkaoffset_ad_dmp_dpa_event_integration_partition_100_recordsinpartition
heron_kafkaoffset_ad_dmp_dpa_event_integration_partition_100_spoutlag

TO-BE

Add metics_sink.yaml

### Config for prometheus-sink
prometheus-sink:
  class: "org.apache.heron.metricsmgr.sink.PrometheusSink"
  # port: 8080 # The port on which to run (either port or port-file are mandatory)
  path: /metrics # The path on which to publish the metrics (mandatory)
  port-file: metrics.port
  flat-metrics: true # By default the web-sink will publish a flat "name -> value" json map
  include-topology-name: true # Include topology name in metric name (default false)
  metrics-cache-max-size: 1000000 # Max number of metrics cached and published (default 1000000)
  metrics-cache-ttl-sec: 600 # Time in seconds after which a metric that was collected will stopped being published (default 600)
  rules:
    # kafkaOffset of KafkaSpout 'kafkaOffset/topicName/totalSpoutLag'
    - pattern: kafkaOffset/(.+)/(.+)
      name: kafka_offset_$2
      attrNameSnakeCase: true
      type: COUNTER
      labels:
        topic: "$1"
    # kafkaOffset of KafkaSpout 'kafkaOffset/topicName/partition_2/spoutLag'
    - pattern: kafkaOffset/(.+)/partition_([0-9]+)/(.+)
      name: kafka_offset_$3
      attrNameSnakeCase: true
      type: COUNTER
      labels:
        topic: "$1"
        partition: "$2"

to

heron_instance_bytes_received{metric_instance_id="1"}
heron_client_stmgr_hello_messages_to_stmgrs{metric_instance_id="stmgr-10"}
heron_kafka_offset_earliest_time_offset{topic="ad_dmp_dpa_event_integration",partition="100"}
heron_kafka_offset_latest_completed_offset{topic="ad_dmp_dpa_event_integration",partition="100"}
heron_kafka_offset_latest_emitted_offset{topic="ad_dmp_dpa_event_integration",partition="100"}
heron_kafka_offset_latest_time_offset{topic="ad_dmp_dpa_event_integration",partition="100"}
heron_kafka_offset_records_in_partition{topic="ad_dmp_dpa_event_integration",partition="100"}
heron_kafka_offset_spout_lag{topic="ad_dmp_dpa_event_integration",partition="100"}

nwangtw and others added 28 commits February 6, 2020 17:52
* Support Java 11

* config travis to use oracle jdk 11

* Add check jdk version
Change insert gc_options

Update list

Fix gc-logging
* Support Java 11

* config travis to use oracle jdk 11

* Add check jdk version
Change insert gc_options

Update list

Fix gc-logging
…etheus-metrics' of https://github.com/thinker0/heron into feature/fix-prometheus-metrics

* 'feature/fix-prometheus-metrics' of https://github.com/thinker0/heron:
  Remove unused
  Fix checkstyle
  Support jmx_exporter format configuration.
  wip
  Fix command arguments.
  Java 11 support (apache#3399)
  Update README for Java 11 (apache#3464)
  Update website for java 11 (apache#3462)
  Java 11 support (apache#3454)
  adding examples folder to classpath (apache#3458)
  removing symlink.  Adding contributing guidelines back (apache#3450)
  adding new committers (apache#3451)
  Bump mixin-deep from 1.3.1 to 1.3.2 in /website2/website (apache#3391)
  Add redirect from github pages to new apache site (apache#3448)
  remove old site (apache#3446)
  Use netcat-bsd in Debian (apache#3447)
  Added execute permission to dev-env-create.sh (apache#3443)

* 'feature/fix-prometheus-metrics' of https://github.com/thinker0/heron:
  Remove unused
  Fix checkstyle
  Support jmx_exporter format configuration.
  wip
  Fix command arguments.
  Java 11 support (apache#3399)
  Update README for Java 11 (apache#3464)
  Update website for java 11 (apache#3462)
  Java 11 support (apache#3454)
  adding examples folder to classpath (apache#3458)
  removing symlink.  Adding contributing guidelines back (apache#3450)
  adding new committers (apache#3451)
  Bump mixin-deep from 1.3.1 to 1.3.2 in /website2/website (apache#3391)
  Add redirect from github pages to new apache site (apache#3448)
  remove old site (apache#3446)
  Use netcat-bsd in Debian (apache#3447)
  Added execute permission to dev-env-create.sh (apache#3443)

# Conflicts:
#	.travis.yml
* master:
  Improve concurrency for needed parts. (apache#3107)
  Add documents for setting up a docker based development environment (apache#3475)
  Patch to fix cppcheck with newer glibc (apache#3471)
  Make log/sink/consume Streamlet component support setName and setNumPartitions (apache#3459)
* Change concurrent Map

* Change concurrent Map

* HashMap changes for unneeded parts.

* HashMap changes for unneeded parts.

* Review changes

* Changes HashMap for unneeded parts.

* Improve concurrency for needed parts.

* Remove unused imports.

* Remove unused imports.

* Remove unused imports.

* Fix NPE

(cherry picked from commit 545d381)

* Fix WhitespaceAround

* Add dummy Object

* Fix ConstantName

(cherry picked from commit 8d6d506)
…hinker0/heron into feature/support-custom-metrics-rules-for-prometheus-sink

* 'feature/fix-prometheus-metrics' of https://github.com/thinker0/heron:
  Add Rules
  Update kafkaOffset metrics
  Improve concurrency for needed parts. (apache#3107)
  Add documents for setting up a docker based development environment (apache#3475)
  Patch to fix cppcheck with newer glibc (apache#3471)
  Make log/sink/consume Streamlet component support setName and setNumPartitions (apache#3459)
@thinker0
Copy link
Member Author

@nicknezis how to retest this please

@joshfischer1108
Copy link
Member

@thinker0 I don't seem to have the permissions to restart the build anymore. Not sure what's going on with Travis. @nwangtw could you try to restart the build?

@joshfischer1108
Copy link
Member

@thinker0 I was able to restart the job for you.

@thinker0 thinker0 requested a review from nwangtw March 31, 2020 05:31
@nwangtw nwangtw merged commit b069e45 into apache:master Apr 2, 2020
@thinker0 thinker0 deleted the feature/support-custom-metrics-rules-for-prometheus-sink branch April 2, 2020 05:50
sreev pushed a commit to sreev/incubator-heron that referenced this pull request Apr 9, 2020
* Support Java 11

* config travis to use oracle jdk 11

* Java 11 support (apache#3399)

* Support Java 11

* config travis to use oracle jdk 11

* Add check jdk version

* Fix command arguments.

Change insert gc_options

Update list

Fix gc-logging

* Add missing parameter

* typo

* Add pause time

* wip

* Support jmx_exporter format configuration.

* Fix checkstyle

* Remove unused

* Java 11 support (apache#3399)

* Support Java 11

* config travis to use oracle jdk 11

* Add check jdk version

* Fix command arguments.

Change insert gc_options

Update list

Fix gc-logging

* wip

* Support jmx_exporter format configuration.

* Fix checkstyle

* Remove unused

* Update kafkaOffset metrics

* Add Rules

* Make log/sink/consume Streamlet component support setName and setNumPartitions (apache#3459)

* Patch to fix cppcheck with newer glibc (apache#3471)

* Add documents for setting up a docker based development environment (apache#3475)

* Improve concurrency for needed parts. (apache#3107)

* Change concurrent Map

* Change concurrent Map

* HashMap changes for unneeded parts.

* HashMap changes for unneeded parts.

* Review changes

* Changes HashMap for unneeded parts.

* Improve concurrency for needed parts.

* Remove unused imports.

* Remove unused imports.

* Remove unused imports.

* Fix NPE

(cherry picked from commit 545d381)

* Fix WhitespaceAround

* Add dummy Object

* Fix ConstantName

(cherry picked from commit 8d6d506)

* Update kafkaOffset metrics

* Add Rules

* Update line is longer than 100 characters

* Update line is longer than 100 characters

* Add attrNameSnakeCase or other metrics fix

* fix checkstyle

Co-authored-by: Ning Wang <wangninggm@gmail.com>
Co-authored-by: Ning Wang <nwang@twitter.com>
Co-authored-by: Nicholas Nezis <nicholas.nezis@gmail.com>
nicknezis added a commit that referenced this pull request Sep 14, 2020
* Support Java 11

* config travis to use oracle jdk 11

* Java 11 support (#3399)

* Support Java 11

* config travis to use oracle jdk 11

* Add check jdk version

* Fix command arguments.

Change insert gc_options

Update list

Fix gc-logging

* Add missing parameter

* typo

* Add pause time

* wip

* Support jmx_exporter format configuration.

* Fix checkstyle

* Remove unused

* Java 11 support (#3399)

* Support Java 11

* config travis to use oracle jdk 11

* Add check jdk version

* Fix command arguments.

Change insert gc_options

Update list

Fix gc-logging

* wip

* Support jmx_exporter format configuration.

* Fix checkstyle

* Remove unused

* Update kafkaOffset metrics

* Add Rules

* Make log/sink/consume Streamlet component support setName and setNumPartitions (#3459)

* Patch to fix cppcheck with newer glibc (#3471)

* Add documents for setting up a docker based development environment (#3475)

* Improve concurrency for needed parts. (#3107)

* Change concurrent Map

* Change concurrent Map

* HashMap changes for unneeded parts.

* HashMap changes for unneeded parts.

* Review changes

* Changes HashMap for unneeded parts.

* Improve concurrency for needed parts.

* Remove unused imports.

* Remove unused imports.

* Remove unused imports.

* Fix NPE

(cherry picked from commit 545d381)

* Fix WhitespaceAround

* Add dummy Object

* Fix ConstantName

(cherry picked from commit 8d6d506)

* Update kafkaOffset metrics

* Add Rules

* Update line is longer than 100 characters

* Update line is longer than 100 characters

* Add attrNameSnakeCase or other metrics fix

* fix checkstyle

Co-authored-by: Ning Wang <wangninggm@gmail.com>
Co-authored-by: Ning Wang <nwang@twitter.com>
Co-authored-by: Nicholas Nezis <nicholas.nezis@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants