Skip to content

Instantly share code, notes, and snippets.

@jpkrohling
Created March 20, 2019 13:22
Show Gist options
  • Save jpkrohling/406617419fa8de47910c832c44e5e2be to your computer and use it in GitHub Desktop.
Save jpkrohling/406617419fa8de47910c832c44e5e2be to your computer and use it in GitHub Desktop.
Operator PR #333, HttpSender => cluster IP service
$ kubectl get service simple-prod-collector-lb
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
simple-prod-collector-lb ClusterIP 172.30.85.144 <none> 9411/TCP,14250/TCP,14267/TCP,14268/TCP 1h
$ kubectl get deployment myapp -o yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "1"
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{"sidecar.jaegertracing.io/inject":"false"},"name":"myapp","namespace":"myproject"},"spec":{"selector":{"matchLabels":{"app":"myapp"}},"template":{"metadata":{"labels":{"app":"myapp"}},"spec":{"containers":[{"env":[{"name":"JAEGER_ENDPOINT","value":"http://simple-prod-collector-lb.myproject:14268/api/traces"}],"image":"jaegertracing/vertx-create-span:operator-e2e-tests","name":"myapp"}]}}}}
sidecar.jaegertracing.io/inject: "false"
creationTimestamp: 2019-03-20T12:14:30Z
generation: 1
name: myapp
namespace: myproject
resourceVersion: "37614"
selfLink: /apis/extensions/v1beta1/namespaces/myproject/deployments/myapp
uid: b6fb4303-4b09-11e9-8301-525400978a47
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: myapp
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
creationTimestamp: null
labels:
app: myapp
spec:
containers:
- env:
- name: JAEGER_ENDPOINT
value: http://simple-prod-collector-lb.myproject:14268/api/traces
image: jaegertracing/vertx-create-span:operator-e2e-tests
imagePullPolicy: IfNotPresent
name: myapp
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
status:
availableReplicas: 1
conditions:
- lastTransitionTime: 2019-03-20T12:14:32Z
lastUpdateTime: 2019-03-20T12:14:32Z
message: Deployment has minimum availability.
reason: MinimumReplicasAvailable
status: "True"
type: Available
- lastTransitionTime: 2019-03-20T12:14:30Z
lastUpdateTime: 2019-03-20T12:14:32Z
message: ReplicaSet "myapp-797f97c84d" has successfully progressed.
reason: NewReplicaSetAvailable
status: "True"
type: Progressing
observedGeneration: 1
readyReplicas: 1
replicas: 1
updatedReplicas: 1
$ kubectl logs myapp-797f97c84d-dscd4 | head
exec java -javaagent:/opt/agent-bond/agent-bond.jar=jolokia{{host=0.0.0.0}},jmx_exporter{{9779:/opt/agent-bond/jmx_exporter_config.yml}} -XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=40 -XX:+ExitOnOutOfMemoryError -cp . -jar /deployments/demo-1.0.0-SNAPSHOT-fat.jar
I> No access restrictor found, access to any MBean is allowed
Jolokia: Agent started with URL http://172.17.0.10:8778/jolokia/
2019-03-20 12:14:32 INFO MainVerticle:28 - Agent at: null
2019-03-20 12:14:32 INFO Configuration:236 - Initialized tracer=JaegerTracer(version=Java-0.30.6, serviceName=order, reporter=CompositeReporter(reporters=[RemoteReporter(sender=HttpSender(), closeEnqueueTimeout=1000), LoggingReporter(logger=org.slf4j.impl.Log4jLoggerAdapter(io.jaegertracing.internal.reporters.LoggingReporter))]), sampler=ConstSampler(decision=true, tags={sampler.type=const, sampler.param=true}), tags={hostname=myapp-797f97c84d-dscd4, jaeger.version=Java-0.30.6, ip=172.17.0.10}, zipkinSharedRpcSpan=false, expandExceptionLogs=false)
2019-03-20 12:14:32 INFO Configuration:236 - Initialized tracer=JaegerTracer(version=Java-0.30.6, serviceName=inventory, reporter=CompositeReporter(reporters=[RemoteReporter(sender=HttpSender(), closeEnqueueTimeout=1000), LoggingReporter(logger=org.slf4j.impl.Log4jLoggerAdapter(io.jaegertracing.internal.reporters.LoggingReporter))]), sampler=ConstSampler(decision=true, tags={sampler.type=const, sampler.param=true}), tags={hostname=myapp-797f97c84d-dscd4, jaeger.version=Java-0.30.6, ip=172.17.0.10}, zipkinSharedRpcSpan=false, expandExceptionLogs=false)
2019-03-20 12:14:32 INFO MainVerticle:44 - HTTP server started on port 8080
$ kubectl port-forward myapp-797f97c84d-dscd4 8080:8080
$ ab -c 10 -n 100 localhost:8080/
$ kubectl port-forward simple-prod-collector-7798c588f7-t6rfc 14268:14268
$ curl localhost:14268/metrics 2>/dev/null | grep jaeger_collector_spans_received_total
# HELP jaeger_collector_spans_received_total received
# TYPE jaeger_collector_spans_received_total counter
jaeger_collector_spans_received_total{debug="false",format="jaeger",svc="inventory"} 1992
jaeger_collector_spans_received_total{debug="false",format="jaeger",svc="order"} 3510
jaeger_collector_spans_received_total{debug="false",format="jaeger",svc="other-services"} 0
jaeger_collector_spans_received_total{debug="false",format="unknown",svc="other-services"} 0
jaeger_collector_spans_received_total{debug="false",format="zipkin",svc="other-services"} 0
jaeger_collector_spans_received_total{debug="true",format="jaeger",svc="other-services"} 0
jaeger_collector_spans_received_total{debug="true",format="unknown",svc="other-services"} 0
jaeger_collector_spans_received_total{debug="true",format="zipkin",svc="other-services"} 0
$ kubectl port-forward simple-prod-collector-7798c588f7-p9pgn 14268:14268
$ curl localhost:14268/metrics 2>/dev/null | grep jaeger_collector_spans_received_total
# HELP jaeger_collector_spans_received_total received
# TYPE jaeger_collector_spans_received_total counter
jaeger_collector_spans_received_total{debug="false",format="jaeger",svc="inventory"} 1204
jaeger_collector_spans_received_total{debug="false",format="jaeger",svc="order"} 485
jaeger_collector_spans_received_total{debug="false",format="jaeger",svc="other-services"} 0
jaeger_collector_spans_received_total{debug="false",format="unknown",svc="other-services"} 0
jaeger_collector_spans_received_total{debug="false",format="zipkin",svc="other-services"} 0
jaeger_collector_spans_received_total{debug="true",format="jaeger",svc="other-services"} 0
jaeger_collector_spans_received_total{debug="true",format="unknown",svc="other-services"} 0
jaeger_collector_spans_received_total{debug="true",format="zipkin",svc="other-services"} 0
$ kubectl port-forward simple-prod-collector-7798c588f7-4z2k5 14268:14268
$ curl localhost:14268/metrics 2>/dev/null | grep jaeger_collector_spans_received_total
# HELP jaeger_collector_spans_received_total received
# TYPE jaeger_collector_spans_received_total counter
jaeger_collector_spans_received_total{debug="false",format="jaeger",svc="other-services"} 0
jaeger_collector_spans_received_total{debug="false",format="unknown",svc="other-services"} 0
jaeger_collector_spans_received_total{debug="false",format="zipkin",svc="other-services"} 0
jaeger_collector_spans_received_total{debug="true",format="jaeger",svc="other-services"} 0
jaeger_collector_spans_received_total{debug="true",format="unknown",svc="other-services"} 0
jaeger_collector_spans_received_total{debug="true",format="zipkin",svc="other-services"} 0
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
elasticsearch-0 1/1 Running 0 3h
myapp-797f97c84d-dscd4 1/1 Running 0 1h
simple-prod-collector-7798c588f7-4z2k5 1/1 Running 0 1h
simple-prod-collector-7798c588f7-p9pgn 1/1 Running 0 1h
simple-prod-collector-7798c588f7-t6rfc 1/1 Running 0 1h
simple-prod-query-76b55b4f99-svhp2 3/3 Running 0 1h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment