-
Notifications
You must be signed in to change notification settings - Fork 330
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
[ENC-2031] Add new 'encore:trace' annotation + Other small changes #1022
Open
DomBlack
wants to merge
4
commits into
main
Choose a base branch
from
enc-2031-add-support-to-collect-otel-spans
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,687
−1,062
Conversation
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
All committers have signed the CLA. |
Test Results 2 files + 1 230 suites +66 16m 20s ⏱️ - 9m 56s Results for commit 5fc2277. ± Comparison against base commit 0f6f384. This pull request removes 41 and adds 230 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
+1 on this. this would be really helpful! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR contains several changes;
New
//encore:trace
AnnotationAny function can now be annotated with
//encore:trace
and will automatically be picked up as a span in Encore's tracing system, even if it is called outside of the context of a API request, PubSub consumer or test. (i.e. this means your background processes, such as a temporal worker can now be annotated! 🎉 )The annotation supports two options parameters:
name
; by default this is the package name and function name, but if overridden becomes what ever you set this to. This can be a string with no whitespace (likeping_google
) or a quoted string with whitespace (like"Wait for message to match"
).type
: by default this isinternal
, however the following additional types are supported;request_handler
,call
,producer
&consumer
. The only effect of using these types is a change of icon within the trace UI.All request parameters and response data are automatically captured into the trace and the last
error
return type is used to indicate if the span was successful or not.Example Uses
Screenshots
A call made to
systemStartup
from a background thread is seen as a new tracego-routine-4
andwait for message to match
are both marked as traced, and you can see API calls made within them as separate spansAll parameters and response variables are captured, including the error state
The Dash API now caches the last known compile error
This change was requested by @simon-johansson so that when you navigate pages in the dashboard and change between running apps, the UI can show if the app currently has a compile error or not. Previously the behaviour was the UI would show the app running fine as nothing cached the error state or not.
The error is now also aways syntax highlighted (there was a bug where the daemon wasn't running in a process which supported colour, so it defaulted to no colour, even though we know web browsers support color).
Addition of a new JSON schema for the
encore.app
fileThe schema is already live at https://encore.dev/schemas/appfile.schema.json - however now when new apps are created we'll automatically add the
$schema
tag as the first tag, which means editors like IntelliJ, GoLand and VSCode will automatically provide autocompletitions and documentation for theencore.app
file.Model Design for a new Go Trace system
There's also an unused file being committed which includes a model design for a new tracing system which would be compatible with OpenTelemtry that @eandre will pickup and full flush out in future PR's