-
-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(tracing): Misc. OTel tracing improvements #2485
feat(tracing): Misc. OTel tracing improvements #2485
Conversation
✅ Deploy Preview for go-feature-flag-doc-preview canceled.
|
01c6bd4
to
af87f39
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2485 +/- ##
==========================================
+ Coverage 84.81% 85.34% +0.53%
==========================================
Files 100 100
Lines 4346 4422 +76
==========================================
+ Hits 3686 3774 +88
+ Misses 535 518 -17
- Partials 125 130 +5 ☔ View full report in Codecov by Sentry. |
af87f39
to
08f8002
Compare
ee84488
to
bd6c73c
Compare
Hey @hairyhenderson thanks a lot for this PR. I would prefer to have all those options in the We will still be able to set them via environment variable because we are using |
I've played around with type Config struct {
// ...
OtelConfig OpenTelemetryConfiguration `mapstructure:"otel" koanf:"otel"`
}
type OpenTelemetryConfiguration struct {
SDK struct {
Disabled bool `mapstructure:"disabled" koanf:"disabled"`
} `mapstructure:"sdk" koanf:"sdk"`
Exporter struct {
Otlp struct {
Endpoint string `mapstructure:"endpoint" koanf:"endpoint"`
Protocol string `mapstructure:"protocol" koanf:"protocol"`
} `mapstructure:"otlp" koanf:"otlp"`
} `mapstructure:"exporter" koanf:"exporter"`
Service struct {
Name string `mapstructure:"name" koanf:"name"`
} `mapstructure:"service" koanf:"service"`
Traces struct {
Sampler string `mapstructure:"sampler" koanf:"sampler"`
} `mapstructure:"sampler" koanf:"sampler"`
Resource struct {
Attributes map[string]string `mapstructure:"attributes" koanf:"attributes"`
} `mapstructure:"resource" koanf:"resource"`
} This will allow to continue to set all the configuration through environment variable like you do, but at the same time be able to configure directly inside the configuration file also. What do you think about this idea @hairyhenderson ? |
I'm OK either way... It's somewhat more common (in my experience) to see OTel configured through environment variables, but I understand your desire for both modes. I'm not familiar with |
@hairyhenderson I can do it if you prefer. I am happy to update your PR with the changes if you don't have time. |
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
d2f9e25
to
0909368
Compare
fae9b58
to
1faaed9
Compare
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hairyhenderson I have refactored the configuration part.
We can now merge this PR and it will be available in the next version of GO Feature Flag.
Thanks for this @thomaspoignant!! And sorry I wasn't able to make the changes, things have been busy for me lately 😅 |
@hairyhenderson no worries. |
Description
I ran into a few papercuts while setting up tracing with the relay proxy after getting it up and running with #2482, most notably I use OTLP over gRPC rather than the default
http/protobuf
protocol.So, this PR adds a few improvements:
OTEL_SDK_DISABLED=true
OTEL_EXPORTER_OTLP_ENDPOINT
rather than config flag (but config flag is still supported)OTEL_EXPORTER_OTLP_PROTOCOL
(togrpc
, for example)OTEL_SERVICE_NAME
OTEL_RESOURCE_ATTRIBUTES
env varlog.Print
This also fixes a bug where
apiServer.Stop()
was not properly called. I've also modified the signature to receive a context so we can give the shutdown a 5s timeout.Closes issue(s)
None directly, but related to #2479
Checklist
README.md
and/website/docs
)