Spaces:
Paused
Paused
ML Intern deploy
Deploy httpSMS gateway to Hugging Face Spaces (Docker SDK): nginx :7860 -> Go API :8000, Nuxt SPA, Android APK, bootstrap-mode entrypoint
83a59ca Download api/pkg/telemetry/tracer.go from red-kit/httpsms-gateway: direct link, hf CLI and curl.
- Browser
- Download file 1.42 kB
-
https://huggingface.co/spaces/red-kit/httpsms-gateway/resolve/main/api/pkg/telemetry/tracer.go
- Command line
-
hf download hf://spaces/red-kit/httpsms-gateway/api/pkg/telemetry/tracer.go
-
curl -L -o tracer.go https://huggingface.co/spaces/red-kit/httpsms-gateway/resolve/main/api/pkg/telemetry/tracer.go
1.42 kB
| package telemetry | |
| import ( | |
| "context" | |
| "github.com/gofiber/fiber/v3" | |
| "go.opentelemetry.io/otel/trace" | |
| ) | |
| const ( | |
| // TracerContextKey stores the fiber trace context | |
| TracerContextKey = "tracer.context.key" | |
| ) | |
| // Tracer is used for tracing | |
| type Tracer interface { | |
| // StartFromFiberCtx creates a spanContext and a context.Context containing the newly-created spanContext. | |
| StartFromFiberCtx(c fiber.Ctx, name ...string) (context.Context, trace.Span) | |
| // StartFromFiberCtxWithLogger creates a spanContext and a context.Context containing the newly-created spanContext with a logger | |
| StartFromFiberCtxWithLogger(c fiber.Ctx, logger Logger, name ...string) (context.Context, trace.Span, Logger) | |
| // Start creates a spanContext and a context.Context containing the newly-created spanContext. | |
| Start(c context.Context, name ...string) (context.Context, trace.Span) | |
| // StartWithLogger creates a spanContext and a context.Context containing the newly-created spanContext with a logger | |
| StartWithLogger(c context.Context, logger Logger, name ...string) (context.Context, trace.Span, Logger) | |
| // CtxLogger creates a telemetry.Logger with spanContext attributes in the structured logger | |
| CtxLogger(logger Logger, span trace.Span) Logger | |
| // WrapErrorSpan sets a spanContext as error | |
| WrapErrorSpan(span trace.Span, err error) error | |
| // Span returns the trace.Span from context.Context | |
| Span(ctx context.Context) trace.Span | |
| } | |