sidecar.yaml şöyledir
apiVersion: opentelemetry.io/v1alpha1kind: OpenTelemetryCollectormetadata:name: sidecarspec:mode: sidecarconfig: |receivers:otlp:protocols:grpc:http:processors:batch:exporters:logging:otlp:endpoint: "<path_to_central_collector>:4317"service:telemetry:logs:level: "debug"pipelines:traces:receivers: [otlp]processors: []exporters: [logging, otlp]
instrumentation.yaml şöyledir
deployment.yaml şöyledirapiVersion: opentelemetry.io/v1alpha1kind: Instrumentation metadata: name: java-instrumentation spec: propagators: - tracecontext - baggage - b3 sampler: type: always_on java:
apiVersion: apps/v1 kind: Deployment metadata: name: petclinic labels: app: petclinic spec: replicas: 1 selector: matchLabels: app: petclinic template: metadata: annotations: instrumentation.opentelemetry.io/inject-java: 'true' sidecar.opentelemetry.io/inject: 'sidecar' labels: app: petclinic spec: containers: - name: petclinic image: <path_to_petclinic_image> ports: - containerPort: 8080
Açıklaması şöyle
To enable the instrumentation, we need to update the deployment file and add annotations to it. This way we tell the OpenTelemetry Operator to inject the sidecar and the java-instrumentation to our application.
apiVersion: v1 kind: Service metadata: name: petclinic-service spec: selector: app: petclinic ports: - protocol: TCP port: 80 targetPort: 8080
Hiç yorum yok:
Yorum Gönder