Git Product home page Git Product logo

tomkerkhove / promitor Goto Github PK

View Code? Open in Web Editor NEW
248.0 11.0 91.0 10.84 MB

Bringing Azure Monitor metrics where you need them.

Home Page: https://promitor.io

License: MIT License

C# 85.42% Shell 0.02% Makefile 0.02% HTML 0.34% JavaScript 0.07% Python 0.20% SCSS 5.13% Pug 8.79%
azure-monitor azure-monitor-metrics kubernetes docker kubernetes-metrics prometheus prometheus-metrics statsd atlassian-statuspage hacktoberfest

promitor's Introduction

Promitor Logo

Bringing Azure Monitor metrics where you need them.

License Docker Pulls Build Status Docker Stars Artifact Hub Donate

โš ๏ธ Promitor heavily relies on the community to introduce new features or patch bugs as I cannot do this alone anymore, learn more here.

Promitor is an Azure Monitor scraper which makes the metrics available through a scraping endpoint for Prometheus or push to a StatsD server.

Documentation

All documentation is available on promitor.io

End-users

We are proud to have the following end-users(s) running Promitor in production:

Adfinis Adobe Albert Heijn Axon Bryte Blue ResDiary theTradeDesk Trynz Vsoft Walmart Labs

Are you a Promitor user? Let us know and get listed!

Contribution

All contribution guidelines can be found here. We welcome bug reports, improvement suggestions and pull requests.

Want to see support for a scraper that is not already supported? You can contribute by adding one yourself!

Information about making changes to Promitor can be found here.

Testing Infrastructure

Our testing infrastructure is managed through Bicep and is open to contributions on promitor/testing-infrastructure.

Image Overview

Here is an overview of the available images:

Image name Use-Case Supported? Tag Format
ghcr.io/tomkerkhove/promitor-agent-scraper Use Promitor Scraper in production Yes :{SemVer}
ghcr.io/tomkerkhove/promitor-agent-resource-discovery Use Promitor Resource Discovery in production Yes :{SemVer}
ghcr.io/tomkerkhove/promitor-agent-scraper-preview Preview image of Promitor Scraper vNext created off of master branch. No, experimentation only :{SemVer} & :{SemVer}-{Commit}
ghcr.io/tomkerkhove/promitor-agent-resource-discovery-preview Preview image of Promitor Resource Discovery vNext created off of master branch. No, experimentation only :{SemVer} & :{SemVer}-{Commit}
ghcr.io/tomkerkhove/promitor-agent-scraper-ci CI image of Promitor Scraper created from a PR. No, used for testing/ease-of-contribution :pr{pr-id}
ghcr.io/tomkerkhove/promitor-agent-resource-discovery-ci CI image of Promitor Resource Discovery created from a PR. No, used for testing/ease-of-contribution :pr{pr-id}

Support

Learn more about our support options here.

Thanks for those who are supporting us via GitHub Sponsors.

Carlo Garcia-Mier Jorge Turrado Ferrero Karl Ots Loc Mai Lovelace Engineering Nills Franssens Richard Simpson Sam Vanhoutte

Security

Learn more about our security policy here.

Performance

Learn more about our performance tests here.

Donate

Promitor is fully OSS and built free-of-charge, however, if you appreciate my work you can do a small donation.

Donate

Get in touch

Do you have a security issue to report or just want to privately contact me? Feel free to write me an email or get listed as a user.

Thank you

We'd like to thank all the services, tooling & NuGet packages that support us - Thank you!

License Information

This is licensed under The MIT License (MIT). Which means that you can use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the web application. But you always need to state that Tom Kerkhove is the original author of this web application.

FOSSA Status

promitor's People

Contributors

adamconnelly avatar amirschw avatar antoinethebaud avatar arielhaim83 avatar axonlmai avatar bluepixbe avatar brandonh-msft avatar christianeder avatar daveohenry avatar dependabot[bot] avatar ekeih avatar etiennetremel avatar hkfgo avatar imgbot[bot] avatar jasonmowry avatar jcorioland avatar jkataja avatar lee0c avatar michaelkruglos avatar pad92 avatar phnx47 avatar renovate[bot] avatar rguthriemsft avatar sagivaknin avatar salehabbas avatar samneirinck avatar sanych-sun avatar seanfeldman avatar snyk-bot avatar tomkerkhove avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

promitor's Issues

Provide support for multi-dimensional metrics

Provide support for scraping multi-dimensional metrics.

Configuration should be expanded to include optional dimension information.

This should cover:

  • Name of the dimension to use (mandatory)
  • Target of partition in dimension you are interested in (optional)

