-
-
Notifications
You must be signed in to change notification settings - Fork 168
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: add asyncapi file birth timestamp in metrics collection. #1304
Merged
Merged
Changes from 18 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
d427f8a
all changes
KhudaDad414 a7d643f
Merge remote-tracking branch 'origin/master'
KhudaDad414 6f3d884
clean up
KhudaDad414 45d75c1
cleanup
KhudaDad414 069ff7e
remove log
KhudaDad414 61b377b
cleanup
KhudaDad414 2a05e2c
use the specFile
KhudaDad414 2d59316
cleanup
KhudaDad414 c94ba89
Merge branch 'master' into master
KhudaDad414 e6d24cc
Empty-Commit
KhudaDad414 a378070
Merge branch 'master' into master
KhudaDad414 639c2f2
Merge branch 'master' into master
KhudaDad414 f3489f0
us promises.
KhudaDad414 ef10156
Merge branch 'master' into master
KhudaDad414 864fd16
Merge branch 'master' into master
Souvikns 20bde8a
Merge branch 'master' into master
Souvikns 707d973
Merge branch 'master' into master
KhudaDad414 aca055c
Empty-Commit
KhudaDad414 7036576
clarify message.
KhudaDad414 32ffd28
clarify.
KhudaDad414 10d2ca7
Merge branch 'master' into master
KhudaDad414 0a00ca9
Merge branch 'master' into master
Souvikns 3c54f10
Merge branch 'master' into master
KhudaDad414 276da22
Merge branch 'master' into master
KhudaDad414 d6e06f5
Merge branch 'master' into master
asyncapi-bot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,4 @@ spec-examples.zip | |
# Coverage for testing | ||
|
||
coverage | ||
.asyncapi-analytics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What are the possible errors we could find here? File doesn't exist maybe? We don't have permission to access the file?
I have the feeling we should control (and report to New Relic) failures here.
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.
Since this function is ultimately being called from the
finally
method of thecommand
with a file path, If there is any error with the file, We expect that the current call is actually reporting the error.(strange sentence, hope it makes sense. 😆 )
clarified the comment in the code.
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.
Just one question on this topic: if there is an error with the file, is it handled at the
catch
method as well, apart from thefinally
method? 🤔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.
@peter-rr if by "handled" you mean reporting to New Relic, then it is only being done in
finally
since it will run regardless of errors.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.
@KhudaDad414 @peter-rr It's generally considered best practice to handle errors as close to their source as possible. This helps maintain clear code structure and makes it easier to understand and reason about error handling logic, in this case having some exception type checks under the
catch
would help.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.
@Amzani this is how I understand the CLI would work when an error happens:
catch
method will log the error.finally
method will report it to New Relic.setSouce
is being called from thefinally
method. so the same error that caused thefinally
method to run will occur again. If the error is already logged and is being reported to New Relic, I am failing to understand why it should be handled and not be ignored here.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.
I would need some clarification here: are we all talking about the
catch
method from the class, or thecatch
block inside thesetSource
method?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.
I am saying that if there is an error with the file, we expect the command to throw an error,
catch
method inside the class will log the error, andfinally
method will report it.Since The
setSource
is called from thefinally
method, it is unnecessary to do anything inside of it'scatch
block.If we log it, we have logged it twice, if we initiate a report we have reported it twice.
One time by command trying to access the file and throwing the error and one time by us trying to access it here.
Hope it is clear now.