Skip to content

Commit

Permalink
chore: Remove unused code and TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
mantzas committed Jun 23, 2024
1 parent 5cbc6bd commit 887bddc
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 18 deletions.
2 changes: 0 additions & 2 deletions client/es/elasticsearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import (
"github.com/elastic/go-elasticsearch/v8"
)

// TODO: Metrics are not supported yet.

// New creates a new elasticsearch client with tracing capabilities.
func New(cfg elasticsearch.Config, version string) (*elasticsearch.Client, error) {
cfg.Instrumentation = elastictransport.NewOtelInstrumentation(nil, false, version)
Expand Down
7 changes: 0 additions & 7 deletions client/es/elasticsearch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,4 @@ func TestNew(t *testing.T) {
// Traces
assert.NoError(t, tracePublisher.ForceFlush(context.Background()))
assert.Len(t, exp.GetSpans(), 1)

// TODO: Support metrics first.
// // Metrics
// collectedMetrics := &metricdata.ResourceMetrics{}
// assert.NoError(t, read.Collect(context.Background(), collectedMetrics))
// assert.Equal(t, 1, len(collectedMetrics.ScopeMetrics))
// assert.Equal(t, 1, len(collectedMetrics.ScopeMetrics[0].Metrics))
}
1 change: 0 additions & 1 deletion client/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ func New(oo ...OptionFunc) (*TracedClient, error) {

// Do execute an HTTP request with integrated tracing and tracing propagation downstream.
func (tc *TracedClient) Do(req *http.Request) (*http.Response, error) {
// TODO: do we need this still?
req.Header.Set(correlation.HeaderID, correlation.IDFromContext(req.Context()))

rsp, err := tc.do(req)
Expand Down
3 changes: 0 additions & 3 deletions client/http/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ func TestTracedClient_Do(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, rsp)
}
// TODO: test tracing/metrics
// assert.Equal(t, tt.wantCounter, testutil.CollectAndCount(reqDurationMetrics, "client_http_request_duration_seconds"))
// reqDurationMetrics.Reset()
})
}
}
Expand Down
1 change: 0 additions & 1 deletion component/http/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ func New(oo ...OptionFunc) (*http.ServeMux, error) {
var stdRoutes []*patronhttp.Route

mux := http.NewServeMux()
// TODO: Introduce metrics route???
stdRoutes = append(stdRoutes, patronhttp.ProfilingRoutes(cfg.enableProfilingExpVar)...)

route, err := patronhttp.LivenessCheckRoute(cfg.aliveCheckFunc)
Expand Down
2 changes: 0 additions & 2 deletions correlation/correlation.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
"github.com/google/uuid"
)

// TODO: Do we need this with opentelemetry? Merge with observability package?

const (
// HeaderID constant.
HeaderID string = "X-Correlation-Id"
Expand Down
2 changes: 0 additions & 2 deletions reliability/circuitbreaker/breaker.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ var (
statusCounter metric.Int64Counter
)

// TODO: Metrics move to OpenTelemetry.

func init() {
var err error
statusCounter, err = otel.Meter("circuitbreaker").Int64Counter("circuitbreaker.status",
Expand Down

0 comments on commit 887bddc

Please sign in to comment.