-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TEP-0124] implement opentelemetry Jaeger tracing #5746
Changes from all commits
3ebcd6a
843b23f
05801e8
87b6ca0
aa45acf
400a3af
d8aff7d
dde7837
adc1d04
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Tracing setup | ||
|
||
This sections shows how to enable tracing for tekton reconcilers and | ||
capture traces in Jaeger | ||
|
||
## Prerequisites | ||
|
||
Jaeger should be installed and accessible from the cluster. The easiest | ||
way to set it up is using helm as below | ||
|
||
the following command installs Jaeger in `jaeger` namespace | ||
|
||
``` | ||
helm repo add jaegertracing https://jaegertracing.github.io/helm-charts | ||
helm upgrade -i jaeger jaegertracing/jaeger -n jaeger --create-namespace | ||
``` | ||
|
||
Use port-forwarding to open the jaeger query UI or adjust the service | ||
type to Loadbalancer for accessing the service directly | ||
|
||
``` | ||
kubectl port-forward svc/jaeger-query -n jaeger 8080:80 | ||
``` | ||
|
||
Check the official [Jaeger docs](https://www.jaegertracing.io/docs/) on how to work with Jaeger | ||
|
||
## Enabling tracing | ||
|
||
Tekton pipelines controller expects the following environment variables to be able to connect to jaeger: | ||
|
||
* `OTEL_EXPORTER_JAEGER_ENDPOINT` is the HTTP endpoint for sending spans directly to a collector. | ||
* `OTEL_EXPORTER_JAEGER_USER` is the username to be sent as authentication to the collector endpoint. | ||
* `OTEL_EXPORTER_JAEGER_PASSWORD` is the password to be sent as authentication to the collector endpoint. | ||
|
||
`OTEL_EXPORTER_JAEGER_ENDPOINT` is the only manadatory variable to enable tracing. You can find these variables in the controller manifest as well. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4569,6 +4569,9 @@ reasons that emerge from underlying resources are not included here</p> | |
</tr><tr><td><p>"TaskRunImagePullFailed"</p></td> | ||
<td><p>TaskRunReasonImagePullFailed is the reason set when the step of a task fails due to image not being pulled</p> | ||
</td> | ||
</tr><tr><td><p>"TaskRunResultLargerThanAllowedLimit"</p></td> | ||
<td><p>TaskRunReasonResultLargerThanAllowedLimit is the reason set when one of the results exceeds its maximum allowed limit of 1 KB</p> | ||
</td> | ||
Comment on lines
+4572
to
+4574
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like these were missed in some previous PR, but I wonder by CI did not catch them. |
||
</tr><tr><td><p>"Running"</p></td> | ||
<td><p>TaskRunReasonRunning is the reason set when the TaskRun is running</p> | ||
</td> | ||
|
@@ -6347,15 +6350,17 @@ string | |
<td> | ||
<code>kms</code><br/> | ||
<em> | ||
<a href="#tekton.dev/v1alpha1.HashAlgorithm"> | ||
HashAlgorithm | ||
</a> | ||
string | ||
</em> | ||
</td> | ||
<td> | ||
<em>(Optional)</em> | ||
<p>KMS contains the KMS url of the public key | ||
Supported formats differ based on the KMS system used.</p> | ||
Supported formats differ based on the KMS system used. | ||
One example of a KMS url could be: | ||
gcpkms://projects/[PROJECT]/locations/[LOCATION]>/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[KEY_VERSION] | ||
For more examples please refer <a href="https://docs.sigstore.dev/cosign/kms_support">https://docs.sigstore.dev/cosign/kms_support</a>. | ||
Note that the KMS is not supported yet.</p> | ||
Comment on lines
+6359
to
+6363
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto |
||
</td> | ||
</tr> | ||
<tr> | ||
|
@@ -10048,6 +10053,17 @@ Provenance | |
<p>Provenance contains some key authenticated metadata about how a software artifact was built (what sources, what inputs/outputs, etc.).</p> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<code>spanContext</code><br/> | ||
<em> | ||
map[string]string | ||
</em> | ||
</td> | ||
<td> | ||
<p>SpanContext contains tracing span context fields</p> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<h3 id="tekton.dev/v1beta1.PipelineRunTaskRunStatus">PipelineRunTaskRunStatus | ||
|
@@ -13508,6 +13524,17 @@ Provenance | |
<p>Provenance contains some key authenticated metadata about how a software artifact was built (what sources, what inputs/outputs, etc.).</p> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<code>spanContext</code><br/> | ||
<em> | ||
map[string]string | ||
</em> | ||
</td> | ||
<td> | ||
<p>SpanContext contains tracing span context fields</p> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<h3 id="tekton.dev/v1beta1.TaskRunStepOverride">TaskRunStepOverride | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: we could probably extract this in a function to return the object we'll pass to the controller as well as the
defer
function for "cleanly shutdown".There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand. do you mean, to add the error check and return
NoopTracerProvider
from thetracerProvider(service)
method itself?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking something like :
And do all "tracer" related code in there. But it's a nit, I'm happy to keep it as is as well 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It sounds like something we could fix in a follow-up?