-
Notifications
You must be signed in to change notification settings - Fork 116
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
Support for custom markers #1375
Comments
Hi there, the Capistrano will only send deploy markers (and that feature is deprecated in for of the revision config option). You can send markers using an HTTP request, as documented on this page. |
@tombruijn I know I can use HTTP API, but this is very inconvenient. It requires setting up a personal access token, and using an HTTP client - all while Appsignal is already active in Capistrano context, has the push API key present, and could be easily modified for the purpose of submitting a custom (non-deployment) marker. All that's needed is simple: allow the general push API key to submit custom markers (not just deploy markers), and expose a method to add a custom marker via The personal access token part is pretty bad in particular. A PAT gives access to ALL my projects across ALL organizations. It's not safe to share like a push API key is.
Why is it deprecated? I do use |
The Push API's markers endpoint (the one used by the Capistrano integration) is not one we want to modify to support reporting custom markers. As mentioned before, it's a deprecated endpoint that we'd like to remove, because that way of reporting deploys is inaccurate, more details below.
Fair point about using a PAT. We're considering adding an endpoint for on the public endpoint API to report custom markers. On that API, authentication works with a Push API key + app and environment, or Front-end API key. I think that would resolve the issue with the PAT permissions.
For context: Deploy markers created through that Push API's markers endpoint are a leftover from a very long time ago. It's been internally deprecated for a long time and we removed functionality like the appsignal notify_of_deploy CLI command many version ago. It's only in the Capistrano integration and others because some customers still rely on it, but we'd like to remove it. The moment a deploy gets reported via a deploy marker via the HTTP endpoint, and when a new deploy actually starts reporting data, is not the same. We have issues where data from new and old deploys gets asssigned to the wrong deploy due to this timing issue. The deploy marker reporting via Push API's markers endpoint also makes reporting data from applications simultaneously running multiple revisions of their application difficult. If data from an older deploy is coming in after a new deploy marker is created via the Push API markers endpoint, it will get wrongly assigned to the new deploy. No such problem with the You say you're already using the With the Public endpoint solution I described above I think we can include a wrapper around our HTTP transmitter in the Ruby gem to send a custom marker so you don't need to do this yourself. I imagine something like: Appsignal::CustomMarker.report(
:message => "Deploy abcdef123 completed by Damian from PersonalLaptop",
:icon => "🚢",
:created_at => Time.now.utc.iso8601
) I can't provide an ETA on when we'll at that endpoint. |
Add a helper class that calls our Public Endpoint API to create custom markers. This helper is added to give people a method to report custom markers from the Ruby gem. We have chosen to do this through the public endpoint and not the Push API, because it's better fits the data flow we want. It does not support reporting deploy markers, because we only want to report those through the `revision` config option. This request is authenticated with the Push API key, app name and app environment as query parameters, which is supported by the Public Endpoint API, similar to how we report check ins. The 'normal' API requires a Personal Access Token, which gives a lot of access to the reported data. This method uses a write only authentication method. Related work: - Public Endpoint PR: appsignal/appsignal-processor-rs#1679 - Docs PR: appsignal/appsignal-docs#2419 Closes #1375
Add a helper class that calls our Public Endpoint API to create custom markers. This helper is added to give people a method to report custom markers from the Ruby gem. We have chosen to do this through the public endpoint and not the Push API, because it's better fits the data flow we want. It does not support reporting deploy markers, because we only want to report those through the `revision` config option. This request is authenticated with the Push API key, app name and app environment as query parameters, which is supported by the Public Endpoint API, similar to how we report check ins. The 'normal' API requires a Personal Access Token, which gives a lot of access to the reported data. This method uses a write only authentication method. Related work: - Public Endpoint PR: appsignal/appsignal-processor-rs#1679 - Docs PR: appsignal/appsignal-docs#2419 Closes #1375
Add a helper class that calls our Public Endpoint API to create custom markers. This helper is added to give people a method to report custom markers from the Ruby gem. We have chosen to do this through the public endpoint and not the Push API, because it's better fits the data flow we want. It does not support reporting deploy markers, because we only want to report those through the `revision` config option. This request is authenticated with the Push API key, app name and app environment as query parameters, which is supported by the Public Endpoint API, similar to how we report check ins. The 'normal' API requires a Personal Access Token, which gives a lot of access to the reported data. This method uses a write only authentication method. Related work: - Public Endpoint PR: appsignal/appsignal-processor-rs#1679 - Docs PR: appsignal/appsignal-docs#2419 Closes #1375
Hi @Nowaker, we've just published Ruby gem 4.5.0 with a new helper to create custom markers via the public endpoint API (added in #1378) which I described in my previous comment. |
Nice. Thanks. :)
Yeah, using both. No issues. What would the issues be, really? Appsignal correctly recognizes the revision of code running in a given process. ...Or so I think? |
I expect no problems, but I honestly never tried that before. It only applies the deploy marker from the HTTP request if the trace has no revision already. Ignore I brought it up 😅 |
I'd like to add custom markers in certain Capistrano tasks. Currently, Appsignal gem can only submit deployment markers - and this is not what I'm looking for.
The text was updated successfully, but these errors were encountered: