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

Not able to use Generic Scraper with PostgreSQL #591

Closed
cnadolny opened this issue Jun 15, 2019 · 6 comments
Closed

Not able to use Generic Scraper with PostgreSQL #591

cnadolny opened this issue Jun 15, 2019 · 6 comments
Assignees
Labels
metric-source:azure-monitor All issues that relate to scraping metrics that depends on Azure Monitor as a data source not-a-bug All issues reported as a bug that could be triaged and is not a bug scraping All issues related to scraping

Comments

@cnadolny
Copy link
Contributor

Expected Behavior

When using the Generic Metrics Config, I should be able to view metrics from PostgreSQL. As far as I can tell I'm using the correct settings, but please let me know if this is a user error :)

Actual Behavior

I get back a response on localhost:8080/metrics, but the actual value of my metric is 0, even though there is data under the Azure Metrics Portal for the resource.

# HELP generic_postgresql_scraper Amount of active messages of the 'generic_postgresql_scraper'
# TYPE generic_postgresql_scraper gauge
generic_postgresql_scraper{resource_uri="subscriptions/<sub-id>/resourceGroups/RG/providers/Microsoft.DBforPostgreSQL/servers/claudia-postgresql"} 0 1560552019824
# HELP promitor_ratelimit_arm Indication how many calls are still available before Azure Resource Manager is going to throttle us.
# TYPE promitor_ratelimit_arm gauge
promitor_ratelimit_arm{tenant_id="<tenant-id>",subscription_id="<sub-id>",app_id="<app-id>"} 11959 1560552019771

Steps to Reproduce the Problem

  1. Create Azure PostgreSQL db
  2. Create metrics config
  3. Deploy Promitor

Configuration

Provide insights in the configuration that you are using:
Used default scraping schedule

I used this as a reference for what metrics to scrape:
https://docs.microsoft.com/en-us/azure/azure-monitor/platform/metrics-supported#microsoftdbforpostgresqlservers

and here is my YAML:

metrics:
  - name: "generic_postgresql_scraper"
    description: "test"
    resourceType: "Generic"
    resourceUri: "Microsoft.DBforPostgreSQL/servers/claudia-postgresql"
    azureMetricConfiguration:
      metricName: "cpu_percent"
      aggregation:
        Type: "Average"

Specifications

  • Version: Latest helm chart
  • Platform: Windows
  • Subsystem: WSL
@cnadolny cnadolny added the bug Something isn't working label Jun 15, 2019
@tomkerkhove
Copy link
Owner

tomkerkhove commented Jun 16, 2019

That's interesting, thanks for reporting, the config looks good.

Can you provide the following please:

  • Screenshot of what the Azure portal is reporting
  • Verify that you are using Helm chart 0.3.0 with app version 1.0.0-preview-7
  • Logs from promitor

That should give some idea what is going on. If that is not clear we can have a look at the Azure Portal HTTP trace for getting the data.

Thank you!

@tomkerkhove tomkerkhove added metric-source:azure-monitor All issues that relate to scraping metrics that depends on Azure Monitor as a data source scraping All issues related to scraping labels Jun 16, 2019
@tomkerkhove tomkerkhove added this to the v1.0.0 milestone Jun 16, 2019
@tomkerkhove tomkerkhove added the more-information-required All issues where more information is required to proceed label Jun 16, 2019
@tomkerkhove tomkerkhove removed this from the v1.0.0 milestone Jun 16, 2019
@cnadolny
Copy link
Contributor Author

cnadolny commented Jun 17, 2019

Confirmed that I'm using Helm chart 0.3.0 with app version 1.0.0-preview-7!

promitor_cpu_logs
promitor_logs

I also confirmed that I'm able to see the metric data using the Azure Monitor API, using the same parameters I'm giving Promitor (resourceUri, metric cpu_percent, aggregate Average):
https://docs.microsoft.com/en-us/rest/api/monitor/metricdefinitions/list

@tomkerkhove
Copy link
Owner

Hm that's odd. So calling Azure Monitor API with same config works on your end, but not with Promitor?

Will see if I can spin one up and give it a try.

@tomkerkhove tomkerkhove self-assigned this Jun 17, 2019
@tomkerkhove
Copy link
Owner

I took the liberty to use your config for my instance.

When I checked the loaded configuration via http://localhost:32775/api/v1/configuration/metric-declaration, I've received the following:

[
  {
    "resourceType": "Generic",
    "resourceUri": "Microsoft.DBforPostgreSQL/servers/promitor",
    "azureMetricConfiguration": {
      "metricName": "cpu_percent",
      "aggregation": {
        "type": "None",
        "interval": "00:05:00"
      }
    },
    "description": "test",
    "name": "generic_postgresql_scraper",
    "resourceGroupName": "promitor",
    "scraping": {
      "schedule": "0 * * ? * *"
    }
  }
]

Note that aggregation.type is none rather than average because of azureMetricConfiguration.aggregation.Type rather than azureMetricConfiguration.aggregation.type.

Once that is changed, it should work fine:

# HELP generic_postgresql_scraper test
# TYPE generic_postgresql_scraper gauge
generic_postgresql_scraper{resource_uri="subscriptions/<subscription id>/resourceGroups/promitor-sources/providers/Microsoft.DBforPostgreSQL/servers/promitor"} 0.7525 1560789602044

Can you please try fixing the config please?

I'll open an issue to streamline this so that it should be logged and blocked, sorry for that!

@cnadolny
Copy link
Contributor Author

Changing it from Type to type worked - thanks Tom!

@tomkerkhove
Copy link
Owner

Good to hear and sorry for this hickup!

@tomkerkhove tomkerkhove added not-a-bug All issues reported as a bug that could be triaged and is not a bug and removed bug Something isn't working more-information-required All issues where more information is required to proceed labels Jun 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
metric-source:azure-monitor All issues that relate to scraping metrics that depends on Azure Monitor as a data source not-a-bug All issues reported as a bug that could be triaged and is not a bug scraping All issues related to scraping
Projects
None yet
Development

No branches or pull requests

2 participants