Git Product home page Git Product logo

awslabs / aws-serverless-prometheus-push-gateway Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 0.0 615 KB

AWS Serverless Prometheus Push Gateway enables you to push metrics into Prometheus from any source without modifying your application or running an always-on service for Prometheus to scrape.

Home Page: https://github.com/awslabs/aws-serverless-prometheus-push-gateway

License: Apache License 2.0

TypeScript 94.85% Python 5.15%
aws cdk-constructs opentelemetry prometheus serverless

aws-serverless-prometheus-push-gateway's Introduction

AWS Serverless Prometheus Push Gateway

AWS Serverless Prometheus Push Gateway enables you to push metrics into Prometheus from any source without modifying your application or running an always-on service for Prometheus to scrape. It includes an AWS CDK construct library that deploys an AWS Lambda function using the Amazon Distribution for OpenTelemetry ( ADOT) extension layer and connects it with an Amazon SQS queue and an Amazon Managed Service for Prometheus (AMP) workspace.

For example, you could create an AWS IoT Core rule to send telemetry data to AMP.

Build procedure

yarn
yarn run projen
yarn run build

Usage

This construct creates a Lambda that can be invoked with single events or by SQS with batches. API

See example/ for a sample CDK app that implements this construct.

Lambda event payload

Example

{
  "dimensions": {
    "customerId": "customer1"
  },
  "timestamp": 1676398017000,
  "metrics": {
    "temperature": "14.3",
    "ph": "6.7"
  }
}

Properties

  • dimensions: Key/value pairs of dimension names and values.
  • metrics: Key/value pairs of metric names and values.
  • timestamp: Timestamp in milliseconds since epoch.

Metric type inference

Metric values can either be integers or floating point numbers. There is a risk that floating point metrics will be interpreted as integers by the JSON parser. To avoid this, we recommend sending metrics as strings to preserve the decimal point.

{
  "metric1": 12.0,
  "metric2": "12.0"
}

In this example, metric1 will get interpreted as the integer value 12, but metric2 will have the decimal preserved.

Caveats

Amazon Managed Prometheus requires metrics for a given combination of labels to arrive in strictly ascending order by timestamp. Anything that arrives late gets rejected and dropped. In practice, as long as events for a given combination are sent on an interval of at most every 10 seconds, out-of-order messages are unlikely.

aws-serverless-prometheus-push-gateway's People

Contributors

amazon-auto avatar jstrunk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.