I configured the helm chart to enable ingress for ...
# general
d
I configured the helm chart to enable ingress for otelCollector as follows:
Copy code
otelCollector:
  ingress:
    enabled: true
    className: "nginx"
    annotations:
      <http://nginx.ingress.kubernetes.io/ssl-redirect|nginx.ingress.kubernetes.io/ssl-redirect>: "false"
    hosts:
      - host: <http://tracing-collector.example.com|tracing-collector.example.com>
        paths:
          - path: /
            pathType: ImplementationSpecific
            port: 4318
    tls: []
Then I dockerized the simple petclinic application as follows:
Copy code
FROM openjdk:11

WORKDIR /app

ADD <https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar> /app/opentelemetry-javaagent.jar

COPY target/spring-petclinic-2.4.5.jar /app/spring-petclinic-2.4.5.jar

ENV OTEL_EXPORTER_OTLP_ENDPOINT=<http://tracing-collector.example.com>

ENV OTEL_RESOURCE_ATTRIBUTES=service.name=JavaDemoApp

ENV JAVA_TOOL_OPTIONS="-javaagent:/app/opentelemetry-javaagent.jar \
                      -Dotel.exporter.otlp.endpoint=$OTEL_EXPORTER_OTLP_ENDPOINT \
                      -Dotel.resource.attributes=$OTEL_RESOURCE_ATTRIBUTES"

EXPOSE 8080

CMD ["java", "-jar", "spring-petclinic-2.4.5.jar"]
However, when running the application on Kubernetes, I received the error below and the service did not appear in the Frontend:
Copy code
[otel.javaagent 2023-11-03 08:06:02:946 +0000] [OkHttp <http://tracing-collector.example.com/...>] WARN io.opentelemetry.exporter.internal.grpc.GrpcExporter - Failed to export spans. Server res │
│ ponded with gRPC status code 2. Error message:
Does anyone know how I can fix this?
167 Views