[GH-ISSUE #525] Hipchat woes... #185

Closed
opened 2026-03-04 02:12:57 +03:00 by kerem · 20 comments
Owner

Originally created by @temp on GitHub (Mar 5, 2015).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/525

Just noticed the upgrade to the v2 api of hipchat.
This does more bad, than good, in my opinion.

Since hipchat api v2 is now oauth-token-based, it sends the log messages in the name of the user of the oauth-token. The nickname is not being used at all. You have to register an integration for an app account with it's own oauth-token.
And, by the way, the nickname-length check is still in the HipchatHandler. And the nickname. Which is not used ;-)

Guess i'll add the old hipchat handler as a custom handler for now.

Originally created by @temp on GitHub (Mar 5, 2015). Original GitHub issue: https://github.com/Seldaek/monolog/issues/525 Just noticed the upgrade to the v2 api of hipchat. This does more bad, than good, in my opinion. Since hipchat api v2 is now oauth-token-based, it sends the log messages in the name of the user of the oauth-token. The nickname is not being used at all. You have to register an integration for an app account with it's own oauth-token. And, by the way, the nickname-length check is still in the HipchatHandler. And the nickname. Which is not used ;-) Guess i'll add the old hipchat handler as a custom handler for now.
kerem closed this issue 2026-03-04 02:12:57 +03:00
Author
Owner

@Seldaek commented on GitHub (Mar 5, 2015):

Oh sorry I overlooked that while reviewing.. Don't use it myself so it's hard to keep track of all things. That said, I suppose they will bring the v1 API offline eventually so you'll have to make the move sooner or later.

<!-- gh-comment-id:77411316 --> @Seldaek commented on GitHub (Mar 5, 2015): Oh sorry I overlooked that while reviewing.. Don't use it myself so it's hard to keep track of all things. That said, I suppose they will bring the v1 API offline eventually so you'll have to make the move sooner or later.
Author
Owner

@Seldaek commented on GitHub (Mar 5, 2015):

But yes room_id and from in buildContent (+ the nickname everywhere) should be removed.

<!-- gh-comment-id:77411488 --> @Seldaek commented on GitHub (Mar 5, 2015): But yes room_id and from in buildContent (+ the nickname everywhere) should be removed.
Author
Owner

@Seldaek commented on GitHub (Mar 5, 2015):

Just one thing though.. did you need to register a new token at hipchat to make the v2 work or not? Because if yes that's a BC break and I guess I should revert until monolog v2..

<!-- gh-comment-id:77411966 --> @Seldaek commented on GitHub (Mar 5, 2015): Just one thing though.. did you _need_ to register a new token at hipchat to make the v2 work or not? Because if yes that's a BC break and I guess I should revert until monolog v2..
Author
Owner

@temp commented on GitHub (Mar 5, 2015):

The old api token does not work with v2. Had to create a new personal oauth token. So, yes, this is a bc break.

<!-- gh-comment-id:77429681 --> @temp commented on GitHub (Mar 5, 2015): The old api token does not work with v2. Had to create a new personal oauth token. So, yes, this is a bc break.
Author
Owner

@m4tthumphrey commented on GitHub (Mar 9, 2015):

Yeh this seems to have broken for me too. The annoying thing is, it just fails silently but appears to be auth related.

<!-- gh-comment-id:77822718 --> @m4tthumphrey commented on GitHub (Mar 9, 2015): Yeh this seems to have broken for me too. The annoying thing is, it just fails silently but appears to be auth related.
Author
Owner

@Seldaek commented on GitHub (Mar 9, 2015):

I reverted and 1.13.1 uses the v1 API with old tokens again.

<!-- gh-comment-id:77826539 --> @Seldaek commented on GitHub (Mar 9, 2015): I reverted and 1.13.1 uses the v1 API with old tokens again.
Author
Owner

@m4tthumphrey commented on GitHub (Mar 9, 2015):

Would it make sense to add a new separate handler for HipChat v2?

<!-- gh-comment-id:77827322 --> @m4tthumphrey commented on GitHub (Mar 9, 2015): Would it make sense to add a new separate handler for HipChat v2?
Author
Owner

@Seldaek commented on GitHub (Mar 9, 2015):

I think there are two ways.. either we can distinguish the auth token for v1 and v2 and then we could sort of automatically configure the correct endpoint, or we just migrate to v2 in monolog 2.0 and that's a BC break and that's it. I don't know if v2 of their API really brings much except making sure it'll continue working in the future.

<!-- gh-comment-id:77827609 --> @Seldaek commented on GitHub (Mar 9, 2015): I think there are two ways.. either we can distinguish the auth token for v1 and v2 and then we could sort of automatically configure the correct endpoint, or we just migrate to v2 in monolog 2.0 and that's a BC break and that's it. I don't know if v2 of their API really brings much except making sure it'll continue working in the future.
Author
Owner

@temp commented on GitHub (Mar 9, 2015):

The problem is that v2 accepts either an user-oauth-token (which will result in log messages from a specific user), or an integration-oauth-token (which only last an hour and have to be constantly created).
I think it sucks to have log messages with a specific user, which will end in creating a lot of users for your different deployments...
Don't really like what atlassian is doing with the v2 changes, cause it will require a lot of changes for something like monolog.
For now I would stick with v1, but I don't know wether or not it will be discontinued.

<!-- gh-comment-id:77863701 --> @temp commented on GitHub (Mar 9, 2015): The problem is that v2 accepts either an user-oauth-token (which will result in log messages from a specific user), or an integration-oauth-token (which only last an hour and have to be constantly created). I think it sucks to have log messages with a specific user, which will end in creating a lot of users for your different deployments... Don't really like what atlassian is doing with the v2 changes, cause it will require a lot of changes for something like monolog. For now I would stick with v1, but I don't know wether or not it will be discontinued.
Author
Owner

