Created
September 29, 2022 19:29
-
-
Save jdbranham/039f246630ed3cd87f403fdd2280a1cc to your computer and use it in GitHub Desktop.
Open Telemetry java agent with Kafka
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM bitnami/kafka:3.2 | |
| ENV OLTP_AGENT_URL=https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.18.0/opentelemetry-javaagent.jar | |
| ADD --chown=1001:1001 ${OLTP_AGENT_URL} /opt/bitnami/kafka/libs/opentelemetry-javaagent.jar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: apps/v1 | |
| kind: StatefulSet | |
| metadata: | |
| name: kafka | |
| spec: | |
| selector: | |
| matchLabels: | |
| app: kafka | |
| serviceName: kafka | |
| replicas: 1 | |
| template: | |
| metadata: | |
| labels: | |
| app: kafka | |
| spec: | |
| securityContext: | |
| runAsUser: 1001 | |
| fsGroup: 1001 | |
| containers: | |
| - name: kafka | |
| image: bitnami/kafka:3.2 # USE YOUR CUSTOM KAFKA IMAGE HERE | |
| imagePullPolicy: Always | |
| resources: | |
| requests: | |
| cpu: "500m" | |
| memory: "1Gi" | |
| limits: | |
| cpu: "1" | |
| memory: 2Gi | |
| ports: | |
| - containerPort: 9092 | |
| name: plaintext | |
| volumeMounts: | |
| - name: kafka-data | |
| mountPath: /bitnami | |
| env: | |
| - name: ALLOW_PLAINTEXT_LISTENER | |
| value: yes | |
| - name: KAFKA_CFG_ZOOKEEPER_CONNECT | |
| value: kafka-zookeeper:2181 | |
| - name: JAVA_TOOL_OPTIONS | |
| value: -javaagent:/opt/bitnami/kafka/libs/opentelemetry-javaagent.jar | |
| -Dotel.resource.attributes=service.name=kafka | |
| -Dotel.traces.exporter=otlp | |
| -Dotel.exporter.otlp.traces.endpoint=http://tempo:4317 | |
| -Dotel.exporter.otlp.insecure=true | |
| -Dotel.exporter.otlp.metrics.endpoint=http://otel-collector:4317 | |
| volumeClaimTemplates: | |
| - metadata: | |
| name: kafka-data | |
| spec: | |
| accessModes: [ "ReadWriteOnce" ] | |
| resources: | |
| requests: | |
| storage: 5Gi | |
| --- | |
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| name: kafka | |
| spec: | |
| selector: | |
| app: kafka | |
| ports: | |
| - port: 9092 | |
| targetPort: 9092 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment