diff --git a/README.md b/README.md index 6b7b6d2..910507a 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ containers: apiVersion: v1 fieldPath: metadata.namespace # this will be send all traces to jaeger agent (daemonset) - - name: JAEGER_AGENT_HOST + - name: OTLP_COLLECTOR_HOST valueFrom: fieldRef: apiVersion: v1 diff --git a/docker-compose.yml b/docker-compose.yml index 387b68e..38c36a1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -65,7 +65,7 @@ services: - ./certs/:/certs:ro environment: - ENVOY_SERVICE_NAME=test1-id - - JAEGER_AGENT_HOST=jaeger + - OTLP_COLLECTOR_HOST=jaeger command: - /bin/sh - -c @@ -87,7 +87,7 @@ services: context: . environment: - ENVOY_SERVICE_NAME=test2-id - - JAEGER_AGENT_HOST=jaeger + - OTLP_COLLECTOR_HOST=jaeger command: - /usr/local/bin/envoy - --config-path /etc/envoy/envoy.yaml @@ -107,7 +107,7 @@ services: context: . environment: - ENVOY_SERVICE_NAME=test2-id - - JAEGER_AGENT_HOST=jaeger + - OTLP_COLLECTOR_HOST=jaeger command: - /usr/local/bin/envoy - --config-path /etc/envoy/envoy.yaml diff --git a/envoy/Dockerfile b/envoy/Dockerfile index 34f49f3..65a2bf8 100644 --- a/envoy/Dockerfile +++ b/envoy/Dockerfile @@ -6,7 +6,6 @@ FROM $base ARG TARGETARCH ADD --chown=envoy:envoy https://github.com/maksim-paskal/go-template/releases/download/v0.1.2/go-template_0.1.2_linux_${TARGETARCH} /usr/local/bin/go-template -COPY --from=paskalmaksim/jaeger-client-cpp:0.5.0-clang --chown=envoy:envoy /libjaegertracing_plugin.so /usr/local/lib/libjaegertracing_plugin.so COPY ./cli /usr/local/bin/cli COPY ./envoy/scripts /scripts @@ -18,10 +17,8 @@ RUN apt update \ && apt full-upgrade -y \ && touch /tmp/checksum.amd64 \ && echo "65d6b1e296dafb062c785c5a14135beeca953b11c577a70da74e5071793a4120 /usr/local/bin/go-template" >> /tmp/checksum.amd64 \ -&& echo "473ce4db569c2adfb6fc52a35582310c66164a241b7d7c5cc514d334757b682a /usr/local/lib/libjaegertracing_plugin.so" >> /tmp/checksum.amd64 \ && touch /tmp/checksum.arm64 \ && echo "c70ad5472a7a4db5ee9fd2593ebbad1437f345c9ee4a0fda3ba688199350e277 /usr/local/bin/go-template" >> /tmp/checksum.arm64 \ -&& echo "edb17cbd9e87afbb2f4612b37f52499ccbd9844d88c22144f0aafb129d3aabd7 /usr/local/lib/libjaegertracing_plugin.so" >> /tmp/checksum.arm64 \ && sha256sum -c /tmp/checksum.${TARGETARCH} \ && rm -rf /tmp/checksum* \ && chmod +x /usr/local/bin/go-template /entrypoint.sh /usr/local/bin/cli /scripts/* \ @@ -35,8 +32,12 @@ USER 101 ENV XDS_CLUSTER_TYPE=STRICT_DNS ENV XDS_CLUSTER_ADDRESS=envoy-control-plane +ENV ENVOY_SERVICE_NAME=test-service +ENV OTLP_COLLECTOR_HOST=collector +ENV OTLP_COLLECTOR_PORT=4317 + # test configuration -RUN ENVOY_SERVICE_NAME=test-service JAEGER_AGENT_HOST=jaeger /entrypoint.sh \ +RUN /entrypoint.sh \ /usr/local/bin/envoy \ -c /etc/envoy/envoy.yaml \ --service-cluster test \ diff --git a/envoy/envoy.defaults/envoy.yaml b/envoy/envoy.defaults/envoy.yaml index 5944e0d..8e0da8b 100644 --- a/envoy/envoy.defaults/envoy.yaml +++ b/envoy/envoy.defaults/envoy.yaml @@ -76,6 +76,23 @@ static_resources: grpc_services: - envoy_grpc: cluster_name: xds_cluster + - name: opentelemetry_collector + type: STRICT_DNS + lb_policy: ROUND_ROBIN + typed_extension_protocol_options: + envoy.extensions.upstreams.http.v3.HttpProtocolOptions: + "@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions + explicit_http_config: + http2_protocol_options: {} + load_assignment: + cluster_name: opentelemetry_collector + endpoints: + - lb_endpoints: + - endpoint: + address: + socket_address: + address: {{ env "OTLP_COLLECTOR_HOST" }} + port_value: {{ env "OTLP_COLLECTOR_PORT" }} - name: xds_cluster connect_timeout: 1s type: {{ env "XDS_CLUSTER_TYPE" }} @@ -145,21 +162,11 @@ admin: tracing: http: - name: envoy.tracers.dynamic_ot + name: envoy.tracers.opentelemetry typed_config: - "@type": type.googleapis.com/envoy.config.trace.v3.DynamicOtConfig - library: /usr/local/lib/libjaegertracing_plugin.so - config: - service_name: {{ env "ENVOY_SERVICE_NAME" }} - sampler: - type: const - param: 1 - reporter: - localAgentHostPort: {{ env "JAEGER_AGENT_HOST" }}:6831 - headers: - jaegerDebugHeader: jaeger-debug-id - jaegerBaggageHeader: jaeger-baggage - traceBaggageHeaderPrefix: uberctx- - baggage_restrictions: - denyBaggageOnInitializationFailure: false - hostPort: "" \ No newline at end of file + "@type": type.googleapis.com/envoy.config.trace.v3.OpenTelemetryConfig + grpc_service: + envoy_grpc: + cluster_name: opentelemetry_collector + timeout: 0.250s + service_name: {{ env "ENVOY_SERVICE_NAME" }} diff --git a/examples/test-deploy/templates/envoy.yaml b/examples/test-deploy/templates/envoy.yaml index 0d2affc..52899b7 100644 --- a/examples/test-deploy/templates/envoy.yaml +++ b/examples/test-deploy/templates/envoy.yaml @@ -69,7 +69,7 @@ spec: env: - name: ENVOY_SERVICE_NAME value: "test-envoy-service" - - name: JAEGER_AGENT_HOST + - name: OTLP_COLLECTOR_HOST valueFrom: fieldRef: apiVersion: v1