Skip to content
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

Raising a better exception message from Azure Monitoring http response #597

Merged
merged 5 commits into from
Jun 26, 2019
Merged

Raising a better exception message from Azure Monitoring http response #597

merged 5 commits into from
Jun 26, 2019

Conversation

Mimetis
Copy link
Contributor

@Mimetis Mimetis commented Jun 26, 2019

Update ScrapeAsync method to raise better exception when Azure monitoring is returning a JSON Payload in its Response.

The json payload looks like this:

{
  "error": {
     "code": "xxxx",
     "message" : "zzzz"
  }
}

From the Microsoft.Azure.Management.Monitor.Fluent SDK, we have a wrapped exception ErrorResponseException used here to get the detailed message

…ring is returning a JSON Payload in its Response
@promitor-bot
Copy link

Docker image for this PR was built and is available on Docker Hub.

You can pull it locally via the CLI:

docker pull tomkerkhove/promitor-agent-scraper-ci:pr597

Want to verify the new version? Run it locally:

docker run -d -p 8999:80 --name promitor-agent-scraper-pr597 \
                         --env PROMITOR_AUTH_APPID='<azure-ad-app-id>' \
                         --env-file C:/Promitor/az-mon-auth.creds \
                         --volume C:/Promitor/metrics-declaration.yaml:/config/metrics-declaration.yaml \
                         tomkerkhove/promitor-agent-scraper-ci:pr597

You can find a CI version of our Helm chart on hub.helm.sh

Copy link
Owner

@tomkerkhove tomkerkhove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks - Just a small suggestion.

src/Promitor.Core.Scraping/Scraper.cs Outdated Show resolved Hide resolved
Mimetis and others added 2 commits June 26, 2019 13:06
Co-Authored-By: Tom Kerkhove <kerkhove.tom@gmail.com>
Co-Authored-By: Tom Kerkhove <kerkhove.tom@gmail.com>
@promitor-bot
Copy link

Docker image for this PR was built and is available on Docker Hub.

You can pull it locally via the CLI:

docker pull tomkerkhove/promitor-agent-scraper-ci:pr597

Want to verify the new version? Run it locally:

docker run -d -p 8999:80 --name promitor-agent-scraper-pr597 \
                         --env PROMITOR_AUTH_APPID='<azure-ad-app-id>' \
                         --env-file C:/Promitor/az-mon-auth.creds \
                         --volume C:/Promitor/metrics-declaration.yaml:/config/metrics-declaration.yaml \
                         tomkerkhove/promitor-agent-scraper-ci:pr597

You can find a CI version of our Helm chart on hub.helm.sh

@tomkerkhove tomkerkhove merged commit c88a7c1 into tomkerkhove:master Jun 26, 2019
@tomkerkhove
Copy link
Owner

Thank you very much for your contribution @Mimetis!

@tomkerkhove tomkerkhove added this to the v1.0.0 milestone Jun 26, 2019
@Mimetis Mimetis deleted the RaiseMonitoringException branch June 26, 2019 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants