cleanup: Remove Opentracing support as no active users (#2196)

References:
[1] #2193
[2] https://fissionio.slack.com/archives/C3LUX6BBP/p1631706812069300

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
Sanket Sudake
2022-07-12 14:52:17 +05:30
committed by GitHub
parent 7838debadf
commit 899e6e96d6
35 changed files with 66 additions and 321 deletions
+1 -8
View File
@@ -29,12 +29,10 @@ import (
"strings"
"github.com/pkg/errors"
"go.opencensus.io/plugin/ochttp"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
"golang.org/x/net/context/ctxhttp"
"github.com/fission/fission/pkg/storagesvc"
"github.com/fission/fission/pkg/utils/tracing"
)
type (
@@ -46,12 +44,7 @@ type (
// Client creates a storage service client.
func MakeClient(url string) *Client {
var hc *http.Client
if tracing.TracingEnabled(nil) {
hc = &http.Client{Transport: &ochttp.Transport{}}
} else {
hc = &http.Client{Transport: otelhttp.NewTransport(http.DefaultTransport)}
}
hc := &http.Client{Transport: otelhttp.NewTransport(http.DefaultTransport)}
return &Client{
url: strings.TrimSuffix(url, "/") + "/v1",
httpClient: hc,
+2 -2
View File
@@ -138,7 +138,7 @@ func TestS3StorageService(t *testing.T) {
storage := storagesvc.NewS3Storage()
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
_ = storagesvc.Start(ctx, logger, storage, port, true)
_ = storagesvc.Start(ctx, logger, storage, port)
time.Sleep(time.Second)
client := MakeClient(fmt.Sprintf("http://localhost:%v/", 8081))
@@ -216,7 +216,7 @@ func TestLocalStorageService(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
os.Setenv("METRICS_ADDR", "8083")
_ = storagesvc.Start(ctx, logger, storage, port, true)
_ = storagesvc.Start(ctx, logger, storage, port)
time.Sleep(time.Second)
client := MakeClient(fmt.Sprintf("http://localhost:%v/", port))
+4 -12
View File
@@ -28,7 +28,6 @@ import (
"github.com/gorilla/mux"
"github.com/graymeta/stow"
"github.com/pkg/errors"
"go.opencensus.io/plugin/ochttp"
"go.uber.org/zap"
"github.com/fission/fission/pkg/utils/httpserver"
@@ -262,7 +261,7 @@ func MakeStorageService(logger *zap.Logger, storageClient *StowClient, port int)
}
}
func (ss *StorageService) Start(ctx context.Context, port int, openTracingEnabled bool) {
func (ss *StorageService) Start(ctx context.Context, port int) {
r := mux.NewRouter()
r.Use(metrics.HTTPMetricMiddleware)
r.HandleFunc("/v1/archive", ss.uploadHandler).Methods("POST")
@@ -272,19 +271,12 @@ func (ss *StorageService) Start(ctx context.Context, port int, openTracingEnable
r.HandleFunc("/v1/archive", ss.infoHandler).Methods("HEAD")
r.HandleFunc("/healthz", ss.healthHandler).Methods("GET")
var handler http.Handler
if openTracingEnabled {
handler = &ochttp.Handler{
Handler: r,
}
} else {
handler = otel.GetHandlerWithOTEL(r, "fission-storagesvc", otel.UrlsToIgnore("/healthz"))
}
handler := otel.GetHandlerWithOTEL(r, "fission-storagesvc", otel.UrlsToIgnore("/healthz"))
httpserver.StartServer(ctx, ss.logger, "storagesvc", fmt.Sprintf("%d", port), handler)
}
// Start runs storage service
func Start(ctx context.Context, logger *zap.Logger, storage Storage, port int, openTracingEnabled bool) error {
func Start(ctx context.Context, logger *zap.Logger, storage Storage, port int) error {
enablePruner, err := strconv.ParseBool(os.Getenv("PRUNE_ENABLED"))
if err != nil {
logger.Warn("PRUNE_ENABLED value not set. Enabling archive pruner by default.", zap.Error(err))
@@ -299,7 +291,7 @@ func Start(ctx context.Context, logger *zap.Logger, storage Storage, port int, o
// create http handlers
storageService := MakeStorageService(logger, storageClient, port)
go metrics.ServeMetrics(ctx, logger)
go storageService.Start(ctx, port, openTracingEnabled)
go storageService.Start(ctx, port)
// enablePruner prevents storagesvc unit test from needing to talk to kubernetes
if enablePruner {