The reported metric in the scraping endpoint should use labels to report the metric with a general name but labeled for every dimension regardless if a target was specified or not.

Names are just examples, open for feedback!

Example

name: demo_containerinstances_cpu
description: "Average cpu usage of our 'promitor-container-instance' container instance"
resourceType: ContainerInstance
containerGroup: promitor-container-instance
azureMetricConfiguration:
  metricName: CpuUsage
  aggregation:
    type: Average
  dimension:
    name: containerName # name of the dimension to split on
    target: redis-single-node # name of the targetted partition in the dimension you're interested in

Portal

You can see this in action in the Azure Portal:
image

Provide integration with Azure Monitor

Provide integration with Azure Monitor where it will automatically query the Azure Monitor REST API for a set of metrics and expose them via the scrape endpoint.

Depends on #3.

Specifications

  • Integrate with the Azure Monitor REST API
  • Provide a way to configure one or more metrics to query
  • Provide a way to configure how often you should pull latest representation of a metric
  • Provide documentation on how to configure the metrics
  • Provide documentation on how often you should pull latest representation of a metric
  • Provide documentation on how to configure the authentication with Azure Monitor

Configuration

Metrics to scrape:

metrics:
- metric:
  name: "my-name"
  resource-type: "Microsoft.ServiceBus"
- metric:
  name: "my-name"
  resource-type: "Microsoft.WebApps"

Scrape frequency:

  • PROMITOR_SCRAPE_SCHEDULE

Azure authentication:

  • PROMITOR_AUTH_APPID
  • PROMITOR_AUTH_APPKEY

Introduce unit testing

Introduce unit testing

Specification

  • Provide unit testing in codebase, without mocking
  • Automatically runs on CI build

Publish Docker image for promitor-scrape

Publish Docker image on hub.docker.com

Specifications

  • Automate building the DOCKERFILE on master commit
  • Automate tagging of the docker image
  • Automate pushing a new version of container image
  • Automate applying git tag on release
  • Automate creation of GitHub release

Add generic scrape source for Azure Monitor

Add generic scrape source for Azure Monitor

Specification

  • Add new scrape source
  • Add new metric configuration deserialization
  • Add validation for new scrape source
  • Add unit tests for new scrape source
  • Document new scrape source usage

Document what services we are using

Document what services we are using and are so generous to provide this offering for free:

These should all be on README & promitor.io, except for GitHub Apps which should only end up in README.

Used 3rd parties

