summaryrefslogtreecommitdiff
path: root/modules/caddyhttp
diff options
context:
space:
mode:
authorMatt Holt <mholt@users.noreply.github.com>2022-08-04 11:16:59 -0600
committerGitHub <noreply@github.com>2022-08-04 11:16:59 -0600
commit17ae5acaba536e98cfa86ddcd6967801f1fa1bbe (patch)
treefab5bd3d28ad46e14bb8916b95059de816db75ec /modules/caddyhttp
parent1960a0dc117dd30fb507b390ddf93b2ef371b9ad (diff)
cmd: Use newly-available version information (#4931)
Diffstat (limited to 'modules/caddyhttp')
-rw-r--r--modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go6
-rw-r--r--modules/caddyhttp/tracing/tracer.go4
2 files changed, 4 insertions, 6 deletions
diff --git a/modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go b/modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go
index 2848133..313f4eb 100644
--- a/modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go
+++ b/modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go
@@ -94,10 +94,8 @@ func (t *Transport) Provision(ctx caddy.Context) error {
t.Root = "{http.vars.root}"
}
- t.serverSoftware = "Caddy"
- if mod := caddy.GoModule(); mod.Version != "" {
- t.serverSoftware += "/" + mod.Version
- }
+ version, _ := caddy.Version()
+ t.serverSoftware = "Caddy/" + version
// Set a relatively short default dial timeout.
// This is helpful to make load-balancer retries more speedy.
diff --git a/modules/caddyhttp/tracing/tracer.go b/modules/caddyhttp/tracing/tracer.go
index ce23944..ddb01e8 100644
--- a/modules/caddyhttp/tracing/tracer.go
+++ b/modules/caddyhttp/tracing/tracer.go
@@ -7,7 +7,6 @@ import (
"github.com/caddyserver/caddy/v2"
- caddycmd "github.com/caddyserver/caddy/v2/cmd"
"github.com/caddyserver/caddy/v2/modules/caddyhttp"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
@@ -52,7 +51,8 @@ func newOpenTelemetryWrapper(
spanName: spanName,
}
- res, err := ot.newResource(webEngineName, caddycmd.CaddyVersion())
+ version, _ := caddy.Version()
+ res, err := ot.newResource(webEngineName, version)
if err != nil {
return ot, fmt.Errorf("creating resource error: %w", err)
}