Enforcing the InstrumentationOption on all Tracer Operations#3620
Conversation
There was a problem hiding this comment.
Code Health Improved
(1 files improve in Code Health)
Gates Failed
Enforce critical code health rules
(1 file with Bumpy Road Ahead)
Enforce advisory code health rules
(1 file with Complex Method)
Gates Passed
2 Quality Gates Passed
See analysis details in CodeScene
Reason for failure
| Enforce critical code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| BrighterTracer.cs | 1 critical rule | 8.82 → 9.22 | Suppress |
| Enforce advisory code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| BrighterTracer.cs | 1 advisory rule | 8.82 → 9.22 | Suppress |
View Improvements
| File | Code Health Impact | Categories Improved |
|---|---|---|
| BrighterTracer.cs | 8.82 → 9.22 | Code Duplication |
Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.
|
@iancooper can you please give me your initial thoughts on this approach, the biggest questions I have are around what we should be filtering with each Flag, should we be creating more flags? |
There was a problem hiding this comment.
Code Health Improved
(1 files improve in Code Health)
Gates Failed
Enforce critical code health rules
(1 file with Bumpy Road Ahead)
Enforce advisory code health rules
(1 file with Complex Method)
Gates Passed
2 Quality Gates Passed
See analysis details in CodeScene
Reason for failure
| Enforce critical code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| BrighterTracer.cs | 1 critical rule | 8.82 → 9.22 | Suppress |
| Enforce advisory code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| BrighterTracer.cs | 1 advisory rule | 8.82 → 9.22 | Suppress |
View Improvements
| File | Code Health Impact | Categories Improved |
|---|---|---|
| BrighterTracer.cs | 8.82 → 9.22 | Code Duplication |
Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.
I think the approach here is sensible. I would suspect we need "just enough" flags. So I think that database information is sensible as it drifts into another domain etc. I guess, we don't want to make configuring this a lot of work, but we do want to let you (a) reduce the noise/cost (b) remove things that might be insecure (i.e. message contents) from telemetry. |
c39ec95 to
e6a8dbd
Compare
There was a problem hiding this comment.
Gates Failed
Enforce critical code health rules
(1 file with Low Cohesion, Bumpy Road Ahead)
Enforce advisory code health rules
(1 file with Complex Method)
Gates Passed
2 Quality Gates Passed
See analysis details in CodeScene
Reason for failure
| Enforce critical code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| BrighterTracer.cs | 2 critical rules | 8.82 → 8.14 | Suppress |
| Enforce advisory code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| BrighterTracer.cs | 1 advisory rule | 8.82 → 8.14 | Suppress |
Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.
e6a8dbd to
304ca32
Compare
There was a problem hiding this comment.
Gates Failed
Enforce critical code health rules
(1 file with Low Cohesion, Bumpy Road Ahead)
Enforce advisory code health rules
(1 file with Complex Method)
Gates Passed
2 Quality Gates Passed
See analysis details in CodeScene
Reason for failure
| Enforce critical code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| BrighterTracer.cs | 2 critical rules | 8.82 → 7.65 | Suppress |
| Enforce advisory code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| BrighterTracer.cs | 1 advisory rule | 8.82 → 7.65 | Suppress |
Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.
304ca32 to
71a3b16
Compare
There was a problem hiding this comment.
Gates Failed
Enforce critical code health rules
(1 file with Low Cohesion, Bumpy Road Ahead)
Enforce advisory code health rules
(1 file with Complex Method, Overall Code Complexity)
Gates Passed
2 Quality Gates Passed
See analysis details in CodeScene
Reason for failure
| Enforce critical code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| BrighterTracer.cs | 2 critical rules | 8.82 → 7.09 | Suppress |
| Enforce advisory code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| BrighterTracer.cs | 2 advisory rules | 8.82 → 7.09 | Suppress |
Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.
| var now = _timeProvider.GetUtcNow(); | ||
|
|
||
| var tags = new ActivityTagsCollection | ||
| var tags = GetNewTagsCollection(options); |
There was a problem hiding this comment.
❌ New issue: Low Cohesion
This module has at least 3 different responsibilities amongst its 25 functions, threshold = 3
| if (!string.IsNullOrEmpty(info.serverAddress)) tags.Add(BrighterSemanticConventions.ServerAddress, info.serverAddress); | ||
| if (info.networkPeerPort != 0) tags.Add(BrighterSemanticConventions.NetworkPeerPort, info.networkPeerPort); | ||
| if (info.serverPort != 0) tags.Add(BrighterSemanticConventions.ServerPort, info.serverPort); | ||
| var tags = GetNewTagsCollection(options, BrighterSemanticConventions.DbInstrumentationDomain); |
There was a problem hiding this comment.
❌ Getting worse: Complex Method
CreateDbSpan increases in cyclomatic complexity from 11 to 12, threshold = 9
|
|
||
| /// <inheritdoc /> | ||
| public Activity? CreateClaimCheckSpan(ClaimCheckSpanInfo info) | ||
| public Activity? CreateClaimCheckSpan(ClaimCheckSpanInfo info, InstrumentationOptions options = InstrumentationOptions.All) |
There was a problem hiding this comment.
❌ New issue: Bumpy Road Ahead
CreateClaimCheckSpan has 2 blocks with nested conditional logic. Any nesting of 2 or deeper is considered. Threshold is one single, nested block per function
| if (!string.IsNullOrEmpty(info.serverAddress)) tags.Add(BrighterSemanticConventions.ServerAddress, info.serverAddress); | ||
| if (info.networkPeerPort != 0) tags.Add(BrighterSemanticConventions.NetworkPeerPort, info.networkPeerPort); | ||
| if (info.serverPort != 0) tags.Add(BrighterSemanticConventions.ServerPort, info.serverPort); | ||
| var tags = GetNewTagsCollection(options, BrighterSemanticConventions.DbInstrumentationDomain); |
There was a problem hiding this comment.
❌ New issue: Bumpy Road Ahead
CreateDbSpan has 2 blocks with nested conditional logic. Any nesting of 2 or deeper is considered. Threshold is one single, nested block per function
| var now = _timeProvider.GetUtcNow(); | ||
|
|
||
| var tags = new ActivityTagsCollection | ||
| var tags = GetNewTagsCollection(options); |
There was a problem hiding this comment.
❌ New issue: Overall Code Complexity
This module has a mean cyclomatic complexity of 4.28 across 25 functions. The mean complexity threshold is 4
|
This latest push should have the outlines of everything that needs to be done, Some observations would be
|
71a3b16 to
98e7af0
Compare
There was a problem hiding this comment.
Gates Failed
Enforce critical code health rules
(1 file with Low Cohesion, Bumpy Road Ahead)
Enforce advisory code health rules
(1 file with Complex Method, Overall Code Complexity)
Gates Passed
2 Quality Gates Passed
See analysis details in CodeScene
Reason for failure
| Enforce critical code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| BrighterTracer.cs | 2 critical rules | 8.82 → 7.09 | Suppress |
| Enforce advisory code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| BrighterTracer.cs | 2 advisory rules | 8.82 → 7.09 | Suppress |
Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.
There was a problem hiding this comment.
Gates Failed
Enforce critical code health rules
(1 file with Low Cohesion, Bumpy Road Ahead)
Enforce advisory code health rules
(1 file with Complex Method, Overall Code Complexity)
Gates Passed
2 Quality Gates Passed
See analysis details in CodeScene
Reason for failure
| Enforce critical code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| BrighterTracer.cs | 2 critical rules | 8.82 → 7.09 | Suppress |
| Enforce advisory code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| BrighterTracer.cs | 2 advisory rules | 8.82 → 7.09 | Suppress |
Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.
# Conflicts: # src/Paramore.Brighter/WrapPipeline.cs # src/Paramore.Brighter/WrapPipelineAsync.cs # tests/Paramore.Brighter.Core.Tests/Observability/Archive/When_archiving_from_the_outbox.cs # tests/Paramore.Brighter.Core.Tests/Observability/Archive/When_archiving_from_the_outbox_async.cs # tests/Paramore.Brighter.Core.Tests/Observability/CommandProcessor/Clear/When_Clearing_A_Message_A_Span_Is_Exported.cs
80cbe43 to
2fe73f7
Compare
There was a problem hiding this comment.
Gates Failed
Enforce critical code health rules
(1 file with Low Cohesion, Bumpy Road Ahead)
Enforce advisory code health rules
(1 file with Complex Method, Overall Code Complexity)
Gates Passed
2 Quality Gates Passed
See analysis details in CodeScene
Reason for failure
| Enforce critical code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| BrighterTracer.cs | 2 critical rules | 8.82 → 7.09 | Suppress |
| Enforce advisory code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| BrighterTracer.cs | 2 advisory rules | 8.82 → 7.09 | Suppress |
Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.
|
A lot of work @preardon. Going to merge in, so that we can get ready to cut RC1 |
…rCommand#3620) * Plumb in Instrumentation Options # Conflicts: # src/Paramore.Brighter/WrapPipeline.cs # src/Paramore.Brighter/WrapPipelineAsync.cs # tests/Paramore.Brighter.Core.Tests/Observability/Archive/When_archiving_from_the_outbox.cs # tests/Paramore.Brighter.Core.Tests/Observability/Archive/When_archiving_from_the_outbox_async.cs # tests/Paramore.Brighter.Core.Tests/Observability/CommandProcessor/Clear/When_Clearing_A_Message_A_Span_Is_Exported.cs * Add XML Comments * Fix rebase issues
enforcing the InstrumentationOption on all Tracer Operations