Closed Shashankft9 closed 3 years ago
Pinging @slinkydeveloper and @pierDipi as they recently worked on enabling tracing for other components.
@lionelvillard mtping watches and properly configures the config-tracing CM?
@Shashankft9 do you see this error in the PingSource adapter logs: Error setting up trace publishing
?
I just checked, I do get this at the startup:
{"level":"warn","ts":"2021-01-19T14:11:31.574Z","caller":"v2/config.go:185","msg":"Tracing configuration is invalid, using the no-op default{error 26 0 empty json tracing config}","commit":"d2440ed","logging.googleapis.com/labels":{},"logging.googleapis.com/sourceLocation":{"file":"knative.dev/eventing/pkg/adapter/v2/config.go","line":"185","function":"knative.dev/eventing/pkg/adapter/v2.(*EnvConfig).SetupTracing"}}
That's explain why you don't get traces but that does not explain why it works for APIServerSource. Can you do:
kubectl get -n knative-eventing deployments.apps pingsource-mt-adapter -oyaml
and share the result?
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "27"
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{},"labels":{"eventing.knative.dev/release":"devel"},"name":"pingsource-mt-adapter","namespace":"knative-eventing"},"spec":{"replicas":0,"selector":{"matchLabels":{"eventing.knative.dev/source":"ping-source-controller","sources.knative.dev/role":"adapter"}},"template":{"metadata":{"labels":{"eventing.knative.dev/release":"devel","eventing.knative.dev/source":"ping-source-controller","sources.knative.dev/role":"adapter"}},"spec":{"containers":[{"env":[{"name":"SYSTEM_NAMESPACE","value":"","valueFrom":{"fieldRef":{"apiVersion":"v1","fieldPath":"metadata.namespace"}}},{"name":"K_METRICS_CONFIG","value":""},{"name":"K_LOGGING_CONFIG","value":""},{"name":"K_LEADER_ELECTION_CONFIG","value":""},{"name":"K_NO_SHUTDOWN_AFTER","value":""},{"name":"K_SINK_TIMEOUT","value":"-1"},{"name":"POD_NAME","valueFrom":{"fieldRef":{"fieldPath":"metadata.name"}}}],"image":"docker.io/shashankft/mtping-26ac4e6a49a610ffaac30cc0a8ab693a@sha256:3bd890f1bc05eea17ebae520d48a95122f1c9017259f99cc1d79fd000c705c93","name":"dispatcher","ports":[{"containerPort":9090,"name":"metrics","protocol":"TCP"}],"resources":{"limits":{"cpu":"1000m","memory":"2048Mi"},"requests":{"cpu":"125m","memory":"64Mi"}}}],"serviceAccountName":"pingsource-mt-adapter"}}}}
creationTimestamp: "2021-01-04T07:38:15Z"
generation: 28
labels:
eventing.knative.dev/release: devel
name: pingsource-mt-adapter
namespace: knative-eventing
resourceVersion: "33580175"
selfLink: /apis/apps/v1/namespaces/knative-eventing/deployments/pingsource-mt-adapter
uid: 94b44820-1312-474f-8eb7-973cf67e3a29
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
eventing.knative.dev/source: ping-source-controller
sources.knative.dev/role: adapter
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
creationTimestamp: null
labels:
eventing.knative.dev/release: devel
eventing.knative.dev/source: ping-source-controller
sources.knative.dev/role: adapter
spec:
containers:
- env:
- name: SYSTEM_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: K_METRICS_CONFIG
value: '{"Domain":"knative.dev/eventing","Component":"pingsource","PrometheusPort":0,"PrometheusHost":"","ConfigMap":{}}'
- name: K_LOGGING_CONFIG
value: '{"zap-logger-config":"{\n \"level\": \"debug\",\n \"development\":
false,\n \"outputPaths\": [\"stdout\"],\n \"errorOutputPaths\": [\"stderr\"],\n \"encoding\":
\"json\",\n \"encoderConfig\": {\n \"timeKey\": \"ts\",\n \"levelKey\":
\"level\",\n \"nameKey\": \"logger\",\n \"callerKey\": \"caller\",\n \"messageKey\":
\"msg\",\n \"stacktraceKey\": \"stacktrace\",\n \"lineEnding\":
\"\",\n \"levelEncoder\": \"\",\n \"timeEncoder\": \"iso8601\",\n \"durationEncoder\":
\"\",\n \"callerEncoder\": \"\"\n }\n}\n"}'
- name: K_LEADER_ELECTION_CONFIG
value: '{"Component":"pingsource-mt-adapter","Buckets":1,"LeaseDuration":15000000000,"RenewDeadline":10000000000,"RetryPeriod":2000000000,"Identity":""}'
- name: K_NO_SHUTDOWN_AFTER
value: "55"
- name: K_SINK_TIMEOUT
value: "-1"
image: docker.io/shashankft/mtping-26ac4e6a49a610ffaac30cc0a8ab693a@sha256:3bd890f1bc05eea17ebae520d48a95122f1c9017259f99cc1d79fd000c705c93
imagePullPolicy: IfNotPresent
name: dispatcher
ports:
- containerPort: 9090
name: metrics
protocol: TCP
resources:
limits:
cpu: "1"
memory: 2Gi
requests:
cpu: 125m
memory: 64Mi
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
serviceAccount: pingsource-mt-adapter
serviceAccountName: pingsource-mt-adapter
terminationGracePeriodSeconds: 30
status:
availableReplicas: 1
conditions:
- lastTransitionTime: "2021-01-04T07:38:15Z"
lastUpdateTime: "2021-01-19T14:11:32Z"
message: ReplicaSet "pingsource-mt-adapter-58478687f4" has successfully progressed.
reason: NewReplicaSetAvailable
status: "True"
type: Progressing
- lastTransitionTime: "2021-01-21T10:09:00Z"
lastUpdateTime: "2021-01-21T10:09:00Z"
message: Deployment has minimum availability.
reason: MinimumReplicasAvailable
status: "True"
type: Available
observedGeneration: 28
readyReplicas: 1
replicas: 1
updatedReplicas: 1
hmm i am using the image after doing some code change here: https://github.com/knative/eventing/blob/master/pkg/adapter/v2/config.go#L187
I changed e.Component
to ""
to make APIServerSource traces to work. context: https://github.com/knative/eventing/issues/1889#issuecomment-762033421
thanks @Shashankft9 I see what's wrong, K_TRACING_CONFIG is missing. The controller does not set it.
@cr22rc Do you have cycles to look at this one?
Describe the bug Even though the PingSource is sending cloudevents to a sink every minute, I cant see the traces on jager UI.
Expected behavior The traces should come up with cloudevent tags.
To Reproduce PingSource CR:
Edited
config-tracing
cm:Knative release version v0.19.0
Additional context I can see APIServerSource traces on jaeger properly, a screen cap just so we are sure that zipking endpoint is not at fault here:![jaeger_apiserversource](https://user-images.githubusercontent.com/48708039/105046906-a92c2d80-5a8f-11eb-94ec-040e6a7788d6.PNG)
And the logs of pingsource adapter (of just moments ago):