Service Now alerting profile
edfenergy-stevebowerman opened this issue · 4 comments
Describe the bug
We may upgrade to Monaco v2 when its GA/supported. But until then, we we'll use v1.
We experience the following when trying to create Service Now alerting profiles:
Snippet of config
config:
- customer common services apis_pn_snow_high: service-now.json
customer common services apis_pn_snow_high:
- name: customer common services apis_pn_snow_high_{{ .Env.MONACO_ENV }}
- alertingProfile: config/alerting-profile/customer common services apis_ap_high.id
- instanceName: REDACTED
- username: REDACTED
- password: REDACTED
The service-now.json looks like this:
{
"type": "SERVICE_NOW",
"name": "{{ .name }}",
"alertingProfile": "{{ .alertingProfile }}",
"active": true,
"message": "{ProblemID} {ProblemTitle}",
"instanceName": "{{ .instanceName }}",
"username": "{{ .username }}",
"password": "{{ .password }}",
"sendIncidents": true,
"sendEvents": false
}
Resulting error:
You are currently using the old CLI structure which will be used by
default until monaco version 2.0.0
Check out the beta of the new CLI by adding the environment variable
"NEW_CLI".
We can't wait for your feedback.
2023-03-06 06:30:27 INFO Dynatrace Monitoring as Code v1.7.0
2023-03-06 06:30:27 INFO Executing projects in this order:
2023-03-06 06:30:27 INFO 1: config (131 configs)
2023-03-06 06:30:27 INFO Processing environment cky14011...
2023-03-06 06:30:27 INFO Processing project config...
2023-03-06 06:30:33 INFO Deployment summary:
2023-03-06 06:30:33 ERROR Deployment to cky14011 failed with error!
2023-03-06 06:30:33 ERROR Failed to create DT object customer common services apis_pn_snow_critical_secondary (HTTP 400)!
Response was: {"error":{"code":400,"message":"Validation failed for 2 Validators.","constraintViolations":[{"path":"builtin:problem.notifications/0/serviceNowNotification/url","message":"Given property 'url' with value: '' violates the following constraint: Size must be between 1 and 1000.","parameterLocation":"PAYLOAD_BODY","location":null},{"path":"builtin:problem.notifications/0/serviceNowNotification/url","message":"Given property 'url' with value: '' violates the following constraint: Not a valid http(s) URL.","parameterLocation":"PAYLOAD_BODY","location":null}]}}, responsible config: config/notification/service-now.json
2023-03-06 06:30:33 ERROR Errors during deployment! Check log!
How to reproduce
See above
Expected behavior
Service now alerting profile to be created
Log output
error dump above
Environment (please complete the following information):
- OS: macOs Ventura, but same error on our AWS CodeBuild image
- Tool version 1.7.0 (also tried with 1.8)
Additional context
Add any other context about the problem here.
Hi @edfenergy-stevebowerman, please read the API error message in the log you shared
"builtin:problem.notifications/0/serviceNowNotification/url","message":"Given property 'url' with value: '' violates the following constraint: Size must be between 1 and 1000."
Your JSON template is missing an URL.
If this problem persists after adding one/none is part of the Config API payload, this is an issue in the internal conversion from the deprecated API to the "builtin:problem.notifications" Settings schema.
In that case, please contact Dynatrace Support, letting them know you're facing issues with the Notifications API/Settings 2.0.
In either case, closing this as not a Monaco specific issue.
The description of the URL field being mutually exclusive to instanceName suggests that this may really be a problem in how this is validated as a Setting internally.
Hi, thanks for the response, but I have read the error message before posting.
url and instanceName are mutually exclusive. So as you can see in my posting, we've supplied the instanceName, but NOT the url in the service-now.json
However, monaco seems to disagree as I'm clearly NOT passing in the url attribute, just the instanceName.
However, monaco seems to disagree as I'm clearly NOT passing in the url attribute, just the instanceName.
As I tried to mention, this Error is coming from Dynatrace, not Monaco.
Monaco is not validating any exact contents of the payload, it simply fills the template and calls the Dynatrace API.
The log shows an HTTP 400 reply and the accompanying message.
As mentioned, I think this might be an issue with validating the "builtin:problem.notifications" Settings schema.
Please contact Dynatrace Support, letting them know you're facing issues with the Notifications API/Settings 2.0 not with monaco.