From 1ca0a7d57a877f4a7a2f8312c95e3596d7942d5b Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 17 Apr 2025 23:57:50 +0200 Subject: [PATCH] move hack/otel to contrib Aligning with where we put this in moby, and contrib is a slightly more suitable location for this. Signed-off-by: Sebastiaan van Stijn --- {hack => contrib}/otel/README.md | 8 ++++---- {hack => contrib}/otel/compose.yaml | 0 {hack => contrib}/otel/otelcol.yaml | 0 {hack => contrib}/otel/prom.yaml | 0 4 files changed, 4 insertions(+), 4 deletions(-) rename {hack => contrib}/otel/README.md (72%) rename {hack => contrib}/otel/compose.yaml (100%) rename {hack => contrib}/otel/otelcol.yaml (100%) rename {hack => contrib}/otel/prom.yaml (100%) diff --git a/hack/otel/README.md b/contrib/otel/README.md similarity index 72% rename from hack/otel/README.md rename to contrib/otel/README.md index 625cf05ecc..669b429e99 100644 --- a/hack/otel/README.md +++ b/contrib/otel/README.md @@ -5,21 +5,21 @@ To test the OTEL functionality present in the CLI, you can spin up a small demo - a Prometheus container; - an Aspire Dashboard container -The `hack/otel` directory contains the compose file with the services configured, along with 2 basic configuration files: one for the OTEL collector and one for Prometheus. +The `contrib/otel` directory contains the compose file with the services configured, along with 2 basic configuration files: one for the OTEL collector and one for Prometheus. ## How can I use it? -1) Start the compose stack by running `docker compose up -d` in the `hack/otel/` directory; +1) Start the compose stack by running `docker compose up -d` in the `contrib/otel/` directory; 2) Export the env var used to override the OTLP endpoint: `export DOCKER_CLI_OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317` (if running the CLI in a devcontainer or in other ways, you might have to change how you pass this env var); 3) Run the CLI to send some metrics to the endpoint; 4) Browse Prometheus at `http://localhost:9091/graph` or the Aspire Dashboard at `http://localhost:18888/metrics`; 5) In Prometheus, query `command_time_milliseconds_total` to see some metrics. In Aspire, select the resource in the dropdown. -> **Note**: The precise steps may vary based on how you're working on the codebase (buiding a binary and executing natively, running/debugging in a devcontainer, running the normal CLI as usual, etc... ) +> **Note**: The precise steps may vary based on how you're working on the codebase (building a binary and executing natively, running/debugging in a devcontainer, running the normal CLI as usual, etc... ) ## Cleanup? -Run `docker compose down` in the `hack/otel/` directory. +Run `docker compose down` in the `contrib/otel/` directory. You can also run `unset DOCKER_CLI_OTEL_EXPORTER_OTLP_ENDPOINT` to get rid of the OTLP override from your environment. diff --git a/hack/otel/compose.yaml b/contrib/otel/compose.yaml similarity index 100% rename from hack/otel/compose.yaml rename to contrib/otel/compose.yaml diff --git a/hack/otel/otelcol.yaml b/contrib/otel/otelcol.yaml similarity index 100% rename from hack/otel/otelcol.yaml rename to contrib/otel/otelcol.yaml diff --git a/hack/otel/prom.yaml b/contrib/otel/prom.yaml similarity index 100% rename from hack/otel/prom.yaml rename to contrib/otel/prom.yaml