Skip to content

Commit

Permalink
Merge pull request #428 from hellofresh/patch/env-var-fix
Browse files Browse the repository at this point in the history
split TRACING_JAEGER_SAMPLING_SERVER_URL to two env vars
  • Loading branch information
Ashley Schuett authored Dec 19, 2019
2 parents e877c17 + e7bedb0 commit 10d2b39
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@

--

# 3.8.19

## Added
- Added `JAEGER_AGENT_HOST` and `JAEGER_AGENT_PORT` environment variable to allow specifying host and port separately instead of as the full URL.
-- Note: you are still able to specify `TRACING_JAEGER_SAMPLING_SERVER_URL`

# 3.8.13, 3.8.14, 3.8.15, 3.8.16, 3.8.17, 3.8.18

## Added
- experimental helm charts

# 3.8.12

## Changed
Expand Down
8 changes: 7 additions & 1 deletion cmd/init.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cmd

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
Expand Down Expand Up @@ -199,8 +200,13 @@ func initTracingExporter() {
}

func initJaegerExporter() (err error) {
jaegerURL := globalConfig.Tracing.JaegerTracing.SamplingServerURL
if jaegerURL == "" {
jaegerURL = fmt.Sprintf("%s:%s", globalConfig.Tracing.JaegerTracing.SamplingServerHost, globalConfig.Tracing.JaegerTracing.SamplingServerPort)
}

jaegerExporter, err := jaeger.NewExporter(jaeger.Options{
AgentEndpoint: globalConfig.Tracing.JaegerTracing.SamplingServerURL,
AgentEndpoint: jaegerURL,
ServiceName: globalConfig.Tracing.ServiceName,
})
if err != nil {
Expand Down
4 changes: 3 additions & 1 deletion pkg/config/specification.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ type Tracing struct {

// JaegerTracing holds the Jaeger tracing configuration
type JaegerTracing struct {
SamplingServerURL string `envconfig:"TRACING_JAEGER_SAMPLING_SERVER_URL"`
SamplingServerURL string `envconfig:"TRACING_JAEGER_SAMPLING_SERVER_URL"`
SamplingServerHost string `envconfig:"JAEGER_AGENT_HOST"`
SamplingServerPort string `envconfig:"JAEGER_AGENT_PORT"`
}

func init() {
Expand Down

0 comments on commit 10d2b39

Please sign in to comment.