Services:

  • Travis CI for building PRs #6
  • Snyk.io for vulnerability scanning (currently only docs because of #143) #91
  • Renovate for maintaining dependencies #70

GitHub Apps:

  • WIP for blocking WIP PRs
  • Reminders for setting reminders
  • Request Info for requesting information for PRs without info
  • Stale for managing issues

Provide documentation on configuration

Provide documentation on how to configure the image

Specification

  • How to configure the scraping endpoint
  • How to configure how often to scrape
  • How to configure the metrics to scrape in Azure Monitor
    • What resource types are supported
  • How to authenticate to Azure Monitor

Run integration tests in CI build

Run integration tests in CI build that are introduced in #33

Specification

  • CI should start Docker image
  • CI should run integration tests on the running instance

Provide integration with Azure Key Vault

Provide integration with Azure Key Vault for storing secrets

Specifications

  • Provide capability to get secrets from the vault
  • Provide in-memory caching for secrets (limited duration)
  • Provide way to refresh a secret
  • Document how to configure it

Provide support for Windows containers

Provide support for Windows containers.

  • Provide support for Windows containers
  • Build Windows & Linux container in CI
  • Build Windows & Linux container in release
  • Document supported containers
  • Update tagging strategy

Should be fairly easy via multi-arch containers

Integrate snyk.io

Integrate snyk.io for security vulnerability scanning

  • Configure for docs
  • Configure for runtime (Docker)
  • Configure for runtime (.NET)

Provide initial telemetry to Azure Application Insights

Provide initial telemetry to Azure Application Insights. This is to have a operable MVP before starting with #29.

Specification

  • Trace validation steps
  • Track exceptions in Application Insights
  • Track Azure Monitor as dependency
  • Provide documentation on what to expect, how to configure, etc.

Build an advanced release pipeline

Build an advanced release pipeline to automatically release a new version and extends #172.

Specification

  • Use YAML configuration over UI in Azure DevOps
  • Every build should use the following flow
  • Automatically push image tags to Docker Hub when building from master

Versioning

Every build is queued by specifying the version to release. This supports the following formats:

  • {major}.{minor}.{patch} for full releases
    • Creates a GitHub release
  • {major}.{minor}.{patch}-{description} for preview releases
    • Creates a GitHub pre-release

Docker tags

Every release should tag the docker image twice:

  • {major}.{minor}.{patch} which is specific for this release
  • {major}.{minor} which gives you all the features for this combination, but always pulls in the latest patch version. This should not be done when it is a preview release.

This is important as this enables consumers to always run on the latest bug fixes and most importantly security fixes.

Build flow

  1. Build the codebase
  2. Run unit tests (relates to #32)
  3. Run docker build
  4. Deploy new docker image (can be on Azure Container Instances)
  5. Run integration testing (relates to #33)
  6. Create git tag, if running on master
  7. Create GitHub release, if running on master
  8. Push Docker image to Docker Hub, if running on master

Provide health endpoint

Provide health endpoint for Kubernetes

Specification

  • Expose health endpoint
  • Update documentation
  • Add endpoint to Kubernetes YAML declaration (depends on #1)

API Specification

  • Verb: GET
  • Path: api/v1/health
  • Reponse Codes:
    • 200: Healthy
    • 503: Unhealthy

Introduce integration testing

Introduce integration testing to run on a deployed container or Promitor.

Specification

  • Provide integration testing in codebase

Setup Travis CI

Setup Travis CI to automatically build pull requests

Specifications

  • Automatically build pull requests with Travis CI
  • Add badge to README
  • Protect master-branch

Create a mascot & logo

Promitor deserves to have a mascot and a basic logo.

I would like to refer to an animal that is good at monitoring, overwatching or scraping things.

Ideas:

Logo should end up on our Twitter account as well.

Metrics interval does not take scraping cron schedule into account

Currently every time a metric is scraped it will get a list of all measure points with a fixed interval, currently 1 minute.

This means that the scraping schedule, which is a cron, is not taken into account and can give false positives when using metrics such as average.

Initial documentation on promitor.io

Initial documentation on promitor.io

Specification

  • Setup documentation via GitHub Pages (#38)
  • Why this project? (#8)
  • Provide documentation on how to run the image (#15)
  • Provide documentation on configuration #35)
  • Remove wiki for business features
  • Write blog post

Build Docker image in CI build

Build Docker images in CI build to ensure they are still valid.

This can be done in Travis CI. (docs)

  • Build Docker image in CI build
  • Move running of tests to Dockerfile

Validate configured metrics declaration on startup

Validate configured metrics declaration on startup.

Specification

  • Avoid duplicate metric names
  • Verify that the declaration file is present
  • Verify that the format of the configuration is valid
  • Verify that every declared metric is valid
  • Every metric has a name
  • Every metric has a resourceType
  • Every metric has an azureMetricConfiguration

Add Service Bus Topic subscription scrape source for Azure Monitor

Add Service Bus Topic scrape source for Azure Monitor

Here is how you can add one.

Specification

  • Add new scrape source
  • Document new scrape source

Configuration should look like the following:

name: demo_topic_size
description: "Amount of active messages of the 'mytopic' topic"
resourceType: ServiceBusTopic
namespace: promitor-messaging
topicName: orders
subscriptionName: sello-vendor
azureMetricConfiguration:
  metricName: ActiveMessages
  aggregation:
    type: Total

Where subscriptionName is optional - If that is the case, metric will be reported for all subscriptions for a given topic.

Telemetry

Provide capability to send telemetry. It should allow us to have a variety of telemetry sinks.

For this we will use Serilog and will be implemented in #29, but we will start without serilog and provide Application Insights first #82.

Supported Sinks

  • Azure Application Insights (#28)

Provide scrape endpoint for Prometheus

Provide scraping endpoint for Prometheus

Specifications

  • Configurable endpoint
  • Document how to configure

Configuration

scrape-endpoint:
   uri-path: "prometheus/scrape"

Validate all configuration on startup

Validate all configuration on startup and fail when something is not valid.

Specification

  • Should signal container runtime that the instance is in an invalid state
  • Enough information should be provided about what is not configured correctly

Why this project?

Provide documentation why this project has initiated and why it can be useful.

Should include the following:

  • Using Kubernetes Horizontal Pod Autoscaler and how it works with custom metrics
  • Why using Azure Monitor metrics in Kubernetes is not obvious

Use Serilog for sending telemetry

All telemetry should be written via Serilog so we can use a variety of sinks.

Part of #11.

Specifications

  • Send exception information
  • Send general tracing information
  • Provide individual feature flags to control what is being sent
  • Document how to configure this

Supported Sinks

  • Console (on by default)
  • Application Insights (opt-in)

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.