-
Notifications
You must be signed in to change notification settings - Fork 82
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
🚀 Restore :revision config #315
Conversation
lib/appsignal/config.ex
Outdated
@@ -214,6 +214,9 @@ defmodule Appsignal.Config do | |||
unless empty?(config[:files_world_accessible]) do | |||
System.put_env("_APPSIGNAL_FILES_WORLD_ACCESSIBLE", to_string(config[:files_world_accessible])) | |||
end | |||
unless empty?(config[:revision]) do | |||
System.put_env("APP_REVISION", to_string(config[:revision])) | |||
end |
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.
This env var should always be set, otherwise the value would persist across releases with the rolling restarts.
But the same problem probably exists for other config options as well.
Moving back to WIP until the review comment is resolved. |
Fixed in f345629. Will fix the other environment variables in a separate PR. |
As discussed in #315.
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.
Elixir code 👍
Requires a small change in the extension.
lib/appsignal/config.ex
Outdated
@@ -214,6 +214,7 @@ defmodule Appsignal.Config do | |||
unless empty?(config[:files_world_accessible]) do | |||
System.put_env("_APPSIGNAL_FILES_WORLD_ACCESSIBLE", to_string(config[:files_world_accessible])) | |||
end | |||
System.put_env("APP_REVISION", to_string(config[:revision])) |
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 think we may need to have this config option be accepted as "empty string == unset" as well in the extension (private link).
It now reports [2018-03-13T11:11:00 (extension) #92120][Debug] Initializing extension handler with app revision
in appsignal.log
when the value is empty, which is not correct.
|
4081cf1
to
4f039e0
Compare
@jeffkreeftmeijer rebased this PR on develop (because of the agent.exs file location change) and added the new agent build. Can you also verify this works? |
Found an issue where the |
Ah well.. That introduces the issue again of unsetting the config option during a hot reload, would not actually unset it. Only way to fix that is also have the agent listen to an underscored version. |
Great find! Fixed in https://github.com/appsignal/appsignal-agent/pull/328 and fa4c11d. @tombruijn could you build a new agent release and bump the version? |
@jeffkreeftmeijer new agent build added! |
Closes #215.
- Unset revision config option when the APP_REVISION environment variable only contains an empty string.
Underscore `_APP_REVISION` environment variable.
fcdd053
to
7cdf223
Compare
Rebased to fix merge conflicts caused by merging #316 |
Closes #215.