danil-smirnov / logs-insights-to-metric

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

logs-insights-to-metric

This project is to publish data from CloudWatch Logs Insights to Custom Metrics.

Please read this blog post for more details:
https://blog.smirnov.la/cloudwatch-logs-insights-to-metrics-a2d197aac379

Project page in AWS Serverless Application Repository:
https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:085576722239:applications~logs-insights-to-metric

Deployment parameters

Must set:

  • LogGroupNames - Comma separated names of CloudWatch log groups to query
  • MetricName - A name of CloudWatch metric to put data into
  • MetricNamespace - A namespace of CloudWatch metric to put data into
  • QueryString - replace the default by something meaningful for you

Reasonable defaults:

  • Dimensions - Optional metric dimensions definition in JSON
  • GroupingDimensionName - A name of metric dimension used for grouping (default: 'Log group')
  • QueryDelay - Time to wait before data available to query in minutes (default: 3 min)
  • QueryGroupBy - CloudWatch Logs Insights field name used for grouping (default: '@log')
  • QueryPeriod - Time window size in minutes (default: 5 min)
  • QueryRetry - Delay between getQueryResults retries in ms (default: 1000 ms)
  • QueryString - CloudWatch Logs Insights query to run
    (default: 'fields @log, @timestamp, @message | stats count() by @log' - log entries number per log group)
  • SkipEmpty - Wether to skip empty query results or post them as zeros (default: 'true')
  • Unit - Optional unit name (default: 'Count')

About

License:MIT License