Skip to content

Commit

Permalink
Fixes and use newest version
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Kemp <[email protected]>
  • Loading branch information
KempMVitesse committed Dec 13, 2024
1 parent 3a8c2a9 commit 26d76d2
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 59 deletions.
38 changes: 19 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
IMAGE?=cedricziel/dd-extension-lgtm
IMAGE?=kempmvitesse/dd-extension-lgtm
TAG?=dev

BUILDER=buildx-multi-arch
Expand Down
14 changes: 7 additions & 7 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -25,32 +25,32 @@ 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:
- "14268:14268" # jaeger ingest
- "4317:4317" # otlp grpc
- "4318:4318" # otlp http
- "9411:9411" # zipkin
command: --config=/etc/otelcol/config.yaml
- "55679:55679" # zpages
depends_on:
- loki
- tempo
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion services/grafana/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions services/grafana/grafana-datasources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion services/loki/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM grafana/loki:2.6.1
FROM grafana/loki:3.3.0

#COPY loki.yaml /etc/mimir/demo.yaml
2 changes: 1 addition & 1 deletion services/mimir/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM grafana/mimir:2.3.1
FROM grafana/mimir:2.14.2

COPY mimir.yaml /etc/mimir/demo.yaml
4 changes: 2 additions & 2 deletions services/otelcol/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
25 changes: 9 additions & 16 deletions services/otelcol/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
hostmetrics:
scrapers:
cpu:
Expand Down Expand Up @@ -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:
Expand All @@ -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]
2 changes: 1 addition & 1 deletion services/tempo/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM grafana/tempo:1.5.0
FROM grafana/tempo:2.6.1

COPY tempo.yaml /etc/tempo.yaml
9 changes: 0 additions & 9 deletions services/tempo/tempo.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
metrics_generator_enabled: true

server:
http_listen_port: 3200

Expand Down Expand Up @@ -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:
Expand All @@ -59,5 +52,3 @@ storage:

overrides:
metrics_generator_processors: [service-graphs, span-metrics]

search_enabled: true

0 comments on commit 26d76d2

Please sign in to comment.