Skip to content

Commit

Permalink
component/gitpod-protocol/tracing: Add version tags to all spans
Browse files Browse the repository at this point in the history
Signed-off-by: ArthurSens <[email protected]>
  • Loading branch information
mads-hartmann authored and roboquat committed Dec 8, 2021
1 parent da3991c commit 28bf0e6
Show file tree
Hide file tree
Showing 17 changed files with 68 additions and 1 deletion.
2 changes: 2 additions & 0 deletions components/dashboard/BUILD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ packages:
argdeps:
- imageRepoBase
config:
buildArgs:
VERSION: ${version}
dockerfile: leeway.Dockerfile
metadata:
helm-component: dashboard
Expand Down
6 changes: 6 additions & 0 deletions components/dashboard/leeway.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ FROM caddy/caddy:2.4.0-alpine

COPY components-dashboard--static/conf/Caddyfile /etc/caddy/Caddyfile
COPY --from=compress /www /www

ARG __GIT_COMMIT
ARG VERSION

ENV GITPOD_BUILD_GIT_COMMIT=${__GIT_COMMIT}
ENV GITPOD_BUILD_VERSION=${VERSION}
2 changes: 2 additions & 0 deletions components/ee/db-sync/BUILD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ packages:
argdeps:
- imageRepoBase
config:
buildArgs:
VERSION: ${version}
dockerfile: leeway.Dockerfile
metadata:
helm-component: dbSync
Expand Down
6 changes: 6 additions & 0 deletions components/ee/db-sync/leeway.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,10 @@ COPY --from=builder /app /app/
USER unode
WORKDIR /app/node_modules/@gitpod/db-sync
ENTRYPOINT [ "yarn", "start" ]

ARG __GIT_COMMIT
ARG VERSION

ENV GITPOD_BUILD_GIT_COMMIT=${__GIT_COMMIT}
ENV GITPOD_BUILD_VERSION=${VERSION}
CMD [ "run", "--soft-start" ]
2 changes: 2 additions & 0 deletions components/ee/kedge/BUILD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ packages:
argdeps:
- imageRepoBase
config:
buildArgs:
VERSION: ${version}
dockerfile: leeway.Dockerfile
metadata:
helm-component: kedge
Expand Down
5 changes: 5 additions & 0 deletions components/ee/kedge/leeway.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,10 @@ RUN apk add --no-cache git bash ca-certificates
COPY components-ee-kedge--app/kedge /app/
RUN chmod +x /app/kedge

ARG __GIT_COMMIT
ARG VERSION

ENV GITPOD_BUILD_GIT_COMMIT=${__GIT_COMMIT}
ENV GITPOD_BUILD_VERSION=${VERSION}
ENTRYPOINT [ "/app/kedge" ]
CMD [ "-v", "help" ]
2 changes: 2 additions & 0 deletions components/ee/payment-endpoint/BUILD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ packages:
argdeps:
- imageRepoBase
config:
buildArgs:
VERSION: ${version}
dockerfile: leeway.Dockerfile
metadata:
helm-component: paymentEndpoint
Expand Down
6 changes: 6 additions & 0 deletions components/ee/payment-endpoint/leeway.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,10 @@ RUN useradd --create-home --uid 31001 --home-dir /app/ unode
COPY --from=builder /app /app/
USER unode
WORKDIR /app/node_modules/@gitpod/gitpod-payment-endpoint

ARG __GIT_COMMIT
ARG VERSION

ENV GITPOD_BUILD_GIT_COMMIT=${__GIT_COMMIT}
ENV GITPOD_BUILD_VERSION=${VERSION}
CMD exec yarn start
2 changes: 2 additions & 0 deletions components/gitpod-db/BUILD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ packages:
argdeps:
- imageRepoBase
config:
buildArgs:
VERSION: ${version}
dockerfile: leeway.Dockerfile
metadata:
helm-component: dbMigrations
Expand Down
5 changes: 5 additions & 0 deletions components/gitpod-db/leeway.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ COPY --from=proxy /etc/ssl/certs/ /etc/ssl/certs/
COPY --chown=10000:10000 --from=builder /app /app/
WORKDIR /app/node_modules/@gitpod/gitpod-db

ARG __GIT_COMMIT
ARG VERSION

ENV GITPOD_BUILD_GIT_COMMIT=${__GIT_COMMIT}
ENV GITPOD_BUILD_VERSION=${VERSION}
7 changes: 6 additions & 1 deletion components/gitpod-protocol/src/util/tracing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,13 @@ export class TracingManager {
serviceName,
}
const t = initTracerFromEnv(config, {
logger: console
logger: console,
tags: {
'service.build.commit': process.env.GITPOD_BUILD_GIT_COMMIT,
'service.build.version': process.env.GITPOD_BUILD_VERSION,
}
});

if (opts) {
if (opts.perOpSampling) {
(t as any)._sampler = new PerOperationSampler((t as any)._sampler, opts.perOpSampling);
Expand Down
2 changes: 2 additions & 0 deletions components/proxy/BUILD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ packages:
argdeps:
- imageRepoBase
config:
buildArgs:
VERSION: ${version}
dockerfile: Dockerfile
metadata:
helm-component: proxy
Expand Down
6 changes: 6 additions & 0 deletions components/proxy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,10 @@ COPY --from=builder /caddy /usr/bin/caddy
COPY conf/Caddyfile /etc/caddy/Caddyfile
COPY conf/vhost.empty /etc/caddy/vhosts/vhost.empty

ARG __GIT_COMMIT
ARG VERSION

ENV GITPOD_BUILD_GIT_COMMIT=${__GIT_COMMIT}
ENV GITPOD_BUILD_VERSION=${VERSION}

CMD [ "caddy", "run", "-watch", "-config", "/etc/caddy/Caddyfile" ]
2 changes: 2 additions & 0 deletions components/server/BUILD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ packages:
argdeps:
- imageRepoBase
config:
buildArgs:
VERSION: ${version}
dockerfile: leeway.Dockerfile
metadata:
helm-component: server
Expand Down
6 changes: 6 additions & 0 deletions components/server/leeway.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,10 @@ COPY --from=builder /app /app/
USER unode
WORKDIR /app/node_modules/@gitpod/server
# Don't use start-ee-inspect as long as we use native modules (casues segfault)

ARG __GIT_COMMIT
ARG VERSION

ENV GITPOD_BUILD_GIT_COMMIT=${__GIT_COMMIT}
ENV GITPOD_BUILD_VERSION=${VERSION}
CMD exec yarn start-ee
2 changes: 2 additions & 0 deletions components/ws-manager-bridge/BUILD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ packages:
argdeps:
- imageRepoBase
config:
buildArgs:
VERSION: ${version}
dockerfile: leeway.Dockerfile
metadata:
helm-component: wsManagerBridge
Expand Down
6 changes: 6 additions & 0 deletions components/ws-manager-bridge/leeway.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,10 @@ RUN useradd --no-log-init --create-home --uid 31002 --home-dir /app/ unode
COPY --from=builder /app /app/
USER unode
WORKDIR /app/node_modules/@gitpod/ws-manager-bridge

ARG __GIT_COMMIT
ARG VERSION

ENV GITPOD_BUILD_GIT_COMMIT=${__GIT_COMMIT}
ENV GITPOD_BUILD_VERSION=${VERSION}
CMD exec yarn start-ee

0 comments on commit 28bf0e6

Please sign in to comment.