Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci-docker-all-in-one.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ jobs:
mode:
- name: v1
binary: all-in-one
skip_healthcheck: true
- name: v2
binary: jaeger
skip_healthcheck: false

steps:
- name: Harden Runner
Expand Down Expand Up @@ -74,3 +76,4 @@ jobs:
env:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}
SKIP_HEALTHCHECK: ${{ matrix.mode.skip_healthcheck }}
36 changes: 29 additions & 7 deletions cmd/all-in-one/all_in_one_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,21 @@ import (
)

// These tests are only run when the environment variable TEST_MODE=integration is set.
// An optional SKIP_SAMPLING=true environment variable can be used to skip sampling checks (for jaeger-v2).

const (
host = "0.0.0.0"
queryPort = "16686"
agentPort = "5778"
queryAddr = "http://" + host + ":" + queryPort
agentAddr = "http://" + host + ":" + agentPort
host = "0.0.0.0"
queryPort = "16686"
agentPort = "5778"
healthPort = "13133"
queryAddr = "http://" + host + ":" + queryPort
agentAddr = "http://" + host + ":" + agentPort
healthAddr = "http://" + host + ":" + healthPort

getServicesURL = "/api/services"
getTraceURL = "/api/traces/"
getServicesAPIV3URL = "/api/v3/services"
getSamplingStrategyURL = "/sampling?service=whatever"
getHealthURL = "/status"
)

var traceID string // stores state exchanged between createTrace and getAPITrace
Expand All @@ -52,7 +54,7 @@ func TestAllInOne(t *testing.T) {

// Check if the query service is available
healthCheck(t)

healthCheckV2(t)
t.Run("checkWebUI", checkWebUI)
t.Run("createTrace", createTrace)
t.Run("getAPITrace", getAPITrace)
Expand All @@ -77,6 +79,26 @@ func healthCheck(t *testing.T) {
t.Logf("Server detected at %s", queryAddr)
}

func healthCheckV2(t *testing.T) {
if os.Getenv("SKIP_HEALTHCHECK") == "true" {
t.Skip("Skipping health check for V1 Binary")
}
require.Eventuallyf(
t,
func() bool {
resp, err := http.Get(healthAddr + getHealthURL)
if err == nil {
resp.Body.Close()
}
return err == nil
},
10*time.Second,
time.Second,
"expecting health endpoint to be healhty",
)
t.Logf("V2-HealthCheck Server detected at %s", healthAddr)
}

func httpGet(t *testing.T, url string) (*http.Response, []byte) {
t.Logf("Executing HTTP GET %s", url)
req, err := http.NewRequest(http.MethodGet, url, nil)
Expand Down
7 changes: 6 additions & 1 deletion cmd/jaeger/internal/all-in-one.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
service:
extensions: [jaeger_storage, jaeger_query, remote_sampling]
extensions: [jaeger_storage, jaeger_query, remote_sampling, healthcheckv2]
pipelines:
traces:
receivers: [otlp, jaeger, zipkin]
Expand Down Expand Up @@ -33,6 +33,11 @@ extensions:
# initial_sampling_probability: 0.1
http:
grpc:

healthcheckv2:
use_v2: true
http:
grpc:

receivers:
otlp:
Expand Down
2 changes: 2 additions & 0 deletions cmd/jaeger/internal/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector"
"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/kafkaexporter"
"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter"
"github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckv2extension"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkareceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver"
Expand Down Expand Up @@ -61,6 +62,7 @@ func (b builders) build() (otelcol.Factories, error) {
// standard
ballastextension.NewFactory(),
zpagesextension.NewFactory(),
healthcheckv2extension.NewFactory(),
// add-ons
jaegerquery.NewFactory(),
jaegerstorage.NewFactory(),
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ require (
github.com/mostynb/go-grpc-compression v1.2.3 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckv2extension v0.107.0
github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.107.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.107.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/kafka v0.107.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,8 @@ github.com/open-telemetry/opentelemetry-collector-contrib/exporter/kafkaexporter
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/kafkaexporter v0.107.0/go.mod h1:gMY05z3fY6HnL/vNfyVYl3w4eihI8DftosfHuxqEeTg=
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter v0.107.0 h1:g4LloH7qCMZfahxep5dKU9U18RnHGYsDw+/BQkzg9ts=
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter v0.107.0/go.mod h1:+oXUZlAMk5MepQpL7OJiLEUyugPFlmCs8kL/ciaERAs=
github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckv2extension v0.107.0 h1:qAJyEY8c0OwAaX/avNOI1Ovoh2oRu744WXdlm6oefBc=
github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckv2extension v0.107.0/go.mod h1:6LO3bm94bdTS6W7d2vuYboDNtPzspTJBDZRema1gBb4=
github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.107.0 h1:ng+d8RpXN+cUUJTn1yA2xmXCEah0o7BsGzwsm3fDSsw=
github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.107.0/go.mod h1:pc5uB5lbPTNddFYA0bYy0TYkp4Yjh4teYXBPsRL2/Rk=
github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.107.0 h1:NKH1JyZbqUSDGbIVqTyGJclmdnp6v4TQYfLhNI4tZno=
Expand Down