@m4tthumphrey commented on GitHub (Mar 9, 2015):

@temp Yeh but unfortunately theres nothing Monolog can do about it. Is there anywhere we can raise this with HipChat? I also really like the nickname functionality.

<!-- gh-comment-id:77864310 --> @m4tthumphrey commented on GitHub (Mar 9, 2015): @temp Yeh but unfortunately theres nothing Monolog can do about it. Is there anywhere we can raise this with HipChat? I also really like the nickname functionality.
Author
Owner

@esalter commented on GitHub (Mar 10, 2015):

The way I've seen this in other libraries is you just specify what version of the API you want to use as an option, and the library takes care of it. I'm disappointed to see that v2 isn't supported anymore.

<!-- gh-comment-id:78050819 --> @esalter commented on GitHub (Mar 10, 2015): The way I've seen this in other libraries is you just specify what version of the API you want to use as an option, and the library takes care of it. I'm disappointed to see that v2 isn't supported anymore.
Author
Owner

@m4tthumphrey commented on GitHub (Mar 10, 2015):

Why don't you update the handler to support v2 as well and create a PR @esalter?

<!-- gh-comment-id:78050985 --> @m4tthumphrey commented on GitHub (Mar 10, 2015): Why don't you update the handler to support v2 as well and create a PR @esalter?
Author
Owner

@esalter commented on GitHub (Mar 10, 2015):

I will if I can find time soon.

<!-- gh-comment-id:78051328 --> @esalter commented on GitHub (Mar 10, 2015): I will if I can find time soon.
Author
Owner

@esalter commented on GitHub (Mar 10, 2015):

https://github.com/Seldaek/monolog/pull/526

<!-- gh-comment-id:78073652 --> @esalter commented on GitHub (Mar 10, 2015): https://github.com/Seldaek/monolog/pull/526
Author
Owner

@temp commented on GitHub (Mar 10, 2015):

Gee, did you mind reading my comments at all?
I really don't think that supporting v2 makes sense at all.
v2 requires a personal oauth token, bound to an user, NOT one of the old api keys.
v2 WON'T work with them.
And, if you create your personal oauth token, all log messages will be sent with your name!
We used the nickname to distinguish the servers which sent the messages, but the nickname feature has been removed from v2.
And it won't come back.
Now you could create a user for every server, but who wants to create and maintain a few dozen users, that also appear in hipchat?
Atlassians solution for this are the integrations, but these also don't really work with monolog.
You can register an integration, which will provide you with a user id and a secret, with which you can create an integration-oauth-token, which will only be valid vor 3600 seconds.
So, monolog would have to track these tokens, OR create a new oauth-token for each request.
And it still doesn't solve the nickname issue, since messages would now be sent with the integration name.
I would suggest sticking with the v1 api for monolog - i don't think that atlassian will shut down the v1 api. In jira the v1 apis are still available after months or even years.

<!-- gh-comment-id:78142117 --> @temp commented on GitHub (Mar 10, 2015): Gee, did you mind reading my comments at all? I really don't think that supporting v2 makes sense at all. v2 requires a personal oauth token, bound to an user, NOT one of the old api keys. v2 WON'T work with them. And, if you create your personal oauth token, all log messages will be sent with your name! We used the nickname to distinguish the servers which sent the messages, but the nickname feature has been removed from v2. And it won't come back. Now you could create a user for every server, but who wants to create and maintain a few dozen users, that also appear in hipchat? Atlassians solution for this are the integrations, but these also don't really work with monolog. You can register an integration, which will provide you with a user id and a secret, with which you can create an integration-oauth-token, which will only be valid vor 3600 seconds. So, monolog would have to track these tokens, OR create a new oauth-token for each request. And it still doesn't solve the nickname issue, since messages would now be sent with the integration name. I would suggest sticking with the v1 api for monolog - i don't think that atlassian will shut down the v1 api. In jira the v1 apis are still available after months or even years.
Author
Owner

@esalter commented on GitHub (Mar 10, 2015):

It depends on your use case. For us, we use this for deployment messages, so we have a deployment user that is used to send messages. I'm sure there are other legitimate use cases. It's not for everyone, clearly, but I don't see a reason not to support it when it's easy enough to add.

<!-- gh-comment-id:78144383 --> @esalter commented on GitHub (Mar 10, 2015): It depends on your use case. For us, we use this for deployment messages, so we have a deployment user that is used to send messages. I'm sure there are other legitimate use cases. It's not for everyone, clearly, but I don't see a reason not to support it when it's easy enough to add.
Author
Owner

@temp commented on GitHub (Mar 10, 2015):

Ok, but then why not stick to v1 where you don't even need a user? ;-)

<!-- gh-comment-id:78154379 --> @temp commented on GitHub (Mar 10, 2015): Ok, but then why not stick to v1 where you don't even need a user? ;-)
Author
Owner

@temp commented on GitHub (Mar 11, 2015):

@Seldaek is there an ETA for 1.13.1?

<!-- gh-comment-id:78265651 --> @temp commented on GitHub (Mar 11, 2015): @Seldaek is there an ETA for 1.13.1?
Author
Owner

@Seldaek commented on GitHub (Mar 12, 2015):

@temp sorry I forgot to tag after updating the changelog :s It's up now.

<!-- gh-comment-id:78416540 --> @Seldaek commented on GitHub (Mar 12, 2015): @temp sorry I forgot to tag after updating the changelog :s It's up now.
Author
Owner

@temp commented on GitHub (Mar 12, 2015):

👍

<!-- gh-comment-id:78448259 --> @temp commented on GitHub (Mar 12, 2015): :thumbsup:
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/monolog#185
No description provided.