aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHazel Atkinson <yellowsink@riseup.net>2025-04-04 13:24:22 +0100
committerHazel Atkinson <yellowsink@riseup.net>2025-04-04 13:24:22 +0100
commit5f80f7c877bf08be7abc4288a9c1a50fffecf0c5 (patch)
tree734ec22c5e540570294b4bf966503044eca36a4d
downloadcontainerspy-5f80f7c877bf08be7abc4288a9c1a50fffecf0c5.tar.gz
containerspy-5f80f7c877bf08be7abc4288a9c1a50fffecf0c5.tar.bz2
containerspy-5f80f7c877bf08be7abc4288a9c1a50fffecf0c5.zip
init
-rw-r--r--.editorconfig10
-rw-r--r--.gitignore1
-rw-r--r--Cargo.lock7
-rw-r--r--Cargo.toml6
-rw-r--r--LICENSE.md33
-rw-r--r--README.md37
-rw-r--r--rustfmt.toml2
-rw-r--r--src/main.rs3
8 files changed, 99 insertions, 0 deletions
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..d634dbd
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,10 @@
+root = true
+
+[*]
+charset = utf-8
+insert_final_newline = false
+trim_trailing_whitespace = true
+end_of_line = lf
+indent_style = tab
+max_line_length = 120
+tab_width = 3
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..ea8c4bf
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/target
diff --git a/Cargo.lock b/Cargo.lock
new file mode 100644
index 0000000..3254d38
--- /dev/null
+++ b/Cargo.lock
@@ -0,0 +1,7 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 4
+
+[[package]]
+name = "containerspy"
+version = "0.1.0"
diff --git a/Cargo.toml b/Cargo.toml
new file mode 100644
index 0000000..6ea38e6
--- /dev/null
+++ b/Cargo.toml
@@ -0,0 +1,6 @@
+[package]
+name = "containerspy"
+version = "0.1.0"
+edition = "2021"
+
+[dependencies]
diff --git a/LICENSE.md b/LICENSE.md
new file mode 100644
index 0000000..39c5dbc
--- /dev/null
+++ b/LICENSE.md
@@ -0,0 +1,33 @@
+# Opinionated Queer License v1.2
+
+© Copyright Hazel Atkinson
+
+## Permissions
+
+The creators of this Work (“The Licensor”) grant permission to any person, group or legal entity that doesn't violate the prohibitions below (“The User”), to do everything with this Work that would otherwise infringe their copyright or any patent claims, subject to the following conditions:
+
+## Obligations
+
+The User must give appropriate credit to the Licensor, provide a copy of this license or a (clickable, if the medium allows) link to oql.avris.it/license/v1.2, and indicate whether and what kind of changes were made. The User may do so in any reasonable manner, but not in any way that suggests the Licensor endorses the User or their use.
+
+## Prohibitions
+
+No one may use this Work for prejudiced or bigoted purposes, including but not limited to: racism, xenophobia, queerphobia, queer exclusionism, homophobia, transphobia, enbyphobia, misogyny.
+
+No one may use this Work to inflict or facilitate violence or abuse of human rights, as defined in either of the following documents: Universal Declaration of Human Rights, European Convention on Human Rights along with the rulings of the European Court of Human Rights.
+
+No law enforcement, carceral institutions, immigration enforcement entities, military entities or military contractors may use the Work for any reason. This also applies to any individuals employed by those entities.
+
+No business entity where the ratio of pay (salaried, freelance, stocks, or other benefits) between the highest and lowest individual in the entity is greater than 50 : 1 may use the Work for any reason.
+
+No private business run for profit with more than a thousand employees may use the Work for any reason.
+
+Unless the User has made substantial changes to the Work, or uses it only as a part of a new work (eg. as a library, as a part of an anthology, etc.), they are prohibited from selling the Work. That prohibition includes processing the Work with machine learning models.
+
+## Sanctions
+
+If the Licensor notifies the User that they have not complied with the rules of the license, they can keep their license by complying within 30 days after the notice. If they do not do so, their license ends immediately.
+
+## Warranty
+
+This Work is provided “as is”, without warranty of any kind, express or implied. The Licensor will not be liable to anyone for any damages related to the Work or this license, under any kind of legal claim as far as the law allows.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..38aa11f
--- /dev/null
+++ b/README.md
@@ -0,0 +1,37 @@
+# ContainerSpy
+
+ContainerSpy is a lightweight daemon that connects to Docker, collects metrics (CPU%, RAM, etc.), and outputs those
+via OpenTelemetry OTLP.
+
+You can then send that to a metrics store such as Prometheus, a collection agent such as Grafana Alloy,
+or a cloud observability platform.
+
+Note that containerspy currently targets only Docker, not Kubernetes or any other orchestration systems.
+It outputs the same traces as cAdvisor for drop-in compatibility with existing data series and dashboards.
+
+## Why make this?
+
+ContainerSpy is intended to replace [cAdvisor](https://github.com/google/cadvisor) in a Prometheus/Grafana monitoring
+setup. It takes inspiration from [Beszel](https://www.beszel.dev/) in its approach.
+The main reason for this to exist is my personal difficulties deploying cAdvisor.
+
+cAdvisor is rather RAM-heavy, and it really does not need to be so.
+It also requires a plethora of different mounts to get working inside of a container, including /sys, or even the entire
+/ filesystem, and in some cases must be ran as a privileged user!
+Even with this, it can often just completely fail to collect CPU usage data depending on your distro.
+
+I have previously used Beszel for my monitoring, and it's agent runs as an unprivileged user,
+needs access to only the docker socket, collects all data out of the box, and has a lightweight footprint.
+
+ContainerSpy aims to do what beszel-agent does, but instead of outputting to an opinionated AIO system,
+outputs to (e.g.) Prometheus for a more heavyweight setup.
+
+**I can highly recommend Beszel** as an easy to setup monitoring solution for Docker.
+It will give you CPU use, RAM use, disk and bandwidth use, swap use, both system-wide and per-container, with
+configurable email alerting OOTB with very little setup. It is a great piece of software.
+
+My motivation to move to a Prometheus/Grafana setup is that I want the centralised rich logging that Loki can give me.
+
+## How to set up
+
+TODO: will write once it actually works
diff --git a/rustfmt.toml b/rustfmt.toml
new file mode 100644
index 0000000..5ccb4fb
--- /dev/null
+++ b/rustfmt.toml
@@ -0,0 +1,2 @@
+hard_tabs = true
+tab_spaces = 3 \ No newline at end of file
diff --git a/src/main.rs b/src/main.rs
new file mode 100644
index 0000000..e7a11a9
--- /dev/null
+++ b/src/main.rs
@@ -0,0 +1,3 @@
+fn main() {
+ println!("Hello, world!");
+}