-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Added intrastructure and integration point with OTel #3864
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
base: feat/observability
Are you sure you want to change the base?
Conversation
| return attrs | ||
|
|
||
| @staticmethod | ||
| def build_connection_pool_attributes( |
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.
Having in mind that this is for the connection pool, not for a concrete connection, connection_state and is_pubsub seem strange - they are specific per connection.
| def __init__( | ||
| self, | ||
| # Core enablement | ||
| enabled_telemetry: List[TelemetryOption] = None, |
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.
The List is Optional
| enabled_telemetry: List[TelemetryOption] = None, | ||
| # Metrics-specific | ||
| metrics_sample_percentage: float = 100.0, | ||
| metric_groups: List[MetricGroup] = None, |
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.
Optional
| from opentelemetry.metrics import NoOpMeterProvider | ||
| except ImportError: | ||
| raise ImportError( | ||
| "OpenTelemetry is not installed. Install it with:\n" |
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.
Those libs can be added in the toml file as optional dependencies
| if enabled_telemetry is None: | ||
| self.enabled_telemetry = self.DEFAULT_TELEMETRY | ||
| else: | ||
| self.enabled_telemetry = TelemetryOption(0) |
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.
We have to somehow use the input values. This way the user might configure a list of options and to expect that they should be working. I believe here the provided list should be checked and if invalid ot not yet supported options are provided - an error should be either logged or raised.
| import pytest | ||
| from unittest.mock import MagicMock, patch | ||
|
|
||
| from redis.observability import recorder |
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 the new otel dependencies added to the dev-dependencies list - aren't they needed for the successful test execution?
Description of change
Please provide a description of the change here.
Pull Request check-list
Please make sure to review and check all of these items:
NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.