Loading
Commits on Source 20
-
Luke Hollinda authored
-
Luke Hollinda authored
Heavily diven by Claude code. To be cut down and refactored in following commits.
-
Luke Hollinda authored
-
Luke Hollinda authored
Aligns with the postgres package on how we handle non-valid server address. Removes the New constructor; which we can reintroduce if and when we need to set up automatic client construction from Fairway / known config locations
-
Luke Hollinda authored
Initial registration and collection of pool metrics. Will require refactoring to more cleanly register these metrics along with attaching the hook required for the command metrics.
-
Luke Hollinda authored
All metrics now use prometheus.BuildFQName with configurable Namespace (default "gitlab") and Subsystem (default "redis"), producing names like gitlab_redis_command_duration_seconds. A "name" constant label is added to all metrics to identify the client instance. Replaces registerOrReuse with registerCollector, which errors on duplicate descriptors rather than silently reusing an existing collector. The previous approach dropped pool stats and merged command metrics across distinct clients. Merges newMetricsHook and registerPoolMetrics into a single newMetrics entry point. Unexports StatGetter and NewPoolCollector as internal implementation details.
-
Luke Hollinda authored
- Updates metric name strings (redis_command_* → gitlab_redis_command_*) - Splits TestMetrics_MultipleClientsSharedRegisterer into two tests: - TestMetrics_DistinctNamesSharedRegisterer — distinct names share a registerer without error - TestMetrics_DuplicateNameSharedRegistererErrors — same name returns an error with the expected message
-
Luke Hollinda authored
Adds 14 fields covering the connection, timeout, pool, and retry parameters that teams commonly need to tune. ClientName is auto-set to cfg.Name so every client is identifiable in CLIENT LIST output without additional configuration.
-
Luke Hollinda authored
-
Luke Hollinda authored
Adds a Logger *slog.Logger field to Config. When set, a loggingHook is registered that emits a structured log entry for every command and pipeline: redis_command, redis_key, redis_duration_ms, and error_message on failures. redis.Nil is not treated as an error. Pipeline executions are logged as a single entry with redis_command="pipeline" and redis_pipeline_size. Errors trigger Warn level; normal completions use Debug. Start and Shutdown log at Info. The client name is baked into a child logger via .With() at construction time so all entries carry it automatically without repeating it at each call site. When Logger is nil, the logging hook is not registered (no per-command overhead). A discard logger is stored on the client so Start and Shutdown can log unconditionally without nil guards.
-
Luke Hollinda authored
-
Luke Hollinda authored
-
Luke Hollinda authored
This avoids logging `redis_key=""` for pipelines and other commands which do not have a redis_key.
-
Luke Hollinda authored
db.system -> db.system.name db.statement -> db.operation.name From: https://opentelemetry.io/docs/specs/semconv/db/redis/
-
Luke Hollinda authored
From https://opentelemetry.io/docs/specs/semconv/db/redis/: > For transactions and pipelined calls, if the individual operations are known to have the same command then that command SHOULD be used prepended by MULTI or PIPELINE . Otherwise db.operation.name SHOULD be MULTI or PIPELINE.
-
Luke Hollinda authored
From https://opentelemetry.io/docs/specs/semconv/db/redis/: > db.operation.batch.size: Operations are only considered batches when they contain two or more operations, and so db.operation.batch.size SHOULD never be 1.
-
Luke Hollinda authored
This commit splits the logic for setting up and registering the pool metrics into their own file. This better shows that the pool metrics are pull metrics which do not depend on the metrics_hook, which is entirely responsible for the per-command metrics.
-
Luke Hollinda authored
Small corrections to documentation and comments
-
Resolved conflict in v2/go.sum: - Kept fairway v1.18.0 hashes (from master, matching go.mod) - Kept gopher-lua v1.1.1 hashes (indirect dep still in go.mod) - Dropped zeebo/xxh3 v1.1.0 (no longer referenced in go.mod) Run go mod tidy
-
Elliot Forbes authored
feat(v2/redis): add instrumented Redis client See merge request !497 Merged-by:
Elliot Forbes <eforbes@gitlab.com>
Approved-by: Alessio Caiazza <code.git@caiazza.info> Approved-by:
Elliot Forbes <eforbes@gitlab.com>
Co-authored-by: Duo Developer <service_account_group_9970_1976e9ecde3c53c783b64edb9ae993eb@noreply.gitlab.com> Co-authored-by:
Luke Hollinda <lhollinda@gitlab.com>