Tool for providing an HTTP endpoint to retrieve predefined aggregations on metrics of an InfluxDB.

Overview

InfluxDB DWH Exporter

This application provides an HTTP endpoint that can deliver metrics from an InfluxDB in an aggregated form when called.

This can be used to provide an aggregated view of existing metrics or derived ones to an external tool (e.g. data warehouse or other databases).

Usage

The endpoint which is provided and through which the metrics can be retrieved/exported is /dwh

Parameter Example Description
token /dwh?token=my_secret token must match the token configured in the application.yml, otherwise access will be denied.
interval /dwh?interval=5m Specifies the resolution in which the metrics are provided. This corresponds to the ${interval} variable in the configured queries. If interval is not specified, the default value 1m is used, i.e. a resolution per minute.
range /dwh?range=2h Defines the time period that the metrics should cover. For example, 2h means that the data points of the metrics of the last two hours should be queried. This variable is used to define ${timeFilter} in the configured queries. If range is not specified, the data for one interval will be returned.
offset /dwh?offset=5m Defines a time offset with which the data should be queried. For example, if the data is queried at 15:00, it is possible that the data for 14:59 has not yet arrived in the InfluxDB. By using offset, the query interval can now be shifted into the past. If offset is not defined, an offset of one minute is used.
start & end /dwh?start=1587023100000&end=1587023400000 Alternative way to specify the time period compared to range and offset. The values start and end must be epoch timestamps in milliseconds. It is also important that both start and end are multiples of the interval. I.e. for example with an interval of 1m both timestamps must be divisible by 60000 without remainder.

Examples

/dwh?token=my_secret - Returns the data of the last minute in minute resolution with an offset of one minute.

/dwh?token=my_secret&interval=15m - Returns the data of the last 15 minutes in a 15-minute resolution with an offset of one minute.

/dwh?token=my_secret&interval=15m&range=60m&offset=5m - Returns the data of the last 60 minutes in a 15-minute resolution with an offset of five minutes.

/dwh?token=my_secret&interval=1m&start=1587023340000&end1587023400000 - Returns the data between defined the timestamps in a 1-minute resolution.

Configuration

The configuration of the provided metrics can be done via an application.yml file, which can be put in the working directory of the application.

The following code is an example for the application.yml. For a full list of available configurations, see the default application.yml:

server:
  # the port of the server
  port: 8080

spring:
  influx:
    # URL of the InfluxDB
    url: http://localhost:8086
    # username for the InfluxDB
    user: ""
    # password for the InfluxDB
    password: ""

dwh:
  # secret to access the /dwh endpoint
  token: my_secret

  # the metrics and related queries to use and export
  metrics:
    - name: my-metric|${service}|${http_path}
      query: |
        SELECT SUM("sum") / SUM("count")
        FROM "inspectit"."autogen"."http_in_responsetime"
        GROUP BY time(${interval}), "service", "http_path" FILL(null)

Metrics Configuration

A list of metrics that will be provided via the HTTP endpoint can be specified in dwh.metrics. Two parameters must be defined for each metric: name and query.

name is the name of the resulting "metric view". The name can be parameterized using the tags of the underlying metric, as shown in the example above using ${service} and ${http_path}.

query is the InfluxDB query that is executed to retrieve the corresponding metric from InfluxDB. Here, the variable ${timeFilter} should be used in the WHERE clause. Also, {interval} should be used as "GROUP BY time" interval!

It is important that exactly the tags used for parameterization in name are also used in the GROUP BY-clause!

When the endpoint provided by the application is called, the exporter executes all configured queries and returns the corresponding result.

Health Endpoint

The application provides an endpoint under `/actuator/health that can be used to check if the application is running and the InfluxDB is available.

By default, only a simple status is provided:

{
    "status":"UP",
}

However, with the following configuration, additional information, such as status of the InfluxDB connection, can be obtained via the health endpoint:

management:
   endpoint:
      health:
        show-details: "ALWAYS"

Using this configuration, the health endpoint provides the following result:

{
    "status":"UP",
    "components": {
        "influxDb": {
            "status":"UP"
        }
    }
}
You might also like...

Decorating Spring Boot Reactive WebClient for tracing the request and response data for http calls.

Decorating Spring Boot Reactive WebClient for tracing the request and response data for http calls.

SpringBoot Reactive WebClient 🔍 Tracing HTTP Request through a single pane of glass Decorating Spring Boot Reactive WebClient for tracing the request

Jul 13, 2022

This is a simple realization of custom messages pre/post processing in spring-boot HTTP/Stream requests & responses

spring-boot-custom-message-converting-instances This is a simple realization of custom messages converting in spring-boot HTTP requests and responses.

Jul 22, 2022

The project is an example of using the http web client to promote synchronous and asynchronous https calls.

Web Client Consumer Java Sample The project is an example of using the http web client to promote synchronous and asynchronous https calls. Requiremen

Jan 12, 2022

a proxy for http & https ,write by java,no dependences for other tech

申明 本项目只是作者记录和分享Java网络编程学习心得,请勿用于非法用途,否则后果自负! 原理介绍博客: https://blog.csdn.net/wang382758656/article/details/123098032 https://juejin.cn/post/706921880022

May 3, 2022

Winfoom is an HTTP(s) proxy server facade that allows applications to authenticate through the proxy without having to deal with the actual handshake.

Winfoom is an HTTP(s) proxy server facade that allows applications to authenticate  through the proxy without having to deal with the actual handshake.

winfoom Basic Proxy Facade for NTLM, Kerberos, SOCKS and Proxy Auto Config file proxies To help this project please give it a star ⭐ Overview Winfoom

Dec 8, 2022

Scan and patch tool for CVE-2021-44228 and related log4j concerns.

A Log4J2 CVE-2021-44228 Vulnerability Scanner and Patcher Links to download the latest version: Linux x64 with glibc2.17+ (RHEL7+) Windows & all other

Jun 1, 2022

A tool for reverse engineering Android apk files

Apktool This is the repository for Apktool. If you are looking for the Apktool website. Click here. It is a tool for reverse engineering 3rd party, cl

Jan 4, 2023

JHook - A tool that can dynamically modify Java classes at runtime.

JHook A tool that can dynamically modify Java classes at runtime. Demo Tested on Java 1.8 - Java 17, just support JDK package com.binklac.jhook.test;

Dec 23, 2022

Oxygen-log4j-patcher - A tool that upgrades the log4j from an Oxygen installation to version 2.16

Oxygen XML Patch Tool for Apache Log4j vulnerability CVE-2021-44228, CVE-2021-45046 and CVE-2021-45105 This is a tool that updates the log4j version 2

Jan 10, 2022
Owner
Novatec Consulting GmbH
Novatec Consulting GmbH
Mc-msa-token-getter - Scripts to retrieve MC authentication tokens for use in modding dev envs.

Minecraft MSA Token Getter Python and Java scripts to retrieve MC authentication tokens for use in modding dev envs. Requires a properly configured Az

Ryan 1 Jan 3, 2022
Weatherapp is a simple weather forecast app that uses some APIs to retrieve forecast data from OpenWeatherMap.

WeatherMobileApp Weatherapp is a simple weather forecast app that uses some APIs to retrieve forecast data from OpenWeatherMap. Table of Contents Tech

Mateusz Jasiak 1 Jan 17, 2022
POC showing how to divide endpoint(s) among different Open-API screens

Multiple Open-API groups: Spring boot POC showing how to divide endpoint(s) among different Open-API screens Demo Link (Select definition from top rig

null 6 Dec 15, 2022
A minimal WHIP implementation for the Raspberry Pi. It sends Mic and Camera to a WHIP endpoint

whipi A minimal WHIP implementation for the Raspberry Pi. It sends Camera Mic to a WHIP endpoint. Requires a Raspberry Pi with a PiCam and Java 11. It

|pipe| 12 Oct 27, 2022
httpx - CLI to test HTTP/gRPC/RSocket/Kafka... services by HTTP DSL

httpx: CLI for run http file httpx is a CLI to execute requests from JetBrains Http File. Request types supported by httpx HTTP REST PUB/SUB - Apache

servicex-sh 105 Dec 15, 2022
Highly customized business metrics monitoring with TDengine & Spring Boot

Horus —— Highly customized business metrics monitoring with TDengine & Spring Boot 给予业务指标监控的高度定制自由 设计文档:https://akhnhwmr9k.feishu.cn/wiki/wikcnJJFmDHj

ArchLiu 6 Jun 17, 2022
Z is a Java library providing accessible, consistent function combinators.

Fearless function combination in Java Techniques Unlock your functional programming potential with these combination techniques: Fusion Z.fuse(fn1, fn

J.R. 27 Jun 13, 2022
A spring boot application for providing loom-ld services

LOOM-LD Structures sparql_based-linking It is a java project using maven to manage dependencies. loom-ld It is a spring boot application for providing

Ontology Engineering Group (UPM) 2 Apr 19, 2022
An intelliJ plugin providing a UI layer for git-flow, which in itself is a collection of Git extensions to provide high-level repository operations for Vincent Driessen's branching model.

Git Flow Integration Plus for Intellij An intelliJ plugin providing a UI layer for git-flow, which in itself is a collection of Git extensions to prov

RubinCarter 35 Nov 8, 2022
A manager tool to categorize game assets such as images and sounds/music. The tool enables you to tag these files, so that finding them by tags allows fast searches.

BtAssetManager This application allows you to easily categorize large amounts of image and sound files. You can apply tags to each individual file to

null 21 Sep 15, 2022