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

Filtering by dimensions which include / in name does not work in generic scraper #1273

Merged
merged 8 commits into from
Sep 11, 2020

Conversation

tomkerkhove
Copy link
Owner

Both metrics work, unfortunately, I don't have any other response codes to test with.

# HELP promitor_demo_app_insights_dependency_duration Average dependency duration per dependency type
# TYPE promitor_demo_app_insights_dependency_duration gauge
promitor_demo_app_insights_dependency_duration{resource_group="docker-hub-metrics",subscription_id="0f9d7fea-99e8-4768-8672-06a28514f77e",resource_uri="subscriptions/0f9d7fea-99e8-4768-8672-06a28514f77e/resourceGroups/docker-hub-metrics/providers/Microsoft.Insights/Components/docker-hub-metrics",instance_name="Microsoft.Insights/Components/docker-hub-metrics",dependency_type="Http"} 540.75 1599666014691
# HELP promitor_demo_app_insights_dependency_duration_200_OK Average dependency duration per dependency type
# TYPE promitor_demo_app_insights_dependency_duration_200_OK gauge
promitor_demo_app_insights_dependency_duration_200_OK{resource_group="docker-hub-metrics",subscription_id="0f9d7fea-99e8-4768-8672-06a28514f77e",resource_uri="subscriptions/0f9d7fea-99e8-4768-8672-06a28514f77e/resourceGroups/docker-hub-metrics/providers/Microsoft.Insights/Components/docker-hub-metrics",instance_name="Microsoft.Insights/Components/docker-hub-metrics"} 540.75 1599666014627

Fixes #1266

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>
Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>
Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>
Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>
@trafico-bot trafico-bot bot added the 🔍 Ready for Review Pull Request is not reviewed yet label Sep 9, 2020
@tomkerkhove
Copy link
Owner Author

@renebarbosafl the CI will spit out an image, would you mind testing that one?

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>
Signed-off-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:pr1273-linux

Want to verify the new version? Run it locally:

docker run -d -p 8999:80 --name promitor-agent-scraper-pr1273-linux \
                         --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  \
                         --volume C:/Promitor/runtime-config.yaml:/config/runtime.yaml \
                         tomkerkhove/promitor-agent-scraper-ci:pr1273-linux

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

@tomkerkhove
Copy link
Owner Author

From what I'm seeing it works, feel free to confirm.

@renebarbosafl
Copy link

renebarbosafl commented Sep 9, 2020

Hi Tom,

It doesn't seems to be working (or maybe I did something wrong here), with filter:

ae29b07056d3d",resource_uri="subscriptions/c1cbcf63-fd33-40b4-9672-e29b07056d3d/resourceGroups/SuperPratico-GO/providers/Microsoft.Insights/Components/GO-Insights-API",instance_name="Microsoft.Insights/Components/GO-Insights-API",dependency_target="superpraticogo.blob.core.windows.net"} 9106

It's a storage account, we're scraping 9106 erros but there aren't any HTTP-500 errors there, only 40x.
I've used this config:

  - name: test
    description: "Just a test, please ignore"
    resourceType: Generic
    azureMetricConfiguration:
      metricName: dependencies/failed
      dimension:
        name: dependency/target
      aggregation:
        type: Count
    resources:
    - resourceUri: Microsoft.Insights/Components/GO-Insights-API
      resourceGroupName: SuperPratico-GO
      filter: dependency/resultCode eq '500'

@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:pr1273-linux

Want to verify the new version? Run it locally:

docker run -d -p 8999:80 --name promitor-agent-scraper-pr1273-linux \
                         --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  \
                         --volume C:/Promitor/runtime-config.yaml:/config/runtime.yaml \
                         tomkerkhove/promitor-agent-scraper-ci:pr1273-linux

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

@tomkerkhove
Copy link
Owner Author

It doesn't seems to be working (or maybe I did something wrong here), with filter:

ae29b07056d3d",resource_uri="subscriptions/c1cbcf63-fd33-40b4-9672-e29b07056d3d/resourceGroups/SuperPratico-GO/providers/Microsoft.Insights/Components/GO-Insights-API",instance_name="Microsoft.Insights/Components/GO-Insights-API",dependency_target="superpraticogo.blob.core.windows.net"} 9106

It's a storage account, we're scraping 9106 erros but there aren't any HTTP-500 errors there, only 40x.
I've used this config:

  - name: test
    description: "Just a test, please ignore"
    resourceType: Generic
    azureMetricConfiguration:
      metricName: dependencies/failed
      dimension:
        name: dependency/target
      aggregation:
        type: Count
    resources:
    - resourceUri: Microsoft.Insights/Components/GO-Insights-API
      resourceGroupName: SuperPratico-GO
      filter: dependency/resultCode eq '500'

Odd, could you maybe add an additional metric without the filter based on this image so we can compare both and include a screenshot of Metrics Explorer split by result code?

Feel free to send over the logs as well because this worked for me yesterday evening so happy to dig deeper.

@tomkerkhove
Copy link
Owner Author

tomkerkhove commented Sep 11, 2020

I did a more thorough test and will merge it given everything looks ok.

Metrics config:

metrics:
  - name: promitor_demo_app_insights_dependency_duration
    description: "Average dependency duration per dependency type"
    resourceType: Generic
    azureMetricConfiguration:
      metricName: dependencies/duration
      aggregation:
        type: Average
        interval: 00:30:00
    resources:
    - resourceUri: Microsoft.Insights/Components/promitor-telemetry
      resourceGroupName: promitor
  - name: promitor_demo_app_insights_dependency_duration_200_OK
    description: "Average dependency duration per dependency type"
    resourceType: Generic
    azureMetricConfiguration:
      metricName: dependencies/duration
      aggregation:
        type: Average
        interval: 00:30:00
    resources:
    - resourceUri: Microsoft.Insights/Components/promitor-telemetry
      resourceGroupName: promitor
      filter: dependency/resultCode eq '200'
  - name: promitor_demo_app_insights_dependency_duration_429_TooManyRequests
    description: "Average dependency duration per dependency type"
    resourceType: Generic
    azureMetricConfiguration:
      metricName: dependencies/duration
      aggregation:
        type: Average
        interval: 00:30:00
    resources:
    - resourceUri: Microsoft.Insights/Components/promitor-telemetry
      resourceGroupName: promitor
      filter: dependency/resultCode eq '429'
  - name: promitor_demo_app_insights_dependency_duration_500_InternalServerError
    description: "Average dependency duration per dependency type"
    resourceType: Generic
    azureMetricConfiguration:
      metricName: dependencies/duration
      aggregation:
        type: Average
        interval: 00:30:00
    resources:
    - resourceUri: Microsoft.Insights/Components/promitor-telemetry
      resourceGroupName: promitor
      filter: dependency/resultCode eq '500'

Portal:
image

Output with a clear separation and average per status code:

# HELP promitor_demo_app_insights_dependency_duration Average dependency duration per dependency type
# TYPE promitor_demo_app_insights_dependency_duration gauge
promitor_demo_app_insights_dependency_duration{resource_group="promitor",subscription_id="0f9d7fea-99e8-4768-8672-06a28514f77e",resource_uri="subscriptions/0f9d7fea-99e8-4768-8672-06a28514f77e/resourceGroups/promitor/providers/Microsoft.Insights/Components/promitor-telemetry",instance_name="Microsoft.Insights/Components/promitor-telemetry"} 49723.134146341465 1599804600970
# HELP promitor_demo_app_insights_dependency_duration_200_OK Average dependency duration per dependency type
# TYPE promitor_demo_app_insights_dependency_duration_200_OK gauge
promitor_demo_app_insights_dependency_duration_200_OK{resource_group="promitor",subscription_id="0f9d7fea-99e8-4768-8672-06a28514f77e",resource_uri="subscriptions/0f9d7fea-99e8-4768-8672-06a28514f77e/resourceGroups/promitor/providers/Microsoft.Insights/Components/promitor-telemetry",instance_name="Microsoft.Insights/Components/promitor-telemetry"} 44422.30107526882 1599804601552
# HELP promitor_demo_app_insights_dependency_duration_429_TooManyRequests Average dependency duration per dependency type
# TYPE promitor_demo_app_insights_dependency_duration_429_TooManyRequests gauge
promitor_demo_app_insights_dependency_duration_429_TooManyRequests{resource_group="promitor",subscription_id="0f9d7fea-99e8-4768-8672-06a28514f77e",resource_uri="subscriptions/0f9d7fea-99e8-4768-8672-06a28514f77e/resourceGroups/promitor/providers/Microsoft.Insights/Components/promitor-telemetry",instance_name="Microsoft.Insights/Components/promitor-telemetry"} 50023.752808988764 1599804601017
# HELP promitor_demo_app_insights_dependency_duration_500_InternalServerError Average dependency duration per dependency type
# TYPE promitor_demo_app_insights_dependency_duration_500_InternalServerError gauge
promitor_demo_app_insights_dependency_duration_500_InternalServerError{resource_group="promitor",subscription_id="0f9d7fea-99e8-4768-8672-06a28514f77e",resource_uri="subscriptions/0f9d7fea-99e8-4768-8672-06a28514f77e/resourceGroups/promitor/providers/Microsoft.Insights/Components/promitor-telemetry",instance_name="Microsoft.Insights/Components/promitor-telemetry"} 53730.9625 1599804601350

@tomkerkhove tomkerkhove merged commit a53b997 into master Sep 11, 2020
@tomkerkhove tomkerkhove deleted the filter-with-slash branch September 11, 2020 06:12
@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully and removed 🔍 Ready for Review Pull Request is not reviewed yet labels Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Merged Pull Request has been merged successfully
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filtering by dimensions which include / in name does not work in generic scraper
3 participants