Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples(dagger): quick start nodejs #4031

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions examples/quick-start-dagger-nodejs/.env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Get the required information here: https://app.tracetest.io/retrieve-token

TRACETEST_TOKEN="<YOUR_TRACETEST_TOKEN>"
TRACETEST_ENVIRONMENT_ID="<YOUR_ENV_ID>"
TRACETEST_ORGANIZATION_ID="<YOUR_ORG_ID>"

# GRPC
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="http://tracetest-agent:4317/"
# or, use HTTP
# OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="http://tracetest-agent:4318/v1/traces"
4 changes: 4 additions & 0 deletions examples/quick-start-dagger-nodejs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
.DS_Store
.env
.env.token
7 changes: 7 additions & 0 deletions examples/quick-start-dagger-nodejs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM node:slim
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 8080
CMD [ "npm", "run", "with-grpc-tracer" ]
11 changes: 11 additions & 0 deletions examples/quick-start-dagger-nodejs/Dockerfile.tracetest
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM alpine

WORKDIR /app
ARG TRACETEST_IMAGE_VERSION=v1.4.0

RUN apk --update add bash jq curl
RUN curl -L https://raw.githubusercontent.com/kubeshop/tracetest/main/install-cli.sh | bash -s -- $TRACETEST_IMAGE_VERSION

WORKDIR /resources

ENTRYPOINT ["echo", "Tracetest CLI installed"]
10 changes: 10 additions & 0 deletions examples/quick-start-dagger-nodejs/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const express = require("express")
const app = express()
app.get("/", (req, res) => {
setTimeout(() => {
res.send("Hello World")
}, 1000);
})
app.listen(8080, () => {
console.log(`Listening for requests on http://localhost:8080`)
})
24 changes: 24 additions & 0 deletions examples/quick-start-dagger-nodejs/collector.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
receivers:
otlp:
protocols:
grpc:
http:

processors:
batch:
timeout: 100ms

exporters:
logging:
loglevel: debug
otlp/1:
endpoint: tracetest-agent:4317
tls:
insecure: true

service:
pipelines:
traces/1:
receivers: [otlp]
processors: [batch]
exporters: [otlp/1]
12 changes: 12 additions & 0 deletions examples/quick-start-dagger-nodejs/dagger.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "quick-start-dagger-nodejs",
"sdk": "typescript",
"dependencies": [
{
"name": "tracetest",
"source": "github.com/kubeshop/tracetest@8c44d01e33e677518a555d1b958cf7be0d70f940"
}
],
"source": "dagger",
"engineVersion": "v0.13.3"
}
1 change: 1 addition & 0 deletions examples/quick-start-dagger-nodejs/dagger/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/sdk/** linguist-generated
3 changes: 3 additions & 0 deletions examples/quick-start-dagger-nodejs/dagger/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/sdk
/**/node_modules/**
/**/.pnpm-store/**
Loading
Loading