Merge pull request #6956 from timmysilv/timmy/base-image
update nginx base image, handle jaeger propagation format
This commit is contained in:
commit
844a02c276
7 changed files with 49 additions and 4 deletions
2
Makefile
2
Makefile
|
@ -51,7 +51,7 @@ endif
|
|||
|
||||
REGISTRY ?= gcr.io/k8s-staging-ingress-nginx
|
||||
|
||||
BASE_IMAGE ?= k8s.gcr.io/ingress-nginx/nginx:v20210115-gba0502603@sha256:224da667cf3047998ea691e9766fedd1eab94257a39df81374bfa14536da3688
|
||||
BASE_IMAGE ?= k8s.gcr.io/ingress-nginx/nginx:v20210324-g8baef769d@sha256:fcfa3e9d1f8ec3141efedbf77cf659640f452a9c22165c78006ea462b84d06f6
|
||||
|
||||
GOARCH=$(ARCH)
|
||||
|
||||
|
|
2
TAG
2
TAG
|
@ -1 +1 @@
|
|||
v0.45.0-dev.0
|
||||
v0.46.0-dev.0
|
||||
|
|
|
@ -854,6 +854,10 @@ Specifies the endpoint to use when uploading traces to a collector. This takes p
|
|||
|
||||
Specifies the service name to use for any traces created. _**default:**_ nginx
|
||||
|
||||
## jaeger-propagation-format
|
||||
|
||||
Specifies the traceparent/tracestate propagation format. _**default:**_ jaeger
|
||||
|
||||
## jaeger-sampler-type
|
||||
|
||||
Specifies the sampler to be used when sampling traces. The available samplers are: const, probabilistic, ratelimiting, remote. _**default:**_ const
|
||||
|
|
|
@ -64,6 +64,9 @@ jaeger-endpoint
|
|||
# specifies the service name to use for any traces created, Default: nginx
|
||||
jaeger-service-name
|
||||
|
||||
# specifies the traceparent/tracestate propagation format
|
||||
jaeger-propagation-format
|
||||
|
||||
# specifies the sampler to be used when sampling traces.
|
||||
# The available samplers are: const, probabilistic, ratelimiting, remote, Default: const
|
||||
jaeger-sampler-type
|
||||
|
|
|
@ -562,6 +562,9 @@ type Configuration struct {
|
|||
// Default: nginx
|
||||
JaegerServiceName string `json:"jaeger-service-name"`
|
||||
|
||||
// JaegerPropagationFormat specifies the traceparent/tracestate propagation format
|
||||
JaegerPropagationFormat string `json:"jaeger-propagation-format"`
|
||||
|
||||
// JaegerSamplerType specifies the sampler to be used when sampling traces.
|
||||
// The available samplers are: const, probabilistic, ratelimiting, remote
|
||||
// Default: const
|
||||
|
@ -867,6 +870,7 @@ func NewDefault() Configuration {
|
|||
ZipkinServiceName: "nginx",
|
||||
ZipkinSampleRate: 1.0,
|
||||
JaegerCollectorPort: 6831,
|
||||
JaegerPropagationFormat: "jaeger",
|
||||
JaegerServiceName: "nginx",
|
||||
JaegerSamplerType: "const",
|
||||
JaegerSamplerParam: "1",
|
||||
|
|
|
@ -1033,6 +1033,7 @@ const zipkinTmpl = `{
|
|||
|
||||
const jaegerTmpl = `{
|
||||
"service_name": "{{ .JaegerServiceName }}",
|
||||
"propagation_format": "{{ .JaegerPropagationFormat }}",
|
||||
"sampler": {
|
||||
"type": "{{ .JaegerSamplerType }}",
|
||||
"param": {{ .JaegerSamplerParam }},
|
||||
|
|
|
@ -17,6 +17,8 @@ limitations under the License.
|
|||
package settings
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
|
@ -33,6 +35,7 @@ const (
|
|||
|
||||
jaegerCollectorHost = "jaeger-collector-host"
|
||||
jaegerSamplerHost = "jaeger-sampler-host"
|
||||
jaegerPropagationFormat = "jaeger-propagation-format"
|
||||
// jaegerEndpoint = "jaeger-endpoint"
|
||||
|
||||
datadogCollectorHost = "datadog-collector-host"
|
||||
|
@ -175,6 +178,36 @@ var _ = framework.IngressNginxDescribe("Configure OpenTracing", func() {
|
|||
assert.NotContains(ginkgo.GinkgoT(), log, "Unexpected failure reloading the backend", "reloading nginx after a configmap change")
|
||||
})
|
||||
|
||||
ginkgo.It("should propagate the w3c header when configured with jaeger", func() {
|
||||
host := "jaeger-w3c"
|
||||
config := map[string]string{}
|
||||
config[enableOpentracing] = "true"
|
||||
config[jaegerCollectorHost] = "127.0.0.1"
|
||||
config[jaegerPropagationFormat] = "w3c"
|
||||
f.SetNginxConfigMapData(config)
|
||||
|
||||
framework.Sleep(10 * time.Second)
|
||||
log, err := f.NginxLogs()
|
||||
assert.Nil(ginkgo.GinkgoT(), err, "obtaining nginx logs")
|
||||
assert.NotContains(ginkgo.GinkgoT(), log, "Unexpected failure reloading the backend", "reloading nginx after a configmap change")
|
||||
|
||||
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, nil)
|
||||
f.EnsureIngress(ing)
|
||||
|
||||
f.WaitForNginxServer(host,
|
||||
func(server string) bool {
|
||||
return strings.Contains(server, fmt.Sprintf("server_name %s ;", host))
|
||||
})
|
||||
|
||||
f.HTTPTestClient().
|
||||
GET("/").
|
||||
WithHeader("Host", host).
|
||||
Expect().
|
||||
Status(http.StatusOK).
|
||||
Body().
|
||||
Match("traceparent=[0-9a-f]{2}-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}")
|
||||
})
|
||||
|
||||
/*
|
||||
ginkgo.It("should enable opentracing using jaeger with an HTTP endpoint", func() {
|
||||
config := map[string]string{}
|
||||
|
|
Loading…
Reference in a new issue