Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

2. Define new application metadata

Code Block
languagebash
# EAGLE_SERVICE_HOST, default is `hostname -f`
export EAGLE_SERVICE_HOST=localhost
# EAGLE_SERVICE_PORT, default is 9099
export EAGLE_SERVICE_PORT=9099
# EAGLE_SERVICE_USER
export EAGLE_SERVICE_USER=admin
# EAGLE_SERVICE_PASSWORD
export EAGLE_SERVICE_PASSWD=secret
curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
 "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=SiteApplicationService" \
  -d '
  [
     {
        "tags":{
           "site":"sandbox",
           "application":"cassandraQueryLogMonitorcassandraQueryLog"
        },
        "enabled": true,
        "config": "{}"
     }
  ]
  '

curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
 "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=ApplicationDescService" \
  -d '
  [
     {
        "tags":{
           "application":"cassandraQueryLogMonitorcassandraQueryLog"
        },
        "desc":"cassandra Query Log Monitoring",
        "alias":"QueryLogMonitor",
        "group":"Cassandra",
        "config":"{}",
        "features":["common","metadata"]
     }
  ]
  '

## AlertStreamService: alert streams generated from data source
echo ""
echo "Importing AlertStreamService for HDFS... "
curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
 "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamService" \
 -d '
 [
    {
       "prefix":"alertStream",
       "tags":{
          "dataSource":"hadoopJmxMetricDataSourcecassandraQueryLog",
          "streamName":"hadoopJmxMetricEventStreamcassandraQueryLogStream"
       },
       "desc":"hadoopcassandra query log data source stream"
    }
 ]
 '

## AlertExecutorService: what alert streams are consumed by alert executor
echo ""
echo "Importing AlertExecutorService for HDFS... "
curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
 "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertExecutorService" \
 -d '
 [
    {
       "prefix":"alertExecutor",
       "tags":{
          "dataSource":"hadoopJmxMetricDataSourcecassandraQueryLog",
          "alertExecutorId":"hadoopJmxMetricAlertExecutorcassandraQueryLogExecutor",
          "streamName":"hadoopJmxMetricEventStreamcassandraQueryLogStream"
       },
       "desc":"aggregate executor for hadoopcassandra jmxquery metric eventlog stream"
    }
 ]
 '

## AlertStreamSchemaService: schema for event from alert stream
echo ""
echo "Importing AlertStreamSchemaService for HDFS... "
curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
"http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamSchemaService" \
 -d '
 [
    {
       "prefix": "alertStreamSchema",
       "tags": {
          "dataSource": "hadoopJmxMetricDataSourcecassandraQueryLog",
          "streamName": "hadoopJmxMetricEventStreamcassandraQueryLogStream",
          "attrName": "host"
       },
       "attrDescription": "the host that current metric comes form",
       "attrType": "string",
       "category": "",
       "attrValueResolver": ""
    },
    {
       "tags": {
          "prefixdataSource": "cassandraQueryLog",
          "streamName": "cassandraQueryLogStream",
          "attrName": "source"
       },
       "attrDescription": "source host",
       "attrType": "string",
       "category": "",
       "attrValueResolver": "alertStreamSchema"
    },
    {
       "tags": {
          "dataSource": "hadoopJmxMetricDataSourcecassandraQueryLog",
          "streamName": "hadoopJmxMetricEventStreamcassandraQueryLogStream",
          "attrName": "timestampuser"
       },
       "attrDescription": "thequery metric timestampuser",
       "attrType": "longstring",
       "category": "",
       "attrValueResolver": ""
    },
    {
       "tags": {
          "dataSource": "cassandraQueryLog",
          "streamName": "cassandraQueryLogStream",
          "attrName": "timestamp"
       },
       "attrDescription": "query timestamp",
       "prefixattrType": "long",
       "category": "",
       "attrValueResolver": "alertStreamSchema"
    },
    {
       "tags": {
          "dataSource": "hadoopJmxMetricDataSourcecassandraQueryLog",
          "streamName": "hadoopJmxMetricEventStreamcassandraQueryLogStream",
          "attrName": "metriccategory"
       },
       "attrDescription": "thequery metric namecategory",
       "attrType": "string",
       "category": "",
       "attrValueResolver": ""
    },
    {
       "tags": {
          "dataSource": "cassandraQueryLog",
       "prefix   "streamName": "cassandraQueryLogStream",
          "attrName": "type"
       },
       "attrDescription": "query type",
       "attrType": "string",
       "category": "",
       "attrValueResolver": "alertStreamSchema"
    },
    {
       "tags": {
          "dataSource": "hadoopJmxMetricDataSourcecassandraQueryLog",
          "streamName": "hadoopJmxMetricEventStreamcassandraQueryLogStream",
          "attrName": "componentks"
       },
       "attrDescription": "query "the component that the metric comes from",keyspace",
       "attrType": "string",
       "category": "",
       "attrValueResolver": ""
    },
    {
       "attrType"tags": {
          "dataSource": "stringcassandraQueryLog",
          "categorystreamName": "cassandraQueryLogStream",
          "attrValueResolverattrName": "cf"
       },
       {"attrDescription": "query column family",
       "attrType": "string",
       "category": "",
       "prefixattrValueResolver": "alertStreamSchema"
    },
    {
       "tags": {
          "dataSource": "hadoopJmxMetricDataSourcecassandraQueryLog",
          "streamName": "hadoopJmxMetricEventStreamcassandraQueryLogStream",
          "attrName": "siteoperation"
       },
       "attrDescription": "the site that the metric belongs to",query operation",
       "attrType": "string",
       "category": "",
       "attrValueResolver": ""
    },
    {
       "attrTypetags": {
          "dataSource": "stringcassandraQueryLog",
          "categorystreamName": "cassandraQueryLogStream",
          "attrValueResolverattrName": "masked_columns"
       },
       "attrDescription": "query masked_columns",
       "attrType": "string",
       {"category": "",
       "prefixattrValueResolver": "alertStreamSchema"
    },
    {
       "tags": {
          "dataSource": "hadoopJmxMetricDataSourcecassandraQueryLog",
          "streamName": "hadoopJmxMetricEventStreamcassandraQueryLogStream",
          "attrName": "valueother_columns"
       },
       "attrDescription": "the metric value in string presentationquery other_columns",
       "attrType": "doublestring",
       "category": "",
       "attrValueResolver": ""
    }
 ]
 '

## Finished
echo ""
echo "Finished initialization for eagle topology"

...