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
fix: Fixing Analyzer Rules and Updating Values #2738
fix: Fixing Analyzer Rules and Updating Values #2738
Conversation
@@ -13,7 +13,8 @@ type ensuresDnsUsage struct { | |||
} | |||
|
|||
var ( | |||
dnsFields = []string{"net.peer.name", "http.url", "db.connection_string", "net.sock.peer.addr", "net.host.name"} | |||
clientDnsFields = []string{"net.peer.name"} | |||
dnsFields = []string{"http.url", "db.connection_string"} |
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.
net.peer.name
is only required for client spans
@@ -22,7 +22,7 @@ func NewEnforceHttpsProtocolRule() model.Rule { | |||
Name: "Enforce HTTPS Protocol", | |||
Description: "Ensure all request use https", | |||
Tips: []string{}, | |||
Weight: 40, | |||
Weight: 20, |
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.
Updating the weight
for _, span := range trace.Flat { | ||
results = append(results, r.validateSpanName(ctx, span)) | ||
result := r.validateSpanName(ctx, span) |
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.
We had an issue here that we never reported 100% pass for this rule
} else { | ||
expectedName = fmt.Sprintf("%s %s", dbOperation, dbName) | ||
// TODO: fix this by adding proper validation for all other db systems | ||
dbSystem := span.Attributes.Get("db.system") |
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.
For Redis, we have to match the prefix of the statement to validate the name. This should be improved in the future to run checks by db system
@@ -12,7 +12,7 @@ var ( | |||
httpAttrServer = []string{"http.target", "http.scheme", "net.host.name"} | |||
|
|||
databaseAttr = []string{"db.system"} | |||
rpcAttr = []string{"rpc.system", "neet.peer.name"} |
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.
NEEET
@@ -1,3 +1,3 @@ | |||
{ | |||
"proto": "syntax = \"proto3\";\n\noption java_multiple_files = true;\noption java_outer_classname = \"PokeshopProto\";\noption objc_class_prefix = \"PKS\";\n\npackage pokeshop;\n\nservice Pokeshop {\n rpc getPokemonList (GetPokemonRequest) returns (GetPokemonListResponse) {}\n rpc createPokemon (Pokemon) returns (Pokemon) {}\n rpc importPokemon (ImportPokemonRequest) returns (ImportPokemonRequest) {}\n}\n\nmessage ImportPokemonRequest {\n int32 id = 1;\n}\n\nmessage GetPokemonRequest {\n optional int32 skip = 1;\n optional int32 take = 2;\n}\n\nmessage GetPokemonListResponse {\n repeated Pokemon items = 1;\n int32 totalCount = 2;\n}\n\nmessage Pokemon {\n optional int32 id = 1;\n string name = 2;\n string type = 3;\n bool isFeatured = 4;\n optional string imageUrl = 5;\n}\n" | |||
"proto": "syntax = \"proto3\";\n\noption java_multiple_files = true;\noption java_outer_classname = \"PokeshopProto\";\noption objc_class_prefix = \"PKS\";\n\npackage pokeshop;\n\nservice Pokeshop {\n rpc getPokemonList (GetPokemonRequest) returns (GetPokemonListResponse) {}\n rpc createPokemon (Pokemon) returns (Pokemon) {}\n rpc importPokemon (ImportPokemonRequest) returns (ImportPokemonRequest) {}\n}\n\nmessage ImportPokemonRequest {\n int32 id = 1;\n optional bool isFixed = 2;\n}\n\nmessage GetPokemonRequest {\n optional int32 skip = 1;\n optional int32 take = 2;\n optional bool isFixed = 3;\n}\n\nmessage GetPokemonListResponse {\n repeated Pokemon items = 1;\n int32 totalCount = 2;\n}\n\nmessage Pokemon {\n optional int32 id = 1;\n string name = 2;\n string type = 3;\n bool isFeatured = 4;\n optional string imageUrl = 5;\n}" |
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.
Adding support for the isFixed
flag
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.
In the near future, we should change this to read it directly from the repo to have to do this copy paste
This PR updates the analyzer rules to better match the semantic conventions.
Changes
isFixed
flagFixes
Checklist