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
PagerDuty APIv2 ServiceKey to RoutingKey #1940
Conversation
672c35c
to
45595b0
Compare
@nathanielc we will need to update chronograf alert rule builder for this change. |
@russorat I'm not sure where that is. Would you be able to push a change for that, or point me where to look? Is there test coverage for the builder? |
@onlynone @nathanielc is there any way for the chronograf team to know when to use serviceKey vs routingKey when generating tickscripts via the alert rule builder? |
@russorat Yes, serviceKey is v1 routingKey is v2. |
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 had a chat with @russorat and the issue is we have made an official release that uses the serviceKey
function names so we cannot remove it. That said this PR is a better representation of the PagerDuty v2 API.
The solution is to add a serviceKey
function to the pager duty handler so that in TICKscript you can still use serviceKey
even if that is a misleading name.
Then people can chose to use the better routingKey
name when they are ready.
Once that change is in this should be backwards compatible and good to go! Thanks!
pipeline/alert.go
Outdated
// Defaults to the value in the configuration if empty. | ||
ServiceKey string `json:"serviceKey"` | ||
RoutingKey string `json:"routingKey"` | ||
} |
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.
If you add a ServiceKey
function to the PagerDuty2Handler
that takes a string and sets the RoutingKey
field then we maintain backwards compatibility.
Add a //tick:property
comment to the function and a tick:ServiceKey
annotation to the RoutingKey
field to get it to act like a property function instead of a chaining function.
@nathanielc I tried making the changes you recommended, but I'm getting the error
I'm far from knowledgeable about how all the structs/properties/functions/tick script specification interact. If there's something I'm missing that would allow Would it not make more sense to just treat |
Hmm, I think if I do this it works:
Does that make sense? |
@nathanielc I think this should allow |
@nathanielc @russorat Do these changes look good? I'd like to get this change merged because I've got another PR I'd like to open that involves pagerduty2, but it would create conflicts with this branch if I based it off |
@russorat let me know if there's anything else I can do for this PR. |
@nathanielc @russorat ping? |
i will have time to test this tomorrow. |
this is fine for chronograf. our alert rule builder doesn't let you override the routingKey in the tickscript anyway. and as long as the api for setting the config is backwards compatible, we are good. |
@nathanielc good to merge? |
@russorat @nathanielc is there someone else who needs to sign off on this? |
@stevebang @russorat @nathanielc it's been 2 months since I pushed the last commit on this PR, which russ and nathaniel said looked good, is there anything else I need to do to get it merged? |
@timhallinflux are there any more steps required to merge this into master now that it's been added to the 1.5.1 milestone? |
PagerDuty APIv2 ServiceKey to RoutingKey
Required for all non-trivial PRs
I think this should address issue #1938