-
Notifications
You must be signed in to change notification settings - Fork 97
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
Added overview of OTEL #2964
Added overview of OTEL #2964
Conversation
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 collects traces and send it to your monitoring system after.
- grpc | ||
- protobuf | ||
``` | ||
Be advised that `blackfire` extension can have a conflict with a `opentelemetry` one, so make sure that you are not using both in the same time. |
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.
what about NewRelic?
### Sampling configuration | ||
Like already mentioned, valued that used for sampling can be changed. In order to do so, you need to change a few env variables. | ||
|
||
`OTEL_BSP_MIN_SPAN_DURATION_THRESHOLD` - this is value that is used in `Closing span sampling` for critical and regular spans. OOTB the value is `20`. This value will be used as nanosecond. |
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 see a natural language description of this parameter.
`OTEL_BSP_MIN_SPAN_DURATION_THRESHOLD` - this is value that is used in `Closing span sampling` for critical and regular spans. OOTB the value is `20`. This value will be used as nanosecond. | |
`OTEL_BSP_MIN_SPAN_DURATION_THRESHOLD` - this is value that is used in `Closing span sampling` for critical and regular spans. OOTB the value is `20`. This value will be used as nanosecond. |
`OTEL_BSP_MIN_SPAN_DURATION_THRESHOLD` - this is value that is used in `Closing span sampling` for critical and regular spans. OOTB the value is `20`. This value will be used as nanosecond. | ||
`OTEL_BSP_MIN_CRITICAL_SPAN_DURATION_THRESHOLD` - this is similar value to `OTEL_BSP_MIN_SPAN_DURATION_THRESHOLD` one, but used for non critical spans. Default value is `10`. | ||
`OTEL_TRACES_SAMPLER_ARG` - this is a probability for `Opening span sampling` and is used for the regular spans. Default value is `0.3`. | ||
`OTEL_TRACES_CRITICAL_SAMPLER_ARG` - same as a previous one, but for critical spans. Default value is `0.5`. |
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.
same here, Is higher probability leading to more spans tracked?
`OTEL_TRACES_SAMPLER_ARG` - this is a probability for `Opening span sampling` and is used for the regular spans. Default value is `0.3`. | ||
`OTEL_TRACES_CRITICAL_SAMPLER_ARG` - same as a previous one, but for critical spans. Default value is `0.5`. | ||
`OTEL_TRACES_NON_CRITICAL_SAMPLER_ARG` - same as a previous one, but for non critical spans. Default value is `0.1`. | ||
`OTEL_TRACE_PROBABILITY` - is a probability for the `Tracing sampling`. Default value is `0.1`. |
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 told that all traces are tracked. What does this sampling here mean?
How does it combine with the sampler probabilities?
`OTEL_TRACES_NON_CRITICAL_SAMPLER_ARG` - same as a previous one, but for non critical spans. Default value is `0.1`. | ||
`OTEL_TRACE_PROBABILITY` - is a probability for the `Tracing sampling`. Default value is `0.1`. | ||
|
||
Increasing those values will make your traces bigger, but also can slow down your application as more spans will be generated and send to the collector. |
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.
When can it slow down?
Can we monitor the degradation?
|
||
### Additional configuration | ||
`OTEL_SERVICE_NAMESPACE` - defines a namespace that is shown in the resource attributes of trace. Default value is `spryker`. | ||
`OTEL_EXPORTER_OTLP_ENDPOINT` - defines a collector endpoint. Should be configured for your project as it varies from setup to setup. Default value is `http://collector:4317`. |
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.
There's a not clear path of this value being set by the project. Please check with Cloud team.
|
||
## Error handling | ||
|
||
You are definitely want to track all possible errors during the execution. OOTB OpenTelemetry integration will catch all exceptions that were thrown during span execution. But there are possibility that error can be lost if part of your code was not covered with hooks, or spans were sampled out, or trace was marked as not detailed. |
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.
You are definitely want to track all possible errors during the execution. OOTB OpenTelemetry integration will catch all exceptions that were thrown during span execution. But there are possibility that error can be lost if part of your code was not covered with hooks, or spans were sampled out, or trace was marked as not detailed. | |
You are definitely want to track all possible errors during the execution. OOTB OpenTelemetry integration will catch all exceptions that were thrown during span execution. But there is a possibility that error is lost if part of your code was not covered with hooks, or spans were sampled out, or trace was marked as not detailed. |
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.
@gechetspr is it possible to have a configuration that makes sure that ALL exceptions are attached to the root span, no matter what.
title: OpenTelemetry overview | ||
description: Describing what is OpenTelemetry and how Spryker integrates it in the SCCOS | ||
template: howto-guide-template | ||
last_updated: Dec 5, 2024 |
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.
last_updated: Dec 5, 2024 | |
last_updated: Jan 21, 2025 |
|
||
### Wire a console command | ||
|
||
Spryker is a big application, so you definitely doesn't want to prepare all hooks manually. Console command *OpentelemetryGeneratorConsole* is used to generate those hooks automatically for classes that you want to be covered with spans. |
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.
Spryker is a big application, so you definitely doesn't want to prepare all hooks manually. Console command *OpentelemetryGeneratorConsole* is used to generate those hooks automatically for classes that you want to be covered with spans. | |
Spryker is a big application, so you definitely don't want to create all hooks manually. Console command class *OpentelemetryGeneratorConsole* is used to generate those hooks automatically for classes that you want to cover with spans. |
|
||
``` | ||
|
||
You have to wire this console command into your install script, so it's executed on every deployment. |
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.
You have to wire this console command into your install script, so it's executed on every deployment. | |
You have to wire this console command into your install script, so it's executed on every deployment during base container image build. We recommend placing it as the last one in the section **build**. |
|
||
} | ||
``` | ||
|
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.
Please get yourself familiar with the predefined configuration of this module in the vendor folder. Based on our research, some Core classes are excluded from instrumentation. |
} | ||
``` | ||
|
||
### Enable PHP extension |
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.
### Enable PHP extension | |
### Enable PHP extensions |
|
||
### Enable PHP extension | ||
|
||
Hooks processing requires you to have a few PHP extensions in place. Spryker has prepared a new PHP image, so you need to install nothing, but just enable it in your deploy file. |
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.
Hooks processing requires you to have a few PHP extensions in place. Spryker has prepared a new PHP image, so you need to install nothing, but just enable it in your deploy file. | |
Hooks processing requires you to have a few PHP extensions in place. Spryker has prepared a new PHP image, so you need to install nothing, just enable them in your deploy file. |
- grpc | ||
- protobuf | ||
``` | ||
Be advised that `blackfire` extension can have a conflict with a `opentelemetry` one, so make sure that you are not using both in the same time. We also would not recommend to run it together with a `newrelic` one. |
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.
Let's be more helpful here.
Blackfire can have conflicts - how is this visible if still both are enabled?
Is there an option how to add a switcher?
related: | ||
--- | ||
|
||
Spryker allows to integrate different monitoring tools like NewRelic into the SCCOS. But usually those tools are vendor locked and allows to work only with limited amount of backends or have not so much customizability options. |
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 know where, but let's add a mention, similar to the following
OTel is a paid service and requires additional contract with Spryker, please talk to our Sales Team.
…ker/spryker-docs into feature/opentelemetry-documentation
PR Description
Add a meaningful description here that will let us know what you want to fix with this PR or what functionality you want to add.
Steps before you submit a PR
contribution-license-agreement.txt
file with the following content:I hereby agree to Spryker\'s Contribution License Agreement in https://github.com/spryker/spryker-docs/blob/HASH_OF_COMMIT_YOU_ARE_BASING_YOUR_BRANCH_FROM_MASTER_BRANCH/CONTRIBUTING.md.
This is a mandatory step to make sure you are aware of the license agreement and agree to it.
HASH_OF_COMMIT_YOU_ARE_BASING_YOUR_BRANCH_FROM_MASTER_BRANCH
is a hash of the commit you are basing your branch from the master branch. You can take it from commits list of master branch before you submit a PR.Checklist