-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
pkg/trace/event: make event service & operation matching insensitive #3113
Conversation
b597214
to
d8bd1bb
Compare
pkg/trace/config/config.go
Outdated
@@ -101,7 +101,7 @@ type AgentConfig struct { | |||
// It maps tag keys to a set of replacements. Only supported in A6. | |||
ReplaceTags []*ReplaceRule | |||
|
|||
// transaction analytics | |||
// transaction analytics, all map keys are lower-cased by Viper. |
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.
Maybe we should enforce it ourselves on top of Viper? I don't like the fact that we depend so much on a side effect of a dependency. If Viper changes its behavior, extracting events for all uppercase names will break but none of our tests will catch it (at least as far as I can tell).
I agree with your concern. How about if I were to add a specific test for
it? Reading from a yaml with caps asserting that it gets lowercased? Also
note that we have vendored Viper to the repository DataDog/Viper so it’s
technically under our hands and with the added test we should be good to
go. WDYT?
…On Mon, 4 Mar 2019 at 15:05, Bertrand Mermet ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In pkg/trace/config/config.go
<#3113 (comment)>
:
> @@ -101,7 +101,7 @@ type AgentConfig struct {
// It maps tag keys to a set of replacements. Only supported in A6.
ReplaceTags []*ReplaceRule
- // transaction analytics
+ // transaction analytics, all map keys are lower-cased by Viper.
Maybe we should enforce it ourselves on top of Viper? I don't like the
fact that we depend so much on a side effect of a dependency. If Viper
changes its behavior, extracting events for all uppercase names will break
but none of our tests will catch it (at least as far as I can tell).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3113 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGYGlDr8agdx_g2ko2yWNE4QtI3jPXoDks5vTRougaJpZM4bcQ6D>
.
|
Codecov Report
@@ Coverage Diff @@
## master #3113 +/- ##
=========================================
- Coverage 56.03% 54.23% -1.8%
=========================================
Files 407 540 +133
Lines 30189 38383 +8194
=========================================
+ Hits 16917 20818 +3901
- Misses 12424 16324 +3900
- Partials 848 1241 +393
|
I agree that having an E2E test from config to the extractor is the best safeguard. Otherwise simply applying |
I chose your latter suggestion and lower-cased all the keys on constructing these extractors. I guess from an API standpoint this is the best approach anyway. Let me know what you think. |
faa54f8
to
63734f6
Compare
This change makes `apm_config.analyzed_rate_by_service` and `apm_config.analyzed_spans` entries case insensitive. The reasoning behind this is that Viper always lower-cases keys in the yaml file, make it impossible to compare against the orginal value. See spf13/viper#411.
63734f6
to
8208fda
Compare
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.
LGTM 👍
…3113) * pkg/trace/event: make event service & operation matchin insensitive This change makes `apm_config.analyzed_rate_by_service` and `apm_config.analyzed_spans` entries case insensitive. The reasoning behind this is that Viper always lower-cases keys in the yaml file, make it impossible to compare against the orginal value. See spf13/viper#411.
This change makes
apm_config.analyzed_rate_by_service
andapm_config.analyzed_spans
entries case insensitive.
The reasoning behind this is that Viper always lower-cases keys in the yaml file,
making it impossible to make case-sensitive comparisons against the orginal value.
See spf13/viper#411.