Skip to content

Conversation

@vladvildanov
Copy link
Collaborator

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:

  • Do tests and lints pass with this change?
  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Is there an example added to the examples folder (if applicable)?

NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.

return attrs

@staticmethod
def build_connection_pool_attributes(
Copy link
Collaborator

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,
Copy link
Collaborator

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,
Copy link
Collaborator

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"
Copy link
Collaborator

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)
Copy link
Collaborator

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
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants