oskoperator / oskoperator/osko

isPrometheusSource duplicates the backend type list

Open Beginner friendly
#156 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

chore
Dominant language
Go
Stars
20
Forks
3
Avg merge
44m
Merged PRs (30d)
7

Description

isPrometheusSource (internal/helpers/prometheus_helper.go:318) switches over prometheus, mimir, cortex, victoriametrics, thanos — the same five values internal/backend.Parse already owns.

The lists are identical today but independent, so a sixth backend gets silently supported in one place and not the other. ADR 0008 introduced internal/backend specifically to remove this kind of scattered string comparison.

The fields differ (SLI.metricSource.type vs Datasource.spec.type), so this wants a deliberate decision rather than a blind swap. The obvious shape is _, err := backend.Parse(s); return err == nil.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare isPrometheusSource at internal/helpers/prometheus_helper.go:318 with internal/backend.Parse, then read ADR 0008 for the intended ownership of backend types. Decide how the differing SLI.metricSource.type and Datasource.spec.type fields should be handled; done means the backend list has one source of truth without changing valid field semantics.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, prometheus
Domain
backend, observability
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.