https://signoz.io logo
#support
Title
# support
s

Slackbot

03/09/2022, 8:48 AM
This message was deleted.
p

Pranay

03/09/2022, 12:28 PM
@User So you want to dockerize your java app?
d

Danish Ahmad Ansari

03/09/2022, 1:23 PM
Dockerize both the java app as well as the run signoz
# syntax=docker/dockerfile:1 FROM scratch ADD OTEL_METRICS_EXPORTER=none OTEL_EXPORTER_OTLP_ENDPOINT="http://x.x.x.x:4317" OTEL_RESOURCE_ATTRIBUTES=service.name=test_danish java -javaagent:opentelemetry-javaagent.jar -jar target/*.jar CMD ["/ADD OTEL_METRICS_EXPORTER=none OTEL_EXPORTER_OTLP_ENDPOINT="http://x.x.x.x:4317" OTEL_RESOURCE_ATTRIBUTES=service.name=test_danish java -javaagent:opentelemetry-javaagent.jar -jar target/*.jar "]
I wanted to do something like this. But getting error.
p

Pranay

03/11/2022, 7:38 AM
ok - what errors are you getting?
d

Danish Ahmad Ansari

03/11/2022, 10:46 AM
Neither signoz nor java app runing
Step 1/3 : FROM scratch ---> Step 2/3 : COPY OTEL_METRICS_EXPORTER=none OTEL_EXPORTER_OTLP_ENDPOINT="http://10.20.15.7:4317" OTEL_RESOURCE_ATTRIBUTES=service.name=test_danish java -javaagent:opentelemetry-javaagent.jar -jar target/*.jar / COPY failed: file not found in build context or excluded by .dockerignore: stat OTEL_METRICS_EXPORTER=none: file does not exist
p

Pranay

03/11/2022, 12:41 PM
Danish, i don't think its a problem with SigNoz but how you are setting up your java app as a docker image
d

Danish Ahmad Ansari

03/15/2022, 3:43 PM
No problem in signoz. Here I have made the docker file
FROM openjdk:8-jre-alpine EXPOSE 8888 WORKDIR /app COPY opentelemetry-javaagent.jar opentelemetry-javaagent.jar COPY target/JAR_NAME.jar app.jar ENV OTEL_METRICS_EXPORTER=none ENV OTEL_EXPORTER_OTLP_ENDPOINT="http//X>X.X.X.X4317" ENV OTEL_RESOURCE_ATTRIBUTES=service.name=test_app ENTRYPOINT [ "java", "-javaagent:opentelemetry-javaagent.jar", "-jar", "app.jar"]
docker run --network NETWORK-NAME --name CONTAINER NAME-d -p 8080:8888 app-NAME -d
3 Views