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

azure_monitor send fails with 400 - bad request due to more than 10 dimensions in metric #7318

Closed
thecrazymonkey opened this issue Apr 13, 2020 · 3 comments · Fixed by #7336
Labels
area/azure Azure plugins including eventhub_consumer, azure_storage_queue, azure_monitor bug unexpected problem or unintended behavior
Milestone

Comments

@thecrazymonkey
Copy link

Relevant section of values.yaml:

 outputs:
    - azure_monitor:
        timeout: "10s"
        skip_invalid: true
        namespace_prefix: "cp/"
    - health:
        service_address: "http://:8888"
  inputs:
    - prometheus:
        metric_version: 2
        response_timeout: "10s"
        monitor_kubernetes_pods: true
        monitor_kubernetes_pods_namespace: "test"

System info:

Telegraf 1.14
Azure AKS

Steps to reproduce:

  1. Configure Prometheus input plugin to scrape from prometheus endpoints
  2. Deploy telegraf using helm chart

Expected behavior:

Prometheus metrics delivered to Azure Monitor

Actual behavior:

Send fails with response
Error writing to outputs.azure_monitor: failed to write batch: [400] 400 Bad Request {"error":{"code":"BadRequest","message":"'dimValues' and 'dimNames' lengths should be lesser than 10\r\n"}}

Additional info:

The issue is here:

if len(dimensionNames) > 10 {

The logic above allows 11 items in the array - should be >= 10

@danielnelson danielnelson added this to the 1.14.2 milestone Apr 15, 2020
@danielnelson danielnelson added the bug unexpected problem or unintended behavior label Apr 15, 2020
@danielnelson
Copy link
Contributor

Thanks for the bug report, we will get this fixed. In the meantime, and perhaps even afterwards, you may want to use the tag_limit processor. This will allow you to limit the number of tags and give some control over which tags to keep when over the limit.

@danielnelson danielnelson added the area/azure Azure plugins including eventhub_consumer, azure_storage_queue, azure_monitor label Apr 15, 2020
@thecrazymonkey
Copy link
Author

Thanks! Did not realize that I can fix it this way. Much appreciated!

@danielnelson
Copy link
Contributor

I added some build links to #7336 with the pull request changes too, would be much appreciated if you could verify the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/azure Azure plugins including eventhub_consumer, azure_storage_queue, azure_monitor bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants