Skip to content

Commit

Permalink
Merge branch 'master' into always-use-dbname
Browse files Browse the repository at this point in the history
# Conflicts:
#	lib/db/clickhouse.js
#	lib/db/maintain/index.js
#	lib/db/maintain/scripts.js
  • Loading branch information
akvlad committed Mar 19, 2024
2 parents 76bc981 + bc7338a commit da61867
Show file tree
Hide file tree
Showing 129 changed files with 20,156 additions and 11,315 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# These are supported funding model platforms

custom: ['https://qryn.cloud']
github: [qxip, lmangani]
github: [qxip]
36 changes: 26 additions & 10 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ jobs:
with:
ref: ${{ github.ref }}
- name: Update Package to Release version
uses: pocket-apps/action-update-version@v1
with:
files: 'package.json'
version-regexp: '\d+.\d+.\d+'
repo-token: ${{ secrets.GITHUB_TOKEN }}
uses: technote-space/[email protected]
- name: Check NPM secret presence
id: checksecrets
shell: bash
Expand All @@ -34,7 +30,7 @@ jobs:
fi
env:
SECRET: ${{ secrets.NPM_TOKEN }}
- uses: actions/[email protected].0
- uses: actions/[email protected].1
if: ${{ steps.checksecrets.outputs.secretspresent }}
with:
node-version: 18
Expand All @@ -56,6 +52,8 @@ jobs:
- uses: actions/[email protected]
with:
ref: ${{ github.ref }}
- name: Update Package to Release version
uses: technote-space/[email protected]
- name: Check Docker secret presence
id: checkdocker
shell: bash
Expand Down Expand Up @@ -93,6 +91,10 @@ jobs:
qxip/qryn:${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
qxip/cloki:latest
qxip/cloki:${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
labels: |
dev.qryn.image.title=qryn
dev.qryn.image.type=nodejs
dev.qryn.image.version={{github.event.inputs.TAG_NAME || github.event.release.tag_name }}
- name: Log in to the GHCR registry
uses: docker/[email protected]
with:
Expand All @@ -108,6 +110,10 @@ jobs:
tags: |
ghcr.io/metrico/qryn:latest
ghcr.io/metrico/qryn:${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
labels: |
dev.qryn.image.title=qryn
dev.qryn.image.type=nodejs
dev.qryn.image.version={{github.event.inputs.TAG_NAME || github.event.release.tag_name }}
bun:
name: 'Build & Publish Bun'
Expand All @@ -117,6 +123,8 @@ jobs:
- uses: actions/[email protected]
with:
ref: ${{ github.ref }}
- name: Update Package to Release version
uses: technote-space/[email protected]
- name: Check Docker secret presence
id: checkdocker
shell: bash
Expand All @@ -135,35 +143,43 @@ jobs:
platforms: amd64, arm64
- name: Set up Docker Buildx
if: ${{ steps.checkdocker.outputs.secretspresent }}
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3.0.0
- name: Login to DockerHub
if: ${{ steps.checkdocker.outputs.secretspresent }}
uses: docker/login-action@v2.0.0
uses: docker/login-action@v3.0.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push to Docker Hub (bun)
if: ${{ steps.checkdocker.outputs.secretspresent }}
uses: docker/build-push-action@v3.0.0
uses: docker/build-push-action@v5.1.0
with:
platforms: linux/amd64, linux/arm64
file: ./Dockerfile_bun
push: true
tags: |
qxip/qryn:bun
qxip/qryn:${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}-bun
labels: |
dev.qryn.image.title=qryn
dev.qryn.image.type=bun
dev.qryn.image.version={{github.event.inputs.TAG_NAME || github.event.release.tag_name }}
- name: Log in to the GHCR registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push to GHCR (bun)
uses: docker/build-push-action@v5.0.0
uses: docker/build-push-action@v5.1.0
with:
platforms: linux/amd64, linux/arm64
file: ./Dockerfile_bun
push: true
tags: |
ghcr.io/metrico/qryn:bun
ghcr.io/metrico/qryn:${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}-bun
labels: |
dev.qryn.image.title=qryn
dev.qryn.image.type=bun
dev.qryn.image.version={{github.event.inputs.TAG_NAME || github.event.release.tag_name }}
52 changes: 52 additions & 0 deletions .github/workflows/node-clickhouse-cluster.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# This workflow will validate qryn using nodejs + clickhouse

name: QRYN CI CLUSTER

on:
push:
branches: [ master, beta ]
paths-ignore:
- '**.md'
- '**.yml'
- '**.yaml'
pull_request:
branches: [ master, beta ]
paths-ignore:
- '**.md'
- '**.yml'
- '**.yaml'
workflow_dispatch:
inputs:
clickhouse_tag:
description: 'Tag for ClickHouse (23.8-alpine)'
required: false

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 16.x, 20]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm install
- run: npm run postinstall
- run: git submodule init
- run: git submodule update
- run: docker-compose -f docker/e2e/docker-compose-cluster.yaml up -d
- run: sleep 5
- name: Workflow Telemetry
uses: runforesight/[email protected]
if: github.event_name != 'pull_request'
- env:
CLICKHOUSE_DB: qryn
CLICKHOUSE_TSDB: qryn
INTEGRATION_E2E: 1
CLOKI_EXT_URL: 127.0.0.1:3100
run: CLUSTER_NAME=test_cluster_two_shards node qryn.mjs >/dev/stdout & sleep 10 && npm run test --forceExit
3 changes: 2 additions & 1 deletion .github/workflows/node-clickhouse.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ jobs:
- run: git submodule init
- run: git submodule update
- name: Workflow Telemetry
uses: runforesight/[email protected]
uses: runforesight/[email protected]
if: github.event_name != 'pull_request'
- env:
CLICKHOUSE_DB: qryn
CLICKHOUSE_TSDB: qryn
Expand Down
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ FROM node:20-slim

COPY . /app
WORKDIR /app
RUN npm install

RUN groupadd -r qryn && useradd -r -g qryn -m qryn && chown -R qryn:qryn /app
USER qryn

RUN npm install --omit=dev

# Expose Ports
EXPOSE 3100

CMD [ "npm", "start" ]
CMD [ "npm", "--offline", "--logs-max=0", "start" ]
4 changes: 4 additions & 0 deletions Dockerfile_bun
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ FROM oven/bun:latest

COPY . /app
WORKDIR /app

RUN groupadd -r qryn && useradd -r -g qryn -m qryn && chown -R qryn:qryn /app
USER qryn

RUN rm -rf package-lock.json
RUN bun install

Expand Down
36 changes: 19 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,35 @@

[![CI+CD](https://github.com/metrico/qryn/actions/workflows/build_release.yml/badge.svg)](https://github.com/metrico/qryn/actions/workflows/build_release.yml)
![CodeQL](https://github.com/lmangani/cLoki/workflows/CodeQL/badge.svg)
<img src="https://raw.githubusercontent.com/pedromxavier/flag-badges/main/badges/UA.svg" alt="made in Ukraine">
![GitHub Repo stars](https://img.shields.io/github/stars/metrico/qryn)

![image](https://user-images.githubusercontent.com/1423657/232089970-c4536f16-5967-4051-85a5-8ad94fcde67c.png)

# [qryn 3.x](https://qryn.dev) :cloud: [qryn.cloud](https://qryn.cloud)
<img src="https://user-images.githubusercontent.com/1423657/232089970-c4536f16-5967-4051-85a5-8ad94fcde67c.png" height=50>&nbsp; <img src="https://github.com/metrico/qryn/assets/1423657/546faddb-fbc6-4af5-9e32-4db6da10915d" height=49>

:rocket: _polyglot, lighweight, multi-standard drop-in_ **observability** framework for _**Logs, Metrics and Traces**_<br/>
# [qryn 3.x](https://qryn.dev)

:rocket: _polyglot, lighweight, multi-standard drop-in_ **observability** framework for _**Logs, Metrics** and **Traces**_<br/>

> ... it's pronounced /ˈkwɪr..ɪŋ/ or just _querying_
- **Polyglot**: Use **LogQL, PromQL**, and **TempoQL** languages to query, process and alert _any data_
- **Lightweight**: Powered by **ClickHouse** OLAP Engine + **Bun** the _fast, all-in-one_ JavaScript runtime
- **Voracious**: Ingestion compatible with **Opentelemetry, Loki, Prometheus, Influx, Datadog, Elastic** _+ more_
- **Versatile**: Explore data with qryn's built-in **View Explorer** and **CLI** or _native_ **Grafana** compatibility
- **Secure**: Retain total control of data, using **ClickHouse** or **InfluxDB IOx** with **S3** object storage
- **Unmetered**: Unlimited FOSS deployments or **qryn.cloud** option with advanced features and performance
- **Indepentent**: Designed to be a stand-alone, all-in-one _Loki, Prometheus, Tempo_ drop-in alternative
* **Polyglot**: All-in-one, Drop-in compatible with **Loki**, **Prometheus**, **Tempo**, **Pyroscope**
* **Lightweight**: Powered by **Bun** - the fast, all-in-one JavaScript runtime + ClickHouse **OLAP** Engine
* **Familiar**: Use stable & popular **LogQL**, **PromQL**, **TempoQL** languages to _query and visualize data_
* **Voracious**: Ingest using **Opentelemetry, Loki, Prometheus, Tempo, Influx, Datadog, Elastic** _& more_
* **Versatile**: Explore data with qryn's **built-in Explorer** and CLI or native **Grafana** datasource compatibility
* **Secure**: Retain total control of data, using **ClickHouse**, **DuckDB** or **InfluxDB** IOx with **S3** object storage
* **Unmetered**: Unlimited **FOSS** deployments or **qryn.cloud** option with advanced features and performance
* **Indepentent**: Opensource, Community powered, Anti lock-in alternative to Vendor controlled stacks

<br>

## 🚀 [Get Started](https://qryn.metrico.in/#/installation)

* Setup & Deploy **qryn** _OSS_ using the [documentation](https://qryn.metrico.in/#/installation) and get help in our [Matrix room](https://matrix.to/#/#qryn:matrix.org) :octocat:
* No time? Use [qryn.cloud](https://qryn.cloud) and get polyglot in just minutes! Drop-in LGTM alternative ☁️

<a href="https://qryn.cloud" target="_blank">
<img src="https://user-images.githubusercontent.com/1423657/218818279-3efff74f-0191-498a-bdc4-f2650c9d3b49.gif">
<img src="https://github.com/metrico/qryn/assets/1423657/8b93d7cb-442c-4454-b247-27b00ae78384">
<!-- <img src="https://user-images.githubusercontent.com/1423657/218818279-3efff74f-0191-498a-bdc4-f2650c9d3b49.gif"> -->
</a>

<br>
Expand Down Expand Up @@ -61,8 +63,8 @@ Ingested data can be queried using any of the avialable qryn APIs _(LogQL, PromQ
> 💡 _No modifications required to your opentelemetry instrumentation!_
### 📚 Native
**qryn** supports [native ingestion](https://qryn.metrico.in/#/support) for Loki, Prometheus, Tempo/Zipkin and other protocols_<br>
With qryn users can _push data using any combination of supported protocols_
**qryn** supports [native ingestion](https://qryn.metrico.in/#/support) for Loki, Prometheus, Tempo/Zipkin and _[many other protocols](https://qryn.metrico.in/#/support)_<br>
With qryn users can _push data using any combination of supported APIs and formats_

> 💡 _No opentelemetry or any other middlewayre/proxy required!_
Expand Down Expand Up @@ -127,7 +129,7 @@ The Tempo datasource can be used to natively query _traces_ including _**TraceQL

### 📚 Other Vendors

**qryn** can ingest data using the [InfluxDB, DataDog, Elastic](https://qryn.metrico.in/#/support) and other vendors.
**qryn** can ingest data using formats from [InfluxDB, DataDog, Elastic](https://qryn.metrico.in/#/support) and other vendors.


<br>
Expand Down Expand Up @@ -174,7 +176,7 @@ Whether it's code, documentation or grammar, we ❤️ all contributions. Not su

#### License

<img src="https://camo.githubusercontent.com/473b62766b498e4f2b008ada39f1d56fb3183649f24447866e25d958ac3fd79a/68747470733a2f2f7777772e676e752e6f72672f67726170686963732f6167706c76332d3135357835312e706e67">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/0/06/AGPLv3_Logo.svg/2560px-AGPLv3_Logo.svg.png" width=200>

©️ QXIP BV, released under the GNU Affero General Public License v3.0. See [LICENSE](LICENSE) for details.

Expand Down
6 changes: 6 additions & 0 deletions common.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,9 @@ module.exports.bun = () => {
return false
}
}

module.exports.logType = process.env.DISTINGUISH_LOGS_METRICS ? 1 : 0

module.exports.metricType = process.env.DISTINGUISH_LOGS_METRICS ? 2 : 0

module.exports.bothType = 0
Loading

0 comments on commit da61867

Please sign in to comment.