From 26d76d213ec3c717ca0cd91af2dd2ceec2095dbb Mon Sep 17 00:00:00 2001 From: Martin Kemp Date: Fri, 13 Dec 2024 15:24:44 +0000 Subject: [PATCH] Fixes and use newest version Signed-off-by: Martin Kemp --- Dockerfile | 38 +++++++++++------------ Makefile | 2 +- docker-compose.yaml | 14 ++++----- go.mod | 2 +- services/grafana/Dockerfile | 2 +- services/grafana/grafana-datasources.yaml | 7 +++++ services/loki/Dockerfile | 2 +- services/mimir/Dockerfile | 2 +- services/otelcol/Dockerfile | 4 +-- services/otelcol/config.yaml | 25 ++++++--------- services/tempo/Dockerfile | 2 +- services/tempo/tempo.yaml | 9 ------ 12 files changed, 50 insertions(+), 59 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4c4ff75..080b5c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,43 +1,43 @@ -FROM golang:1.17-alpine AS builder +FROM golang:1.23.3-alpine3.20 AS builder ENV CGO_ENABLED=0 RUN apk add --update make WORKDIR /backend COPY go.* . RUN --mount=type=cache,target=/go/pkg/mod \ - --mount=type=cache,target=/root/.cache/go-build \ - go mod download + --mount=type=cache,target=/root/.cache/go-build \ + go mod download COPY . . RUN --mount=type=cache,target=/go/pkg/mod \ - --mount=type=cache,target=/root/.cache/go-build \ - make bin + --mount=type=cache,target=/root/.cache/go-build \ + make bin -FROM --platform=$BUILDPLATFORM node:17.7-alpine3.14 AS client-builder +FROM --platform=$BUILDPLATFORM node:23.3.0-alpine3.20 AS client-builder WORKDIR /ui # cache packages in layer COPY ui/package.json /ui/package.json COPY ui/package-lock.json /ui/package-lock.json RUN --mount=type=cache,target=/usr/src/app/.npm \ - npm set cache /usr/src/app/.npm && \ - npm ci + npm set cache /usr/src/app/.npm && \ + npm ci # install COPY ui /ui RUN npm run build -FROM alpine +FROM alpine:3.20.3 LABEL org.opencontainers.image.title="Grafana LGTM" \ - org.opencontainers.image.description="Grafana LGTM in Docker Desktop" \ - org.opencontainers.image.vendor="Cedric Ziel" \ - com.docker.desktop.extension.api.version=">= 0.2.3" \ - com.docker.desktop.extension.icon="https://github.com/cedricziel/dd-extension-lgtm/blob/main/docker.svg" \ - com.docker.extension.screenshots="https://github.com/cedricziel/dd-extension-lgtm/blob/main/images/splash.png" \ - com.docker.extension.detailed-description="Grafanas Loki, Grafana, Tempo, Mimir and the OpenTelemetry collector right in Docker Desktop" \ - com.docker.extension.publisher-url="https://github.com/cedricziel/dd-extension-lgtm" \ - com.docker.extension.additional-urls="" \ - com.docker.extension.changelog="https://github.com/cedricziel/dd-extension-lgtm" + org.opencontainers.image.description="Grafana LGTM in Docker Desktop" \ + org.opencontainers.image.vendor="Martin Kemp" \ + com.docker.desktop.extension.api.version=">= 0.2.3" \ + com.docker.desktop.extension.icon="https://github.com/KempMVitesse/dd-extension-lgtm/blob/main/docker.svg" \ + com.docker.extension.screenshots="https://github.com/KempMVitesse/dd-extension-lgtm/blob/main/images/splash.png" \ + com.docker.extension.detailed-description="Grafanas Loki, Grafana, Tempo, Mimir and the OpenTelemetry collector right in Docker Desktop" \ + com.docker.extension.publisher-url="https://github.com/KempMVitesse/dd-extension-lgtm" \ + com.docker.extension.additional-urls="" \ + com.docker.extension.changelog="https://github.com/KempMVitesse/dd-extension-lgtm" COPY --from=builder /backend/bin/service / COPY docker-compose.yaml . COPY metadata.json . COPY docker.svg . COPY --from=client-builder /ui/build ui -CMD /service -socket /run/guest-services/extension-dd-extension-lgtm.sock +CMD ["/service", "-socket", "/run/guest-services/extension-dd-extension-lgtm.sock"] diff --git a/Makefile b/Makefile index 76b48e5..f90419a 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -IMAGE?=cedricziel/dd-extension-lgtm +IMAGE?=kempmvitesse/dd-extension-lgtm TAG?=dev BUILDER=buildx-multi-arch diff --git a/docker-compose.yaml b/docker-compose.yaml index 1c3f451..8dcb732 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,12 +1,12 @@ services: loki: - image: cedricziel/dd-extension-lgtm-loki:dev + image: kempmvitesse/dd-extension-lgtm-loki:dev command: -config.file=/etc/loki/local-config.yaml environment: - JAEGER_AGENT_HOST=otelcol grafana: - image: cedricziel/dd-extension-lgtm-grafana:dev + image: kempmvitesse/dd-extension-lgtm-grafana:dev container_name: dd-grafana restart: unless-stopped ports: @@ -25,24 +25,24 @@ services: - mimir tempo: - image: cedricziel/dd-extension-lgtm-tempo:dev + image: kempmvitesse/dd-extension-lgtm-tempo:dev command: [ "-config.file=/etc/tempo.yaml" ] mimir: - image: cedricziel/dd-extension-lgtm-mimir:dev + image: kempmvitesse/dd-extension-lgtm-mimir:dev container_name: dd-mimir restart: unless-stopped command: --config.file=/etc/mimir/demo.yaml ## Tools promtail: - image: grafana/promtail:2.5.0 + image: grafana/promtail:3.3.0 volumes: - /var/log:/var/log command: -config.file=/etc/promtail/config.yml otelcol: - image: cedricziel/dd-extension-lgtm-otelcol:dev + image: kempmvitesse/dd-extension-lgtm-otelcol:dev container_name: dd-otelcol restart: unless-stopped ports: @@ -50,7 +50,7 @@ services: - "4317:4317" # otlp grpc - "4318:4318" # otlp http - "9411:9411" # zipkin - command: --config=/etc/otelcol/config.yaml + - "55679:55679" # zpages depends_on: - loki - tempo diff --git a/go.mod b/go.mod index e7ef9f4..44b5057 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/docker/dd-extension-lgtm -go 1.18 +go 1.23 require ( github.com/labstack/echo v3.3.10+incompatible diff --git a/services/grafana/Dockerfile b/services/grafana/Dockerfile index d8ed553..d3d0030 100644 --- a/services/grafana/Dockerfile +++ b/services/grafana/Dockerfile @@ -1,3 +1,3 @@ -FROM grafana/grafana:9.2.1 +FROM grafana/grafana:11.3.1 COPY grafana-datasources.yaml /etc/grafana/provisioning/datasources/datasources.yaml diff --git a/services/grafana/grafana-datasources.yaml b/services/grafana/grafana-datasources.yaml index 788e182..e5b007f 100644 --- a/services/grafana/grafana-datasources.yaml +++ b/services/grafana/grafana-datasources.yaml @@ -14,15 +14,22 @@ datasources: access: proxy orgId: 1 url: http://mimir:9009/prometheus + jsonData: + httpMethod: GET basicAuth: false isDefault: false version: 1 editable: false + uid: mimir - name: Tempo type: tempo access: proxy orgId: 1 url: http://tempo:3200 + jsonData: + httpMethod: GET + serviceMap: + datasourceUid: mimir basicAuth: false isDefault: true version: 1 diff --git a/services/loki/Dockerfile b/services/loki/Dockerfile index e866a14..2423563 100644 --- a/services/loki/Dockerfile +++ b/services/loki/Dockerfile @@ -1,3 +1,3 @@ -FROM grafana/loki:2.6.1 +FROM grafana/loki:3.3.0 #COPY loki.yaml /etc/mimir/demo.yaml diff --git a/services/mimir/Dockerfile b/services/mimir/Dockerfile index a71712c..9aec179 100644 --- a/services/mimir/Dockerfile +++ b/services/mimir/Dockerfile @@ -1,3 +1,3 @@ -FROM grafana/mimir:2.3.1 +FROM grafana/mimir:2.14.2 COPY mimir.yaml /etc/mimir/demo.yaml diff --git a/services/otelcol/Dockerfile b/services/otelcol/Dockerfile index 59f1506..b2d85a4 100644 --- a/services/otelcol/Dockerfile +++ b/services/otelcol/Dockerfile @@ -1,3 +1,3 @@ -FROM ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.62.1 +FROM ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.115.1 -COPY config.yaml /etc/otelcol/config.yaml +COPY config.yaml /etc/otelcol-contrib/config.yaml diff --git a/services/otelcol/config.yaml b/services/otelcol/config.yaml index 8b4bfcc..a214501 100644 --- a/services/otelcol/config.yaml +++ b/services/otelcol/config.yaml @@ -3,7 +3,9 @@ receivers: otlp: protocols: grpc: + endpoint: 0.0.0.0:4317 http: + endpoint: 0.0.0.0:4318 hostmetrics: scrapers: cpu: @@ -36,21 +38,12 @@ exporters: endpoint: tempo:4317 tls: insecure: true - loki: - endpoint: http://loki:3100/loki/api/v1/push - labels: - record: - traceID: traceid - attributes: - container.name: "container_name" - k8s.cluster.name: "k8s_cluster_name" - severity: "severity" - resource: - resource.name: "resource_name" - severity: "severity" - + otlphttp/loki: + endpoint: http://loki:3100/otlp prometheusremotewrite: endpoint: http://mimir:9009/api/v1/push + debug: + verbosity: detailed extensions: health_check: @@ -65,12 +58,12 @@ service: traces: receivers: [jaeger,opencensus,otlp,zipkin] processors: [batch] - exporters: [otlp/tempo] + exporters: [otlp/tempo, debug] metrics: receivers: [hostmetrics,docker_stats,opencensus,otlp] processors: [batch] - exporters: [prometheusremotewrite] + exporters: [prometheusremotewrite, debug] logs: receivers: [otlp] processors: [batch] - exporters: [loki] + exporters: [otlphttp/loki, debug] diff --git a/services/tempo/Dockerfile b/services/tempo/Dockerfile index b1f01b3..5d05711 100644 --- a/services/tempo/Dockerfile +++ b/services/tempo/Dockerfile @@ -1,3 +1,3 @@ -FROM grafana/tempo:1.5.0 +FROM grafana/tempo:2.6.1 COPY tempo.yaml /etc/tempo.yaml diff --git a/services/tempo/tempo.yaml b/services/tempo/tempo.yaml index b1b4223..0b6f188 100644 --- a/services/tempo/tempo.yaml +++ b/services/tempo/tempo.yaml @@ -1,5 +1,3 @@ -metrics_generator_enabled: true - server: http_listen_port: 3200 @@ -44,13 +42,8 @@ metrics_generator: storage: trace: backend: local # backend configuration to use - block: - bloom_filter_false_positive: .05 # bloom filter false positive rate. lower values create larger filters but fewer false positives - index_downsample_bytes: 1000 # number of bytes per index record - encoding: zstd # block encoding/compression. options: none, gzip, lz4-64k, lz4-256k, lz4-1M, lz4, snappy, zstd, s2 wal: path: /tmp/tempo/wal # where to store the the wal locally - encoding: snappy # wal encoding/compression. options: none, gzip, lz4-64k, lz4-256k, lz4-1M, lz4, snappy, zstd, s2 local: path: /tmp/tempo/blocks pool: @@ -59,5 +52,3 @@ storage: overrides: metrics_generator_processors: [service-graphs, span-metrics] - -search_enabled: true