-
Notifications
You must be signed in to change notification settings - Fork 146
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
Clarify use of 'FCM' in app type and refactor to use 'FCM' #251
Conversation
Signed-off-by: H.Shay <shaysquared@gmail.com>
Totally baffled as to why the changelog check is failing. |
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.
Totally baffled as to why the changelog check is failing.
Looks like the CI is finding the changelog at <checkout dir>/sygnal/changelog.d/251.misc
, rather than <checkout dir>/changelog.d/251.misc
, which its expecting.
The changelog CI code was just recently updated, and the changelog location in your PR looks correct. I might suggest trying to merge in the main
branch and see if that works.
"sygnal_gcm_queue_time", "Time taken waiting for a connection to GCM" | ||
"sygnal_fcm_queue_time", "Time taken waiting for a connection to FCM" | ||
) | ||
|
||
SEND_TIME_HISTOGRAM = Histogram( | ||
"sygnal_gcm_request_time", "Time taken to send HTTP request to GCM" | ||
"sygnal_fcm_request_time", "Time taken to send HTTP request to FCM" | ||
) | ||
|
||
PENDING_REQUESTS_GAUGE = Gauge( | ||
"sygnal_pending_gcm_requests", "Number of GCM requests waiting for a connection" | ||
"sygnal_pending_fcm_requests", "Number of FCM requests waiting for a connection" | ||
) | ||
|
||
ACTIVE_REQUESTS_GAUGE = Gauge( | ||
"sygnal_active_gcm_requests", "Number of GCM requests in flight" | ||
"sygnal_active_fcm_requests", "Number of FCM requests in flight" | ||
) | ||
|
||
RESPONSE_STATUS_CODES_COUNTER = Counter( | ||
"sygnal_gcm_status_codes", | ||
"Number of HTTP response status codes received from GCM", | ||
"sygnal_fcm_status_codes", | ||
"Number of HTTP response status codes received from FCM", | ||
labelnames=["pushkin", "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.
Note that modifying these will likely break existing metrics dashboards. Thus this (as well as the span tag name changes below) will need to be detailed in the changelog as well so sysadmins aren't caught off guard 🙂
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.
So afaict my main branch is up to date with the latest sygnal changes, and this fork as well-attempting to merge from main just gives an "Already up to date" message, yet the changelog check is still failing. I can't tell if I am missing something simple 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.
Looks like it's passing now! (Thanks @reivilibre!)
the changelog issue is odd. It was shown to work in the PR that added it :|. I can't see what's wrong with it or why it would act differently in either case. |
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.
Looks good to me other than the minor bits below!
"sygnal_gcm_queue_time", "Time taken waiting for a connection to GCM" | ||
"sygnal_fcm_queue_time", "Time taken waiting for a connection to FCM" | ||
) | ||
|
||
SEND_TIME_HISTOGRAM = Histogram( | ||
"sygnal_gcm_request_time", "Time taken to send HTTP request to GCM" | ||
"sygnal_fcm_request_time", "Time taken to send HTTP request to FCM" | ||
) | ||
|
||
PENDING_REQUESTS_GAUGE = Gauge( | ||
"sygnal_pending_gcm_requests", "Number of GCM requests waiting for a connection" | ||
"sygnal_pending_fcm_requests", "Number of FCM requests waiting for a connection" | ||
) | ||
|
||
ACTIVE_REQUESTS_GAUGE = Gauge( | ||
"sygnal_active_gcm_requests", "Number of GCM requests in flight" | ||
"sygnal_active_fcm_requests", "Number of FCM requests in flight" | ||
) | ||
|
||
RESPONSE_STATUS_CODES_COUNTER = Counter( | ||
"sygnal_gcm_status_codes", | ||
"Number of HTTP response status codes received from GCM", | ||
"sygnal_fcm_status_codes", | ||
"Number of HTTP response status codes received from FCM", | ||
labelnames=["pushkin", "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.
Looks like it's passing now! (Thanks @reivilibre!)
changelog.d/251.misc
Outdated
@@ -0,0 +1,15 @@ | |||
Addresses #230, refactors sygnal to use fcm as app type rather than gcm, and warns in documents about the future deprcation of gcm as an app type. Due to these changes, some prometheus metrics names were updated to refer to Firebase Cloud Messaging (fcm) instead of the legacy Google Cloud Messaging (GCM) services. You can find a list of the changed metric names below: |
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.
Addresses #230, refactors sygnal to use fcm as app type rather than gcm, and warns in documents about the future deprcation of gcm as an app type. Due to these changes, some prometheus metrics names were updated to refer to Firebase Cloud Messaging (fcm) instead of the legacy Google Cloud Messaging (GCM) services. You can find a list of the changed metric names below: | |
Addresses #230, refactors sygnal to use fcm as app type rather than gcm, and warns in documents about the future deprecation of gcm as an app type. Due to these changes, some prometheus metrics names were updated to refer to Firebase Cloud Messaging (fcm) instead of the legacy Google Cloud Messaging (GCM) services. You can find a list of the changed metric names below: |
Additionally, there's still a few places which say "will deprecate" rather than "is deprecated" which should be updated 🙂
changelog.d/251.misc
Outdated
gcm_num_devices -> fcm_num_devices | ||
gcm_num_failed -> fcm_num_failed | ||
|
||
If you make use of either Prometheus (and thus Grafana, etc) metrics or use OpenTracing with Sygnal, please ensure your queries are up to date. |
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.
Thanks for including this information! Note that newsfragments (this file) should just be one line that gives a brief summary. For the call out of the deprecation, that should just be placed at the top of the CHANGELOG.md
file as part of this PR (rather than the newsfragment).
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.
some little tweaks I've spotted. I think anoa will be in charge of giving this the tick though still?
CHANGELOG.md
Outdated
@@ -1,3 +1,19 @@ | |||
This release deprecates the use of gcm as an app type and refactors Sygnal to use fcm as an app type exclusively. Due to these changes, some prometheus metrics names were updated to refer to Firebase Cloud Messaging (fcm) instead of the legacy Google Cloud Messaging (GCM) services. You can find a list of the changed metric names below: |
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 release deprecates the use of gcm as an app type and refactors Sygnal to use fcm as an app type exclusively. Due to these changes, some prometheus metrics names were updated to refer to Firebase Cloud Messaging (fcm) instead of the legacy Google Cloud Messaging (GCM) services. You can find a list of the changed metric names below: | |
This release deprecates the use of `gcm` as an app type and refactors Sygnal to use `fcm` as an app type exclusively. Due to these changes, some Prometheus metrics' names were updated to refer to Firebase Cloud Messaging (FCM) instead of the legacy Google Cloud Messaging (GCM) services. You can find a list of the changed metric names below: |
changelog.d/251.misc
Outdated
@@ -0,0 +1 @@ | |||
Addresses #230, refactors sygnal to use fcm as app type rather than gcm, and warns in documents about the deprecation of gcm as an app type. |
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.
Addresses #230, refactors sygnal to use fcm as app type rather than gcm, and warns in documents about the deprecation of gcm as an app type. | |
Rename the `gcm` app type to `fcm` to reduce confusion (Google Cloud Messaging changed name to Firebase Cloud Messaging in 2016). The app type `gcm` is deprecated and will be removed in a future release. |
sygnal.yaml.sample
Outdated
# | ||
#com.example.myapp.android: | ||
# type: gcm | ||
# api_key: your_api_key_for_gcm | ||
# type: fcm or gcm |
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.
# type: fcm or gcm | |
# type: fcm |
no point suggesting something that's deprecated, I'd say (also it should be directly uncommentable so that it works)
sygnal.yaml.sample
Outdated
# This is an example FCM/GCM push configuration. Note that the gcm type is a legacy | ||
# setting as we now use Firebase Cloud Messaging (fcm) exclusively. Setting gcm as the | ||
# app type is still accepted but understand that under the hood we are using fcm. | ||
# The gcm app type is deprecated. |
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 is an example FCM/GCM push configuration. Note that the gcm type is a legacy | |
# setting as we now use Firebase Cloud Messaging (fcm) exclusively. Setting gcm as the | |
# app type is still accepted but understand that under the hood we are using fcm. | |
# The gcm app type is deprecated. | |
# This is an example FCM push configuration. | |
# FCM was formerly known as GCM. | |
# The deprecated app type `gcm` is equivalent but will be removed from a future Sygnal release. |
sygnal/fcmpushkin.py
Outdated
# We include NotRegistered here too for good measure, even | ||
# though gcm-client 'helpfully' extracts these into a separate | ||
# though fcm-client 'helpfully' extracts these into a separate | ||
# list. | ||
BAD_PUSHKEY_FAILURE_CODES = [ |
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.
# We include NotRegistered here too for good measure, even | |
# though gcm-client 'helpfully' extracts these into a separate | |
# though fcm-client 'helpfully' extracts these into a separate | |
# list. | |
BAD_PUSHKEY_FAILURE_CODES = [ | |
BAD_PUSHKEY_FAILURE_CODES = [ |
gcm-client
was a library for using GCM, so renaming the reference to fcm-client doesn't make sense anymore.
However, gcm-client isn't even in use, so this comment is probably very crufty — hence I think it should just be removed altogether.
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.
maybe anoa will have opinions about ' vs `.
Without looking at this too closely, do we have opinions about referring to this as "FCM" versus something more specific to the FCM API we implement? Namely, Sygnal supports the "legacy HTTP" API, not the newer "HTTP v1" API (cite: Migrate from legacy HTTP to HTTP v1) Concretely this would probably mean using |
On one hand, I don't see much advantage, unless we intend to support both separately? They may be two different APIs, but they are both APIs onto the same service. We never had an app type change when we moved over from the old, binary-protocol APNS to the HTTP/2 APNS, for example. Renaming it to something with 'legacy' in the name is kind of unfortunate when it's the 'gcm' option that's the legacy option. On the other hand, perhaps we will migrate to the v1 API one day (if there's a use case for it). I can't tell if admins will need to make any config changes then or not (it seems like the format of access tokens might have changed, so perhaps?). If that's the case, I can feel someone wanting to say that we should honour both options (:P) for some time whilst admins migrate (although I suppose nobody is forcing them to upgrade Sygnal until they're ready to amend the configuration). |
Having |
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 have no more suggestions other than to resolve the open discussions above 🙂
What about supporting both type: gcm and type: fcm and introducing a new parameter |
Addresses issue #230. This PR allows for both
gcm
andfcm
to be used as app types, warns that the app typegcm
will soon be depreciated, and refactors sygnal to clarify that we are using Firebase Cloud Messaging exclusively.