From c84dcfe4b6eae18dee52f64f9cbfaef3114af425 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 29 Nov 2024 01:07:36 +0000 Subject: [PATCH 1/2] chore(deps): bump github.com/ogen-go/ogen from 1.6.0 to 1.7.0 Bumps [github.com/ogen-go/ogen](https://github.com/ogen-go/ogen) from 1.6.0 to 1.7.0. - [Release notes](https://github.com/ogen-go/ogen/releases) - [Commits](https://github.com/ogen-go/ogen/compare/v1.6.0...v1.7.0) --- updated-dependencies: - dependency-name: github.com/ogen-go/ogen dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index e600dacd..f2e6b293 100644 --- a/go.mod +++ b/go.mod @@ -32,7 +32,7 @@ require ( github.com/klauspost/compress v1.17.11 github.com/kr/logfmt v0.0.0-20210122060352-19f9bcb100e6 github.com/mattn/go-isatty v0.0.20 - github.com/ogen-go/ogen v1.6.0 + github.com/ogen-go/ogen v1.7.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.114.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.114.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/metricstransformprocessor v0.114.0 diff --git a/go.sum b/go.sum index 91b7340b..82cb6a5e 100644 --- a/go.sum +++ b/go.sum @@ -517,8 +517,8 @@ github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+ github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/npillmayer/nestext v0.1.3/go.mod h1:h2lrijH8jpicr25dFY+oAJLyzlya6jhnuG+zWp9L0Uk= -github.com/ogen-go/ogen v1.6.0 h1:5pwTvLdJHVz7MhTHvrcoaQePROXyJnuY5ECcC+GZDrA= -github.com/ogen-go/ogen v1.6.0/go.mod h1:Y+ZYfR1bKmEQBSdxblRtMRsf8Fk/ExskKc4dZNW+hZ0= +github.com/ogen-go/ogen v1.7.0 h1:EBk0JoVpPaWaWJ6VZoQeuuLNDzufdMJsWJr35su5QnI= +github.com/ogen-go/ogen v1.7.0/go.mod h1:2ShRm6u/nXUHuwdVKv2SeaG8enBKPKAE3kSbHwwFh6o= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= From 998d0325202c62fcf79e910db13a01db9e533866 Mon Sep 17 00:00:00 2001 From: tdakkota Date: Fri, 29 Nov 2024 07:00:50 +0300 Subject: [PATCH 2/2] chore: commit generated files --- internal/lokiapi/oas_client_gen.go | 14 ++-- internal/lokiapi/oas_handlers_gen.go | 42 +++++------ internal/lokiapi/oas_operations_gen.go | 16 +++++ internal/lokiapi/oas_router_gen.go | 14 ++-- internal/otelbotapi/oas_client_gen.go | 10 +-- internal/otelbotapi/oas_handlers_gen.go | 20 +++--- internal/otelbotapi/oas_operations_gen.go | 12 ++++ internal/otelbotapi/oas_router_gen.go | 6 +- internal/otelbotapi/oas_security_gen.go | 8 +-- internal/promapi/oas_client_gen.go | 26 +++---- internal/promapi/oas_handlers_gen.go | 78 ++++++++++----------- internal/promapi/oas_operations_gen.go | 22 ++++++ internal/promapi/oas_router_gen.go | 26 +++---- internal/pyroscopeapi/oas_client_gen.go | 10 +-- internal/pyroscopeapi/oas_handlers_gen.go | 28 ++++---- internal/pyroscopeapi/oas_operations_gen.go | 14 ++++ internal/pyroscopeapi/oas_router_gen.go | 10 +-- internal/sentryapi/oas_client_gen.go | 4 +- internal/sentryapi/oas_handlers_gen.go | 10 +-- internal/sentryapi/oas_operations_gen.go | 11 +++ internal/sentryapi/oas_router_gen.go | 4 +- internal/tempoapi/oas_client_gen.go | 16 ++--- internal/tempoapi/oas_handlers_gen.go | 44 ++++++------ internal/tempoapi/oas_operations_gen.go | 17 +++++ internal/tempoapi/oas_router_gen.go | 16 ++--- 25 files changed, 285 insertions(+), 193 deletions(-) create mode 100644 internal/lokiapi/oas_operations_gen.go create mode 100644 internal/otelbotapi/oas_operations_gen.go create mode 100644 internal/promapi/oas_operations_gen.go create mode 100644 internal/pyroscopeapi/oas_operations_gen.go create mode 100644 internal/sentryapi/oas_operations_gen.go create mode 100644 internal/tempoapi/oas_operations_gen.go diff --git a/internal/lokiapi/oas_client_gen.go b/internal/lokiapi/oas_client_gen.go index 62942895..69798758 100644 --- a/internal/lokiapi/oas_client_gen.go +++ b/internal/lokiapi/oas_client_gen.go @@ -149,7 +149,7 @@ func (c *Client) sendIndexStats(ctx context.Context, params IndexStatsParams) (r c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "IndexStats", + ctx, span := c.cfg.Tracer.Start(ctx, IndexStatsOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -279,7 +279,7 @@ func (c *Client) sendLabelValues(ctx context.Context, params LabelValuesParams) c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "LabelValues", + ctx, span := c.cfg.Tracer.Start(ctx, LabelValuesOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -452,7 +452,7 @@ func (c *Client) sendLabels(ctx context.Context, params LabelsParams) (res *Labe c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "Labels", + ctx, span := c.cfg.Tracer.Start(ctx, LabelsOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -588,7 +588,7 @@ func (c *Client) sendPush(ctx context.Context, request PushReq) (res *PushNoCont c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "Push", + ctx, span := c.cfg.Tracer.Start(ctx, PushOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -663,7 +663,7 @@ func (c *Client) sendQuery(ctx context.Context, params QueryParams) (res *QueryR c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "Query", + ctx, span := c.cfg.Tracer.Start(ctx, QueryOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -807,7 +807,7 @@ func (c *Client) sendQueryRange(ctx context.Context, params QueryRangeParams) (r c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "QueryRange", + ctx, span := c.cfg.Tracer.Start(ctx, QueryRangeOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -1011,7 +1011,7 @@ func (c *Client) sendSeries(ctx context.Context, params SeriesParams) (res *Maps c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "Series", + ctx, span := c.cfg.Tracer.Start(ctx, SeriesOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) diff --git a/internal/lokiapi/oas_handlers_gen.go b/internal/lokiapi/oas_handlers_gen.go index 96181021..e8f20b49 100644 --- a/internal/lokiapi/oas_handlers_gen.go +++ b/internal/lokiapi/oas_handlers_gen.go @@ -33,7 +33,7 @@ func (s *Server) handleIndexStatsRequest(args [0]string, argsEscaped bool, w htt } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "IndexStats", + ctx, span := s.cfg.Tracer.Start(r.Context(), IndexStatsOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -64,7 +64,7 @@ func (s *Server) handleIndexStatsRequest(args [0]string, argsEscaped bool, w htt } err error opErrContext = ogenerrors.OperationContext{ - Name: "IndexStats", + Name: IndexStatsOperation, ID: "indexStats", } ) @@ -83,7 +83,7 @@ func (s *Server) handleIndexStatsRequest(args [0]string, argsEscaped bool, w htt if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "IndexStats", + OperationName: IndexStatsOperation, OperationSummary: "", OperationID: "indexStats", Body: nil, @@ -164,7 +164,7 @@ func (s *Server) handleLabelValuesRequest(args [1]string, argsEscaped bool, w ht } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "LabelValues", + ctx, span := s.cfg.Tracer.Start(r.Context(), LabelValuesOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -195,7 +195,7 @@ func (s *Server) handleLabelValuesRequest(args [1]string, argsEscaped bool, w ht } err error opErrContext = ogenerrors.OperationContext{ - Name: "LabelValues", + Name: LabelValuesOperation, ID: "labelValues", } ) @@ -214,7 +214,7 @@ func (s *Server) handleLabelValuesRequest(args [1]string, argsEscaped bool, w ht if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "LabelValues", + OperationName: LabelValuesOperation, OperationSummary: "", OperationID: "labelValues", Body: nil, @@ -304,7 +304,7 @@ func (s *Server) handleLabelsRequest(args [0]string, argsEscaped bool, w http.Re } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "Labels", + ctx, span := s.cfg.Tracer.Start(r.Context(), LabelsOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -335,7 +335,7 @@ func (s *Server) handleLabelsRequest(args [0]string, argsEscaped bool, w http.Re } err error opErrContext = ogenerrors.OperationContext{ - Name: "Labels", + Name: LabelsOperation, ID: "labels", } ) @@ -354,7 +354,7 @@ func (s *Server) handleLabelsRequest(args [0]string, argsEscaped bool, w http.Re if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "Labels", + OperationName: LabelsOperation, OperationSummary: "", OperationID: "labels", Body: nil, @@ -435,7 +435,7 @@ func (s *Server) handlePushRequest(args [0]string, argsEscaped bool, w http.Resp } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "Push", + ctx, span := s.cfg.Tracer.Start(r.Context(), PushOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -466,7 +466,7 @@ func (s *Server) handlePushRequest(args [0]string, argsEscaped bool, w http.Resp } err error opErrContext = ogenerrors.OperationContext{ - Name: "Push", + Name: PushOperation, ID: "push", } ) @@ -490,7 +490,7 @@ func (s *Server) handlePushRequest(args [0]string, argsEscaped bool, w http.Resp if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "Push", + OperationName: PushOperation, OperationSummary: "", OperationID: "push", Body: request, @@ -558,7 +558,7 @@ func (s *Server) handleQueryRequest(args [0]string, argsEscaped bool, w http.Res } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "Query", + ctx, span := s.cfg.Tracer.Start(r.Context(), QueryOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -589,7 +589,7 @@ func (s *Server) handleQueryRequest(args [0]string, argsEscaped bool, w http.Res } err error opErrContext = ogenerrors.OperationContext{ - Name: "Query", + Name: QueryOperation, ID: "query", } ) @@ -608,7 +608,7 @@ func (s *Server) handleQueryRequest(args [0]string, argsEscaped bool, w http.Res if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "Query", + OperationName: QueryOperation, OperationSummary: "", OperationID: "query", Body: nil, @@ -693,7 +693,7 @@ func (s *Server) handleQueryRangeRequest(args [0]string, argsEscaped bool, w htt } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "QueryRange", + ctx, span := s.cfg.Tracer.Start(r.Context(), QueryRangeOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -724,7 +724,7 @@ func (s *Server) handleQueryRangeRequest(args [0]string, argsEscaped bool, w htt } err error opErrContext = ogenerrors.OperationContext{ - Name: "QueryRange", + Name: QueryRangeOperation, ID: "queryRange", } ) @@ -743,7 +743,7 @@ func (s *Server) handleQueryRangeRequest(args [0]string, argsEscaped bool, w htt if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "QueryRange", + OperationName: QueryRangeOperation, OperationSummary: "", OperationID: "queryRange", Body: nil, @@ -840,7 +840,7 @@ func (s *Server) handleSeriesRequest(args [0]string, argsEscaped bool, w http.Re } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "Series", + ctx, span := s.cfg.Tracer.Start(r.Context(), SeriesOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -871,7 +871,7 @@ func (s *Server) handleSeriesRequest(args [0]string, argsEscaped bool, w http.Re } err error opErrContext = ogenerrors.OperationContext{ - Name: "Series", + Name: SeriesOperation, ID: "series", } ) @@ -890,7 +890,7 @@ func (s *Server) handleSeriesRequest(args [0]string, argsEscaped bool, w http.Re if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "Series", + OperationName: SeriesOperation, OperationSummary: "", OperationID: "series", Body: nil, diff --git a/internal/lokiapi/oas_operations_gen.go b/internal/lokiapi/oas_operations_gen.go new file mode 100644 index 00000000..a784d0ae --- /dev/null +++ b/internal/lokiapi/oas_operations_gen.go @@ -0,0 +1,16 @@ +// Code generated by ogen, DO NOT EDIT. + +package lokiapi + +// OperationName is the ogen operation name +type OperationName = string + +const ( + IndexStatsOperation OperationName = "IndexStats" + LabelValuesOperation OperationName = "LabelValues" + LabelsOperation OperationName = "Labels" + PushOperation OperationName = "Push" + QueryOperation OperationName = "Query" + QueryRangeOperation OperationName = "QueryRange" + SeriesOperation OperationName = "Series" +) diff --git a/internal/lokiapi/oas_router_gen.go b/internal/lokiapi/oas_router_gen.go index da53a967..ac58add1 100644 --- a/internal/lokiapi/oas_router_gen.go +++ b/internal/lokiapi/oas_router_gen.go @@ -357,7 +357,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "GET": - r.name = "IndexStats" + r.name = IndexStatsOperation r.summary = "" r.operationID = "indexStats" r.pathPattern = "/loki/api/v1/index/stats" @@ -415,7 +415,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "GET": - r.name = "LabelValues" + r.name = LabelValuesOperation r.summary = "" r.operationID = "labelValues" r.pathPattern = "/loki/api/v1/label/{name}/values" @@ -443,7 +443,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "GET": - r.name = "Labels" + r.name = LabelsOperation r.summary = "" r.operationID = "labels" r.pathPattern = "/loki/api/v1/labels" @@ -471,7 +471,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "POST": - r.name = "Push" + r.name = PushOperation r.summary = "" r.operationID = "push" r.pathPattern = "/loki/api/v1/push" @@ -495,7 +495,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { if len(elem) == 0 { switch method { case "GET": - r.name = "Query" + r.name = QueryOperation r.summary = "" r.operationID = "query" r.pathPattern = "/loki/api/v1/query" @@ -519,7 +519,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "GET": - r.name = "QueryRange" + r.name = QueryRangeOperation r.summary = "" r.operationID = "queryRange" r.pathPattern = "/loki/api/v1/query_range" @@ -547,7 +547,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "GET": - r.name = "Series" + r.name = SeriesOperation r.summary = "" r.operationID = "series" r.pathPattern = "/loki/api/v1/series" diff --git a/internal/otelbotapi/oas_client_gen.go b/internal/otelbotapi/oas_client_gen.go index 4cbdddbb..8374633b 100644 --- a/internal/otelbotapi/oas_client_gen.go +++ b/internal/otelbotapi/oas_client_gen.go @@ -124,7 +124,7 @@ func (c *Client) sendGetStatus(ctx context.Context) (res *GetStatusOK, err error c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "GetStatus", + ctx, span := c.cfg.Tracer.Start(ctx, GetStatusOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -156,7 +156,7 @@ func (c *Client) sendGetStatus(ctx context.Context) (res *GetStatusOK, err error var satisfied bitset { stage = "Security:TokenAuth" - switch err := c.securityTokenAuth(ctx, "GetStatus", r); { + switch err := c.securityTokenAuth(ctx, GetStatusOperation, r); { case err == nil: // if NO error satisfied[0] |= 1 << 0 case errors.Is(err, ogenerrors.ErrSkipClientSecurity): @@ -227,7 +227,7 @@ func (c *Client) sendPing(ctx context.Context) (res *PingNoContent, err error) { c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "Ping", + ctx, span := c.cfg.Tracer.Start(ctx, PingOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -299,7 +299,7 @@ func (c *Client) sendSubmitReport(ctx context.Context, request *SubmitReportReq) c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "SubmitReport", + ctx, span := c.cfg.Tracer.Start(ctx, SubmitReportOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -334,7 +334,7 @@ func (c *Client) sendSubmitReport(ctx context.Context, request *SubmitReportReq) var satisfied bitset { stage = "Security:TokenAuth" - switch err := c.securityTokenAuth(ctx, "SubmitReport", r); { + switch err := c.securityTokenAuth(ctx, SubmitReportOperation, r); { case err == nil: // if NO error satisfied[0] |= 1 << 0 case errors.Is(err, ogenerrors.ErrSkipClientSecurity): diff --git a/internal/otelbotapi/oas_handlers_gen.go b/internal/otelbotapi/oas_handlers_gen.go index 8289d1e2..de506232 100644 --- a/internal/otelbotapi/oas_handlers_gen.go +++ b/internal/otelbotapi/oas_handlers_gen.go @@ -33,7 +33,7 @@ func (s *Server) handleGetStatusRequest(args [0]string, argsEscaped bool, w http } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "GetStatus", + ctx, span := s.cfg.Tracer.Start(r.Context(), GetStatusOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -64,7 +64,7 @@ func (s *Server) handleGetStatusRequest(args [0]string, argsEscaped bool, w http } err error opErrContext = ogenerrors.OperationContext{ - Name: "GetStatus", + Name: GetStatusOperation, ID: "getStatus", } ) @@ -72,7 +72,7 @@ func (s *Server) handleGetStatusRequest(args [0]string, argsEscaped bool, w http type bitset = [1]uint8 var satisfied bitset { - sctx, ok, err := s.securityTokenAuth(ctx, "GetStatus", r) + sctx, ok, err := s.securityTokenAuth(ctx, GetStatusOperation, r) if err != nil { err = &ogenerrors.SecurityError{ OperationContext: opErrContext, @@ -119,7 +119,7 @@ func (s *Server) handleGetStatusRequest(args [0]string, argsEscaped bool, w http if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "GetStatus", + OperationName: GetStatusOperation, OperationSummary: "", OperationID: "getStatus", Body: nil, @@ -185,7 +185,7 @@ func (s *Server) handlePingRequest(args [0]string, argsEscaped bool, w http.Resp } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "Ping", + ctx, span := s.cfg.Tracer.Start(r.Context(), PingOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -221,7 +221,7 @@ func (s *Server) handlePingRequest(args [0]string, argsEscaped bool, w http.Resp if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "Ping", + OperationName: PingOperation, OperationSummary: "", OperationID: "ping", Body: nil, @@ -289,7 +289,7 @@ func (s *Server) handleSubmitReportRequest(args [0]string, argsEscaped bool, w h } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "SubmitReport", + ctx, span := s.cfg.Tracer.Start(r.Context(), SubmitReportOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -320,7 +320,7 @@ func (s *Server) handleSubmitReportRequest(args [0]string, argsEscaped bool, w h } err error opErrContext = ogenerrors.OperationContext{ - Name: "SubmitReport", + Name: SubmitReportOperation, ID: "submitReport", } ) @@ -328,7 +328,7 @@ func (s *Server) handleSubmitReportRequest(args [0]string, argsEscaped bool, w h type bitset = [1]uint8 var satisfied bitset { - sctx, ok, err := s.securityTokenAuth(ctx, "SubmitReport", r) + sctx, ok, err := s.securityTokenAuth(ctx, SubmitReportOperation, r) if err != nil { err = &ogenerrors.SecurityError{ OperationContext: opErrContext, @@ -390,7 +390,7 @@ func (s *Server) handleSubmitReportRequest(args [0]string, argsEscaped bool, w h if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "SubmitReport", + OperationName: SubmitReportOperation, OperationSummary: "", OperationID: "submitReport", Body: request, diff --git a/internal/otelbotapi/oas_operations_gen.go b/internal/otelbotapi/oas_operations_gen.go new file mode 100644 index 00000000..d2b4b02b --- /dev/null +++ b/internal/otelbotapi/oas_operations_gen.go @@ -0,0 +1,12 @@ +// Code generated by ogen, DO NOT EDIT. + +package otelbotapi + +// OperationName is the ogen operation name +type OperationName = string + +const ( + GetStatusOperation OperationName = "GetStatus" + PingOperation OperationName = "Ping" + SubmitReportOperation OperationName = "SubmitReport" +) diff --git a/internal/otelbotapi/oas_router_gen.go b/internal/otelbotapi/oas_router_gen.go index f38b7065..269cbffd 100644 --- a/internal/otelbotapi/oas_router_gen.go +++ b/internal/otelbotapi/oas_router_gen.go @@ -230,7 +230,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "GET": - r.name = "Ping" + r.name = PingOperation r.summary = "" r.operationID = "ping" r.pathPattern = "/ping" @@ -255,7 +255,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "POST": - r.name = "SubmitReport" + r.name = SubmitReportOperation r.summary = "" r.operationID = "submitReport" r.pathPattern = "/report/submit" @@ -280,7 +280,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "GET": - r.name = "GetStatus" + r.name = GetStatusOperation r.summary = "" r.operationID = "getStatus" r.pathPattern = "/status" diff --git a/internal/otelbotapi/oas_security_gen.go b/internal/otelbotapi/oas_security_gen.go index 19e9d9c8..0d7fb37a 100644 --- a/internal/otelbotapi/oas_security_gen.go +++ b/internal/otelbotapi/oas_security_gen.go @@ -16,7 +16,7 @@ import ( type SecurityHandler interface { // HandleTokenAuth handles tokenAuth security. // Contains GITHUB_TOKEN, like `${{ secrets.GITHUB_TOKEN }}`. - HandleTokenAuth(ctx context.Context, operationName string, t TokenAuth) (context.Context, error) + HandleTokenAuth(ctx context.Context, operationName OperationName, t TokenAuth) (context.Context, error) } func findAuthorization(h http.Header, prefix string) (string, bool) { @@ -34,7 +34,7 @@ func findAuthorization(h http.Header, prefix string) (string, bool) { return "", false } -func (s *Server) securityTokenAuth(ctx context.Context, operationName string, req *http.Request) (context.Context, bool, error) { +func (s *Server) securityTokenAuth(ctx context.Context, operationName OperationName, req *http.Request) (context.Context, bool, error) { var t TokenAuth const parameterName = "token" value := req.Header.Get(parameterName) @@ -55,10 +55,10 @@ func (s *Server) securityTokenAuth(ctx context.Context, operationName string, re type SecuritySource interface { // TokenAuth provides tokenAuth security value. // Contains GITHUB_TOKEN, like `${{ secrets.GITHUB_TOKEN }}`. - TokenAuth(ctx context.Context, operationName string) (TokenAuth, error) + TokenAuth(ctx context.Context, operationName OperationName) (TokenAuth, error) } -func (s *Client) securityTokenAuth(ctx context.Context, operationName string, req *http.Request) error { +func (s *Client) securityTokenAuth(ctx context.Context, operationName OperationName, req *http.Request) error { t, err := s.sec.TokenAuth(ctx, operationName) if err != nil { return errors.Wrap(err, "security source \"TokenAuth\"") diff --git a/internal/promapi/oas_client_gen.go b/internal/promapi/oas_client_gen.go index 963a10f6..5590ac36 100644 --- a/internal/promapi/oas_client_gen.go +++ b/internal/promapi/oas_client_gen.go @@ -172,7 +172,7 @@ func (c *Client) sendGetLabelValues(ctx context.Context, params GetLabelValuesPa c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "GetLabelValues", + ctx, span := c.cfg.Tracer.Start(ctx, GetLabelValuesOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -348,7 +348,7 @@ func (c *Client) sendGetLabels(ctx context.Context, params GetLabelsParams) (res c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "GetLabels", + ctx, span := c.cfg.Tracer.Start(ctx, GetLabelsOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -505,7 +505,7 @@ func (c *Client) sendGetMetadata(ctx context.Context, params GetMetadataParams) c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "GetMetadata", + ctx, span := c.cfg.Tracer.Start(ctx, GetMetadataOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -632,7 +632,7 @@ func (c *Client) sendGetQuery(ctx context.Context, params GetQueryParams) (res * c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "GetQuery", + ctx, span := c.cfg.Tracer.Start(ctx, GetQueryOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -776,7 +776,7 @@ func (c *Client) sendGetQueryExemplars(ctx context.Context, params GetQueryExemp c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "GetQueryExemplars", + ctx, span := c.cfg.Tracer.Start(ctx, GetQueryExemplarsOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -900,7 +900,7 @@ func (c *Client) sendGetQueryRange(ctx context.Context, params GetQueryRangePara c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "GetQueryRange", + ctx, span := c.cfg.Tracer.Start(ctx, GetQueryRangeOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -1070,7 +1070,7 @@ func (c *Client) sendGetRules(ctx context.Context, params GetRulesParams) (res * c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "GetRules", + ctx, span := c.cfg.Tracer.Start(ctx, GetRulesOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -1241,7 +1241,7 @@ func (c *Client) sendGetSeries(ctx context.Context, params GetSeriesParams) (res c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "GetSeries", + ctx, span := c.cfg.Tracer.Start(ctx, GetSeriesOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -1395,7 +1395,7 @@ func (c *Client) sendPostLabels(ctx context.Context, request *LabelsForm) (res * c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "PostLabels", + ctx, span := c.cfg.Tracer.Start(ctx, PostLabelsOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -1470,7 +1470,7 @@ func (c *Client) sendPostQuery(ctx context.Context, request *QueryForm) (res *Qu c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "PostQuery", + ctx, span := c.cfg.Tracer.Start(ctx, PostQueryOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -1545,7 +1545,7 @@ func (c *Client) sendPostQueryExemplars(ctx context.Context, request *ExemplarsF c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "PostQueryExemplars", + ctx, span := c.cfg.Tracer.Start(ctx, PostQueryExemplarsOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -1620,7 +1620,7 @@ func (c *Client) sendPostQueryRange(ctx context.Context, request *QueryRangeForm c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "PostQueryRange", + ctx, span := c.cfg.Tracer.Start(ctx, PostQueryRangeOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -1695,7 +1695,7 @@ func (c *Client) sendPostSeries(ctx context.Context, request *SeriesForm) (res * c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "PostSeries", + ctx, span := c.cfg.Tracer.Start(ctx, PostSeriesOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) diff --git a/internal/promapi/oas_handlers_gen.go b/internal/promapi/oas_handlers_gen.go index 4949c904..0da78f9a 100644 --- a/internal/promapi/oas_handlers_gen.go +++ b/internal/promapi/oas_handlers_gen.go @@ -31,7 +31,7 @@ func (s *Server) handleGetLabelValuesRequest(args [1]string, argsEscaped bool, w } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "GetLabelValues", + ctx, span := s.cfg.Tracer.Start(r.Context(), GetLabelValuesOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -62,7 +62,7 @@ func (s *Server) handleGetLabelValuesRequest(args [1]string, argsEscaped bool, w } err error opErrContext = ogenerrors.OperationContext{ - Name: "GetLabelValues", + Name: GetLabelValuesOperation, ID: "getLabelValues", } ) @@ -81,7 +81,7 @@ func (s *Server) handleGetLabelValuesRequest(args [1]string, argsEscaped bool, w if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "GetLabelValues", + OperationName: GetLabelValuesOperation, OperationSummary: "", OperationID: "getLabelValues", Body: nil, @@ -168,7 +168,7 @@ func (s *Server) handleGetLabelsRequest(args [0]string, argsEscaped bool, w http } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "GetLabels", + ctx, span := s.cfg.Tracer.Start(r.Context(), GetLabelsOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -199,7 +199,7 @@ func (s *Server) handleGetLabelsRequest(args [0]string, argsEscaped bool, w http } err error opErrContext = ogenerrors.OperationContext{ - Name: "GetLabels", + Name: GetLabelsOperation, ID: "getLabels", } ) @@ -218,7 +218,7 @@ func (s *Server) handleGetLabelsRequest(args [0]string, argsEscaped bool, w http if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "GetLabels", + OperationName: GetLabelsOperation, OperationSummary: "", OperationID: "getLabels", Body: nil, @@ -301,7 +301,7 @@ func (s *Server) handleGetMetadataRequest(args [0]string, argsEscaped bool, w ht } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "GetMetadata", + ctx, span := s.cfg.Tracer.Start(r.Context(), GetMetadataOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -332,7 +332,7 @@ func (s *Server) handleGetMetadataRequest(args [0]string, argsEscaped bool, w ht } err error opErrContext = ogenerrors.OperationContext{ - Name: "GetMetadata", + Name: GetMetadataOperation, ID: "getMetadata", } ) @@ -351,7 +351,7 @@ func (s *Server) handleGetMetadataRequest(args [0]string, argsEscaped bool, w ht if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "GetMetadata", + OperationName: GetMetadataOperation, OperationSummary: "", OperationID: "getMetadata", Body: nil, @@ -432,7 +432,7 @@ func (s *Server) handleGetQueryRequest(args [0]string, argsEscaped bool, w http. } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "GetQuery", + ctx, span := s.cfg.Tracer.Start(r.Context(), GetQueryOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -463,7 +463,7 @@ func (s *Server) handleGetQueryRequest(args [0]string, argsEscaped bool, w http. } err error opErrContext = ogenerrors.OperationContext{ - Name: "GetQuery", + Name: GetQueryOperation, ID: "getQuery", } ) @@ -482,7 +482,7 @@ func (s *Server) handleGetQueryRequest(args [0]string, argsEscaped bool, w http. if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "GetQuery", + OperationName: GetQueryOperation, OperationSummary: "", OperationID: "getQuery", Body: nil, @@ -567,7 +567,7 @@ func (s *Server) handleGetQueryExemplarsRequest(args [0]string, argsEscaped bool } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "GetQueryExemplars", + ctx, span := s.cfg.Tracer.Start(r.Context(), GetQueryExemplarsOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -598,7 +598,7 @@ func (s *Server) handleGetQueryExemplarsRequest(args [0]string, argsEscaped bool } err error opErrContext = ogenerrors.OperationContext{ - Name: "GetQueryExemplars", + Name: GetQueryExemplarsOperation, ID: "getQueryExemplars", } ) @@ -617,7 +617,7 @@ func (s *Server) handleGetQueryExemplarsRequest(args [0]string, argsEscaped bool if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "GetQueryExemplars", + OperationName: GetQueryExemplarsOperation, OperationSummary: "", OperationID: "getQueryExemplars", Body: nil, @@ -698,7 +698,7 @@ func (s *Server) handleGetQueryRangeRequest(args [0]string, argsEscaped bool, w } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "GetQueryRange", + ctx, span := s.cfg.Tracer.Start(r.Context(), GetQueryRangeOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -729,7 +729,7 @@ func (s *Server) handleGetQueryRangeRequest(args [0]string, argsEscaped bool, w } err error opErrContext = ogenerrors.OperationContext{ - Name: "GetQueryRange", + Name: GetQueryRangeOperation, ID: "getQueryRange", } ) @@ -748,7 +748,7 @@ func (s *Server) handleGetQueryRangeRequest(args [0]string, argsEscaped bool, w if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "GetQueryRange", + OperationName: GetQueryRangeOperation, OperationSummary: "", OperationID: "getQueryRange", Body: nil, @@ -839,7 +839,7 @@ func (s *Server) handleGetRulesRequest(args [0]string, argsEscaped bool, w http. } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "GetRules", + ctx, span := s.cfg.Tracer.Start(r.Context(), GetRulesOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -870,7 +870,7 @@ func (s *Server) handleGetRulesRequest(args [0]string, argsEscaped bool, w http. } err error opErrContext = ogenerrors.OperationContext{ - Name: "GetRules", + Name: GetRulesOperation, ID: "getRules", } ) @@ -889,7 +889,7 @@ func (s *Server) handleGetRulesRequest(args [0]string, argsEscaped bool, w http. if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "GetRules", + OperationName: GetRulesOperation, OperationSummary: "", OperationID: "getRules", Body: nil, @@ -974,7 +974,7 @@ func (s *Server) handleGetSeriesRequest(args [0]string, argsEscaped bool, w http } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "GetSeries", + ctx, span := s.cfg.Tracer.Start(r.Context(), GetSeriesOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -1005,7 +1005,7 @@ func (s *Server) handleGetSeriesRequest(args [0]string, argsEscaped bool, w http } err error opErrContext = ogenerrors.OperationContext{ - Name: "GetSeries", + Name: GetSeriesOperation, ID: "getSeries", } ) @@ -1024,7 +1024,7 @@ func (s *Server) handleGetSeriesRequest(args [0]string, argsEscaped bool, w http if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "GetSeries", + OperationName: GetSeriesOperation, OperationSummary: "", OperationID: "getSeries", Body: nil, @@ -1107,7 +1107,7 @@ func (s *Server) handlePostLabelsRequest(args [0]string, argsEscaped bool, w htt } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "PostLabels", + ctx, span := s.cfg.Tracer.Start(r.Context(), PostLabelsOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -1138,7 +1138,7 @@ func (s *Server) handlePostLabelsRequest(args [0]string, argsEscaped bool, w htt } err error opErrContext = ogenerrors.OperationContext{ - Name: "PostLabels", + Name: PostLabelsOperation, ID: "postLabels", } ) @@ -1162,7 +1162,7 @@ func (s *Server) handlePostLabelsRequest(args [0]string, argsEscaped bool, w htt if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "PostLabels", + OperationName: PostLabelsOperation, OperationSummary: "", OperationID: "postLabels", Body: request, @@ -1230,7 +1230,7 @@ func (s *Server) handlePostQueryRequest(args [0]string, argsEscaped bool, w http } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "PostQuery", + ctx, span := s.cfg.Tracer.Start(r.Context(), PostQueryOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -1261,7 +1261,7 @@ func (s *Server) handlePostQueryRequest(args [0]string, argsEscaped bool, w http } err error opErrContext = ogenerrors.OperationContext{ - Name: "PostQuery", + Name: PostQueryOperation, ID: "postQuery", } ) @@ -1285,7 +1285,7 @@ func (s *Server) handlePostQueryRequest(args [0]string, argsEscaped bool, w http if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "PostQuery", + OperationName: PostQueryOperation, OperationSummary: "", OperationID: "postQuery", Body: request, @@ -1353,7 +1353,7 @@ func (s *Server) handlePostQueryExemplarsRequest(args [0]string, argsEscaped boo } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "PostQueryExemplars", + ctx, span := s.cfg.Tracer.Start(r.Context(), PostQueryExemplarsOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -1384,7 +1384,7 @@ func (s *Server) handlePostQueryExemplarsRequest(args [0]string, argsEscaped boo } err error opErrContext = ogenerrors.OperationContext{ - Name: "PostQueryExemplars", + Name: PostQueryExemplarsOperation, ID: "postQueryExemplars", } ) @@ -1408,7 +1408,7 @@ func (s *Server) handlePostQueryExemplarsRequest(args [0]string, argsEscaped boo if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "PostQueryExemplars", + OperationName: PostQueryExemplarsOperation, OperationSummary: "", OperationID: "postQueryExemplars", Body: request, @@ -1476,7 +1476,7 @@ func (s *Server) handlePostQueryRangeRequest(args [0]string, argsEscaped bool, w } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "PostQueryRange", + ctx, span := s.cfg.Tracer.Start(r.Context(), PostQueryRangeOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -1507,7 +1507,7 @@ func (s *Server) handlePostQueryRangeRequest(args [0]string, argsEscaped bool, w } err error opErrContext = ogenerrors.OperationContext{ - Name: "PostQueryRange", + Name: PostQueryRangeOperation, ID: "postQueryRange", } ) @@ -1531,7 +1531,7 @@ func (s *Server) handlePostQueryRangeRequest(args [0]string, argsEscaped bool, w if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "PostQueryRange", + OperationName: PostQueryRangeOperation, OperationSummary: "", OperationID: "postQueryRange", Body: request, @@ -1599,7 +1599,7 @@ func (s *Server) handlePostSeriesRequest(args [0]string, argsEscaped bool, w htt } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "PostSeries", + ctx, span := s.cfg.Tracer.Start(r.Context(), PostSeriesOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -1630,7 +1630,7 @@ func (s *Server) handlePostSeriesRequest(args [0]string, argsEscaped bool, w htt } err error opErrContext = ogenerrors.OperationContext{ - Name: "PostSeries", + Name: PostSeriesOperation, ID: "postSeries", } ) @@ -1654,7 +1654,7 @@ func (s *Server) handlePostSeriesRequest(args [0]string, argsEscaped bool, w htt if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "PostSeries", + OperationName: PostSeriesOperation, OperationSummary: "", OperationID: "postSeries", Body: request, diff --git a/internal/promapi/oas_operations_gen.go b/internal/promapi/oas_operations_gen.go new file mode 100644 index 00000000..7debb28e --- /dev/null +++ b/internal/promapi/oas_operations_gen.go @@ -0,0 +1,22 @@ +// Code generated by ogen, DO NOT EDIT. + +package promapi + +// OperationName is the ogen operation name +type OperationName = string + +const ( + GetLabelValuesOperation OperationName = "GetLabelValues" + GetLabelsOperation OperationName = "GetLabels" + GetMetadataOperation OperationName = "GetMetadata" + GetQueryOperation OperationName = "GetQuery" + GetQueryExemplarsOperation OperationName = "GetQueryExemplars" + GetQueryRangeOperation OperationName = "GetQueryRange" + GetRulesOperation OperationName = "GetRules" + GetSeriesOperation OperationName = "GetSeries" + PostLabelsOperation OperationName = "PostLabels" + PostQueryOperation OperationName = "PostQuery" + PostQueryExemplarsOperation OperationName = "PostQueryExemplars" + PostQueryRangeOperation OperationName = "PostQueryRange" + PostSeriesOperation OperationName = "PostSeries" +) diff --git a/internal/promapi/oas_router_gen.go b/internal/promapi/oas_router_gen.go index 68873301..eaa6e11e 100644 --- a/internal/promapi/oas_router_gen.go +++ b/internal/promapi/oas_router_gen.go @@ -436,7 +436,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "GET": - r.name = "GetLabelValues" + r.name = GetLabelValuesOperation r.summary = "" r.operationID = "getLabelValues" r.pathPattern = "/api/v1/label/{label}/values" @@ -464,7 +464,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "GET": - r.name = "GetLabels" + r.name = GetLabelsOperation r.summary = "" r.operationID = "getLabels" r.pathPattern = "/api/v1/labels" @@ -472,7 +472,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { r.count = 0 return r, true case "POST": - r.name = "PostLabels" + r.name = PostLabelsOperation r.summary = "" r.operationID = "postLabels" r.pathPattern = "/api/v1/labels" @@ -500,7 +500,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "GET": - r.name = "GetMetadata" + r.name = GetMetadataOperation r.summary = "" r.operationID = "getMetadata" r.pathPattern = "/api/v1/metadata" @@ -524,7 +524,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { if len(elem) == 0 { switch method { case "GET": - r.name = "GetQuery" + r.name = GetQueryOperation r.summary = "" r.operationID = "getQuery" r.pathPattern = "/api/v1/query" @@ -532,7 +532,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { r.count = 0 return r, true case "POST": - r.name = "PostQuery" + r.name = PostQueryOperation r.summary = "" r.operationID = "postQuery" r.pathPattern = "/api/v1/query" @@ -568,7 +568,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "GET": - r.name = "GetQueryExemplars" + r.name = GetQueryExemplarsOperation r.summary = "" r.operationID = "getQueryExemplars" r.pathPattern = "/api/v1/query_exemplars" @@ -576,7 +576,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { r.count = 0 return r, true case "POST": - r.name = "PostQueryExemplars" + r.name = PostQueryExemplarsOperation r.summary = "" r.operationID = "postQueryExemplars" r.pathPattern = "/api/v1/query_exemplars" @@ -601,7 +601,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "GET": - r.name = "GetQueryRange" + r.name = GetQueryRangeOperation r.summary = "" r.operationID = "getQueryRange" r.pathPattern = "/api/v1/query_range" @@ -609,7 +609,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { r.count = 0 return r, true case "POST": - r.name = "PostQueryRange" + r.name = PostQueryRangeOperation r.summary = "" r.operationID = "postQueryRange" r.pathPattern = "/api/v1/query_range" @@ -640,7 +640,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "GET": - r.name = "GetRules" + r.name = GetRulesOperation r.summary = "" r.operationID = "getRules" r.pathPattern = "/api/v1/rules" @@ -665,7 +665,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "GET": - r.name = "GetSeries" + r.name = GetSeriesOperation r.summary = "" r.operationID = "getSeries" r.pathPattern = "/api/v1/series" @@ -673,7 +673,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { r.count = 0 return r, true case "POST": - r.name = "PostSeries" + r.name = PostSeriesOperation r.summary = "" r.operationID = "postSeries" r.pathPattern = "/api/v1/series" diff --git a/internal/pyroscopeapi/oas_client_gen.go b/internal/pyroscopeapi/oas_client_gen.go index a9a91f2c..daeaac29 100644 --- a/internal/pyroscopeapi/oas_client_gen.go +++ b/internal/pyroscopeapi/oas_client_gen.go @@ -139,7 +139,7 @@ func (c *Client) sendGetApps(ctx context.Context) (res []ApplicationMetadata, er c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "GetApps", + ctx, span := c.cfg.Tracer.Start(ctx, GetAppsOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -211,7 +211,7 @@ func (c *Client) sendIngest(ctx context.Context, request *IngestReqWithContentTy c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "Ingest", + ctx, span := c.cfg.Tracer.Start(ctx, IngestOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -432,7 +432,7 @@ func (c *Client) sendLabelValues(ctx context.Context, params LabelValuesParams) c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "LabelValues", + ctx, span := c.cfg.Tracer.Start(ctx, LabelValuesOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -579,7 +579,7 @@ func (c *Client) sendLabels(ctx context.Context, params LabelsParams) (res Label c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "Labels", + ctx, span := c.cfg.Tracer.Start(ctx, LabelsOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -713,7 +713,7 @@ func (c *Client) sendRender(ctx context.Context, params RenderParams) (res *Flam c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "Render", + ctx, span := c.cfg.Tracer.Start(ctx, RenderOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) diff --git a/internal/pyroscopeapi/oas_handlers_gen.go b/internal/pyroscopeapi/oas_handlers_gen.go index eebdb0d4..616ca2cc 100644 --- a/internal/pyroscopeapi/oas_handlers_gen.go +++ b/internal/pyroscopeapi/oas_handlers_gen.go @@ -34,7 +34,7 @@ func (s *Server) handleGetAppsRequest(args [0]string, argsEscaped bool, w http.R } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "GetApps", + ctx, span := s.cfg.Tracer.Start(r.Context(), GetAppsOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -70,7 +70,7 @@ func (s *Server) handleGetAppsRequest(args [0]string, argsEscaped bool, w http.R if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "GetApps", + OperationName: GetAppsOperation, OperationSummary: "", OperationID: "getApps", Body: nil, @@ -138,7 +138,7 @@ func (s *Server) handleIngestRequest(args [0]string, argsEscaped bool, w http.Re } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "Ingest", + ctx, span := s.cfg.Tracer.Start(r.Context(), IngestOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -169,7 +169,7 @@ func (s *Server) handleIngestRequest(args [0]string, argsEscaped bool, w http.Re } err error opErrContext = ogenerrors.OperationContext{ - Name: "Ingest", + Name: IngestOperation, ID: "ingest", } ) @@ -203,7 +203,7 @@ func (s *Server) handleIngestRequest(args [0]string, argsEscaped bool, w http.Re if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "Ingest", + OperationName: IngestOperation, OperationSummary: "", OperationID: "ingest", Body: request, @@ -304,7 +304,7 @@ func (s *Server) handleLabelValuesRequest(args [0]string, argsEscaped bool, w ht } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "LabelValues", + ctx, span := s.cfg.Tracer.Start(r.Context(), LabelValuesOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -335,7 +335,7 @@ func (s *Server) handleLabelValuesRequest(args [0]string, argsEscaped bool, w ht } err error opErrContext = ogenerrors.OperationContext{ - Name: "LabelValues", + Name: LabelValuesOperation, ID: "labelValues", } ) @@ -354,7 +354,7 @@ func (s *Server) handleLabelValuesRequest(args [0]string, argsEscaped bool, w ht if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "LabelValues", + OperationName: LabelValuesOperation, OperationSummary: "", OperationID: "labelValues", Body: nil, @@ -439,7 +439,7 @@ func (s *Server) handleLabelsRequest(args [0]string, argsEscaped bool, w http.Re } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "Labels", + ctx, span := s.cfg.Tracer.Start(r.Context(), LabelsOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -470,7 +470,7 @@ func (s *Server) handleLabelsRequest(args [0]string, argsEscaped bool, w http.Re } err error opErrContext = ogenerrors.OperationContext{ - Name: "Labels", + Name: LabelsOperation, ID: "labels", } ) @@ -489,7 +489,7 @@ func (s *Server) handleLabelsRequest(args [0]string, argsEscaped bool, w http.Re if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "Labels", + OperationName: LabelsOperation, OperationSummary: "", OperationID: "labels", Body: nil, @@ -571,7 +571,7 @@ func (s *Server) handleRenderRequest(args [0]string, argsEscaped bool, w http.Re } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "Render", + ctx, span := s.cfg.Tracer.Start(r.Context(), RenderOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -602,7 +602,7 @@ func (s *Server) handleRenderRequest(args [0]string, argsEscaped bool, w http.Re } err error opErrContext = ogenerrors.OperationContext{ - Name: "Render", + Name: RenderOperation, ID: "render", } ) @@ -621,7 +621,7 @@ func (s *Server) handleRenderRequest(args [0]string, argsEscaped bool, w http.Re if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "Render", + OperationName: RenderOperation, OperationSummary: "", OperationID: "render", Body: nil, diff --git a/internal/pyroscopeapi/oas_operations_gen.go b/internal/pyroscopeapi/oas_operations_gen.go new file mode 100644 index 00000000..a8ef4cb7 --- /dev/null +++ b/internal/pyroscopeapi/oas_operations_gen.go @@ -0,0 +1,14 @@ +// Code generated by ogen, DO NOT EDIT. + +package pyroscopeapi + +// OperationName is the ogen operation name +type OperationName = string + +const ( + GetAppsOperation OperationName = "GetApps" + IngestOperation OperationName = "Ingest" + LabelValuesOperation OperationName = "LabelValues" + LabelsOperation OperationName = "Labels" + RenderOperation OperationName = "Render" +) diff --git a/internal/pyroscopeapi/oas_router_gen.go b/internal/pyroscopeapi/oas_router_gen.go index 020b7e65..a4bd44f2 100644 --- a/internal/pyroscopeapi/oas_router_gen.go +++ b/internal/pyroscopeapi/oas_router_gen.go @@ -287,7 +287,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "GET": - r.name = "GetApps" + r.name = GetAppsOperation r.summary = "" r.operationID = "getApps" r.pathPattern = "/api/apps" @@ -312,7 +312,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "POST": - r.name = "Ingest" + r.name = IngestOperation r.summary = "" r.operationID = "ingest" r.pathPattern = "/ingest" @@ -349,7 +349,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "GET": - r.name = "LabelValues" + r.name = LabelValuesOperation r.summary = "" r.operationID = "labelValues" r.pathPattern = "/label-values" @@ -374,7 +374,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "GET": - r.name = "Labels" + r.name = LabelsOperation r.summary = "" r.operationID = "labels" r.pathPattern = "/labels" @@ -402,7 +402,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "GET": - r.name = "Render" + r.name = RenderOperation r.summary = "" r.operationID = "render" r.pathPattern = "/render" diff --git a/internal/sentryapi/oas_client_gen.go b/internal/sentryapi/oas_client_gen.go index cb8c2a8b..d9401993 100644 --- a/internal/sentryapi/oas_client_gen.go +++ b/internal/sentryapi/oas_client_gen.go @@ -117,7 +117,7 @@ func (c *Client) sendDummy(ctx context.Context) (res *Event, err error) { c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "Dummy", + ctx, span := c.cfg.Tracer.Start(ctx, DummyOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -189,7 +189,7 @@ func (c *Client) sendEnvelope(ctx context.Context, request *EnvelopeReqWithConte c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "Envelope", + ctx, span := c.cfg.Tracer.Start(ctx, EnvelopeOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) diff --git a/internal/sentryapi/oas_handlers_gen.go b/internal/sentryapi/oas_handlers_gen.go index 8e57852d..7061362a 100644 --- a/internal/sentryapi/oas_handlers_gen.go +++ b/internal/sentryapi/oas_handlers_gen.go @@ -33,7 +33,7 @@ func (s *Server) handleDummyRequest(args [0]string, argsEscaped bool, w http.Res } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "Dummy", + ctx, span := s.cfg.Tracer.Start(r.Context(), DummyOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -69,7 +69,7 @@ func (s *Server) handleDummyRequest(args [0]string, argsEscaped bool, w http.Res if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "Dummy", + OperationName: DummyOperation, OperationSummary: "", OperationID: "dummy", Body: nil, @@ -137,7 +137,7 @@ func (s *Server) handleEnvelopeRequest(args [0]string, argsEscaped bool, w http. } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "Envelope", + ctx, span := s.cfg.Tracer.Start(r.Context(), EnvelopeOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -168,7 +168,7 @@ func (s *Server) handleEnvelopeRequest(args [0]string, argsEscaped bool, w http. } err error opErrContext = ogenerrors.OperationContext{ - Name: "Envelope", + Name: EnvelopeOperation, ID: "envelope", } ) @@ -192,7 +192,7 @@ func (s *Server) handleEnvelopeRequest(args [0]string, argsEscaped bool, w http. if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "Envelope", + OperationName: EnvelopeOperation, OperationSummary: "", OperationID: "envelope", Body: request, diff --git a/internal/sentryapi/oas_operations_gen.go b/internal/sentryapi/oas_operations_gen.go new file mode 100644 index 00000000..e52000c7 --- /dev/null +++ b/internal/sentryapi/oas_operations_gen.go @@ -0,0 +1,11 @@ +// Code generated by ogen, DO NOT EDIT. + +package sentryapi + +// OperationName is the ogen operation name +type OperationName = string + +const ( + DummyOperation OperationName = "Dummy" + EnvelopeOperation OperationName = "Envelope" +) diff --git a/internal/sentryapi/oas_router_gen.go b/internal/sentryapi/oas_router_gen.go index 29d5b38f..0dddf6d8 100644 --- a/internal/sentryapi/oas_router_gen.go +++ b/internal/sentryapi/oas_router_gen.go @@ -209,7 +209,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "GET": - r.name = "Dummy" + r.name = DummyOperation r.summary = "" r.operationID = "dummy" r.pathPattern = "/dummy" @@ -234,7 +234,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "POST": - r.name = "Envelope" + r.name = EnvelopeOperation r.summary = "" r.operationID = "envelope" r.pathPattern = "/envelope" diff --git a/internal/tempoapi/oas_client_gen.go b/internal/tempoapi/oas_client_gen.go index c9a3aea0..824226da 100644 --- a/internal/tempoapi/oas_client_gen.go +++ b/internal/tempoapi/oas_client_gen.go @@ -157,7 +157,7 @@ func (c *Client) sendBuildInfo(ctx context.Context) (res *PrometheusVersion, err c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "BuildInfo", + ctx, span := c.cfg.Tracer.Start(ctx, BuildInfoOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -229,7 +229,7 @@ func (c *Client) sendEcho(ctx context.Context) (res EchoOK, err error) { c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "Echo", + ctx, span := c.cfg.Tracer.Start(ctx, EchoOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -301,7 +301,7 @@ func (c *Client) sendSearch(ctx context.Context, params SearchParams) (res *Trac c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "Search", + ctx, span := c.cfg.Tracer.Start(ctx, SearchOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -513,7 +513,7 @@ func (c *Client) sendSearchTagValues(ctx context.Context, params SearchTagValues c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "SearchTagValues", + ctx, span := c.cfg.Tracer.Start(ctx, SearchTagValuesOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -660,7 +660,7 @@ func (c *Client) sendSearchTagValuesV2(ctx context.Context, params SearchTagValu c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "SearchTagValuesV2", + ctx, span := c.cfg.Tracer.Start(ctx, SearchTagValuesV2Operation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -806,7 +806,7 @@ func (c *Client) sendSearchTags(ctx context.Context, params SearchTagsParams) (r c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "SearchTags", + ctx, span := c.cfg.Tracer.Start(ctx, SearchTagsOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -933,7 +933,7 @@ func (c *Client) sendSearchTagsV2(ctx context.Context, params SearchTagsV2Params c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "SearchTagsV2", + ctx, span := c.cfg.Tracer.Start(ctx, SearchTagsV2Operation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) @@ -1060,7 +1060,7 @@ func (c *Client) sendTraceByID(ctx context.Context, params TraceByIDParams) (res c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...)) // Start a span for this request. - ctx, span := c.cfg.Tracer.Start(ctx, "TraceByID", + ctx, span := c.cfg.Tracer.Start(ctx, TraceByIDOperation, trace.WithAttributes(otelAttrs...), clientSpanKind, ) diff --git a/internal/tempoapi/oas_handlers_gen.go b/internal/tempoapi/oas_handlers_gen.go index cc4f4391..9367a6de 100644 --- a/internal/tempoapi/oas_handlers_gen.go +++ b/internal/tempoapi/oas_handlers_gen.go @@ -34,7 +34,7 @@ func (s *Server) handleBuildInfoRequest(args [0]string, argsEscaped bool, w http } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "BuildInfo", + ctx, span := s.cfg.Tracer.Start(r.Context(), BuildInfoOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -70,7 +70,7 @@ func (s *Server) handleBuildInfoRequest(args [0]string, argsEscaped bool, w http if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "BuildInfo", + OperationName: BuildInfoOperation, OperationSummary: "", OperationID: "buildInfo", Body: nil, @@ -138,7 +138,7 @@ func (s *Server) handleEchoRequest(args [0]string, argsEscaped bool, w http.Resp } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "Echo", + ctx, span := s.cfg.Tracer.Start(r.Context(), EchoOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -174,7 +174,7 @@ func (s *Server) handleEchoRequest(args [0]string, argsEscaped bool, w http.Resp if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "Echo", + OperationName: EchoOperation, OperationSummary: "", OperationID: "echo", Body: nil, @@ -242,7 +242,7 @@ func (s *Server) handleSearchRequest(args [0]string, argsEscaped bool, w http.Re } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "Search", + ctx, span := s.cfg.Tracer.Start(r.Context(), SearchOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -273,7 +273,7 @@ func (s *Server) handleSearchRequest(args [0]string, argsEscaped bool, w http.Re } err error opErrContext = ogenerrors.OperationContext{ - Name: "Search", + Name: SearchOperation, ID: "search", } ) @@ -292,7 +292,7 @@ func (s *Server) handleSearchRequest(args [0]string, argsEscaped bool, w http.Re if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "Search", + OperationName: SearchOperation, OperationSummary: "", OperationID: "search", Body: nil, @@ -393,7 +393,7 @@ func (s *Server) handleSearchTagValuesRequest(args [1]string, argsEscaped bool, } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "SearchTagValues", + ctx, span := s.cfg.Tracer.Start(r.Context(), SearchTagValuesOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -424,7 +424,7 @@ func (s *Server) handleSearchTagValuesRequest(args [1]string, argsEscaped bool, } err error opErrContext = ogenerrors.OperationContext{ - Name: "SearchTagValues", + Name: SearchTagValuesOperation, ID: "searchTagValues", } ) @@ -443,7 +443,7 @@ func (s *Server) handleSearchTagValuesRequest(args [1]string, argsEscaped bool, if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "SearchTagValues", + OperationName: SearchTagValuesOperation, OperationSummary: "", OperationID: "searchTagValues", Body: nil, @@ -529,7 +529,7 @@ func (s *Server) handleSearchTagValuesV2Request(args [1]string, argsEscaped bool } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "SearchTagValuesV2", + ctx, span := s.cfg.Tracer.Start(r.Context(), SearchTagValuesV2Operation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -560,7 +560,7 @@ func (s *Server) handleSearchTagValuesV2Request(args [1]string, argsEscaped bool } err error opErrContext = ogenerrors.OperationContext{ - Name: "SearchTagValuesV2", + Name: SearchTagValuesV2Operation, ID: "searchTagValuesV2", } ) @@ -579,7 +579,7 @@ func (s *Server) handleSearchTagValuesV2Request(args [1]string, argsEscaped bool if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "SearchTagValuesV2", + OperationName: SearchTagValuesV2Operation, OperationSummary: "", OperationID: "searchTagValuesV2", Body: nil, @@ -664,7 +664,7 @@ func (s *Server) handleSearchTagsRequest(args [0]string, argsEscaped bool, w htt } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "SearchTags", + ctx, span := s.cfg.Tracer.Start(r.Context(), SearchTagsOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -695,7 +695,7 @@ func (s *Server) handleSearchTagsRequest(args [0]string, argsEscaped bool, w htt } err error opErrContext = ogenerrors.OperationContext{ - Name: "SearchTags", + Name: SearchTagsOperation, ID: "searchTags", } ) @@ -714,7 +714,7 @@ func (s *Server) handleSearchTagsRequest(args [0]string, argsEscaped bool, w htt if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "SearchTags", + OperationName: SearchTagsOperation, OperationSummary: "", OperationID: "searchTags", Body: nil, @@ -795,7 +795,7 @@ func (s *Server) handleSearchTagsV2Request(args [0]string, argsEscaped bool, w h } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "SearchTagsV2", + ctx, span := s.cfg.Tracer.Start(r.Context(), SearchTagsV2Operation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -826,7 +826,7 @@ func (s *Server) handleSearchTagsV2Request(args [0]string, argsEscaped bool, w h } err error opErrContext = ogenerrors.OperationContext{ - Name: "SearchTagsV2", + Name: SearchTagsV2Operation, ID: "searchTagsV2", } ) @@ -845,7 +845,7 @@ func (s *Server) handleSearchTagsV2Request(args [0]string, argsEscaped bool, w h if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "SearchTagsV2", + OperationName: SearchTagsV2Operation, OperationSummary: "", OperationID: "searchTagsV2", Body: nil, @@ -926,7 +926,7 @@ func (s *Server) handleTraceByIDRequest(args [1]string, argsEscaped bool, w http } // Start a span for this request. - ctx, span := s.cfg.Tracer.Start(r.Context(), "TraceByID", + ctx, span := s.cfg.Tracer.Start(r.Context(), TraceByIDOperation, trace.WithAttributes(otelAttrs...), serverSpanKind, ) @@ -957,7 +957,7 @@ func (s *Server) handleTraceByIDRequest(args [1]string, argsEscaped bool, w http } err error opErrContext = ogenerrors.OperationContext{ - Name: "TraceByID", + Name: TraceByIDOperation, ID: "traceByID", } ) @@ -976,7 +976,7 @@ func (s *Server) handleTraceByIDRequest(args [1]string, argsEscaped bool, w http if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ Context: ctx, - OperationName: "TraceByID", + OperationName: TraceByIDOperation, OperationSummary: "", OperationID: "traceByID", Body: nil, diff --git a/internal/tempoapi/oas_operations_gen.go b/internal/tempoapi/oas_operations_gen.go new file mode 100644 index 00000000..e64aa0b5 --- /dev/null +++ b/internal/tempoapi/oas_operations_gen.go @@ -0,0 +1,17 @@ +// Code generated by ogen, DO NOT EDIT. + +package tempoapi + +// OperationName is the ogen operation name +type OperationName = string + +const ( + BuildInfoOperation OperationName = "BuildInfo" + EchoOperation OperationName = "Echo" + SearchOperation OperationName = "Search" + SearchTagValuesOperation OperationName = "SearchTagValues" + SearchTagValuesV2Operation OperationName = "SearchTagValuesV2" + SearchTagsOperation OperationName = "SearchTags" + SearchTagsV2Operation OperationName = "SearchTagsV2" + TraceByIDOperation OperationName = "TraceByID" +) diff --git a/internal/tempoapi/oas_router_gen.go b/internal/tempoapi/oas_router_gen.go index f9c25a4a..f3ec98f8 100644 --- a/internal/tempoapi/oas_router_gen.go +++ b/internal/tempoapi/oas_router_gen.go @@ -441,7 +441,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "GET": - r.name = "Echo" + r.name = EchoOperation r.summary = "" r.operationID = "echo" r.pathPattern = "/api/echo" @@ -477,7 +477,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { if len(elem) == 0 { switch method { case "GET": - r.name = "Search" + r.name = SearchOperation r.summary = "" r.operationID = "search" r.pathPattern = "/api/search" @@ -534,7 +534,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "GET": - r.name = "SearchTagValues" + r.name = SearchTagValuesOperation r.summary = "" r.operationID = "searchTagValues" r.pathPattern = "/api/search/tag/{tag_name}/values" @@ -562,7 +562,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "GET": - r.name = "SearchTags" + r.name = SearchTagsOperation r.summary = "" r.operationID = "searchTags" r.pathPattern = "/api/search/tags" @@ -593,7 +593,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "GET": - r.name = "BuildInfo" + r.name = BuildInfoOperation r.summary = "" r.operationID = "buildInfo" r.pathPattern = "/api/status/buildinfo" @@ -626,7 +626,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "GET": - r.name = "TraceByID" + r.name = TraceByIDOperation r.summary = "" r.operationID = "traceByID" r.pathPattern = "/api/traces/{traceID}" @@ -684,7 +684,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "GET": - r.name = "SearchTagValuesV2" + r.name = SearchTagValuesV2Operation r.summary = "" r.operationID = "searchTagValuesV2" r.pathPattern = "/api/v2/search/tag/{attribute_selector}/values" @@ -712,7 +712,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { // Leaf node. switch method { case "GET": - r.name = "SearchTagsV2" + r.name = SearchTagsV2Operation r.summary = "" r.operationID = "searchTagsV2" r.pathPattern = "/api/v2/search/tags"