Skip to content

[input.azure_monitor] Invalid api version #14909

@xolott

Description

@xolott

Relevant telegraf.conf

# Gather Azure resources metrics from Azure Monitor API
[[inputs.azure_monitor]]
    # can be found under Overview->Essentials in the Azure portal for your application/service
    subscription_id = "xxx"
    # can be obtained by registering an application under Azure Active Directory
    client_id = "xxx"
    # can be obtained by registering an application under Azure Active Directory
    client_secret = "xxx"
    # can be found under Azure Active Directory->Properties
    tenant_id = "xxx"

    [[inputs.azure_monitor.resource_target]]
        resource_id = "/subscriptions/xxx/resourceGroups/MC_xxx/providers/Microsoft.Network/loadBalancers/kubernetes"
        metrics = [ "AllocatedSnatPorts", "SnatConnectionCount", "UsedSnatPorts" ]

Logs from Telegraf

2024-02-28T20:27:37Z I! Loading config: /etc/telegraf/telegraf.conf
2024-02-28T20:27:37Z I! Starting Telegraf 1.29.5 brought to you by InfluxData the makers of InfluxDB
2024-02-28T20:27:37Z I! Available plugins: 241 inputs, 9 aggregators, 30 processors, 24 parsers, 60 outputs, 6 secret-stores
2024-02-28T20:27:37Z I! Loaded inputs: azure_monitor
2024-02-28T20:27:37Z I! Loaded aggregators:
2024-02-28T20:27:37Z I! Loaded processors:
2024-02-28T20:27:37Z I! Loaded secretstores:
2024-02-28T20:27:37Z I! Loaded outputs: sumologic
2024-02-28T20:27:37Z I! Tags enabled: host=vm-sumologic-integration-centralus-001
2024-02-28T20:27:37Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"vm-sumologic-integration-centralus-001", Flush Interval:10s
2024-02-28T20:27:37Z D! [agent] Initializing plugins
2024-02-28T20:27:38Z E! [telegraf] Error running agent: could not initialize input inputs.azure_monitor: error checking resource targets metrics validation: error getting metric definitions response for resource target /subscriptions/xxx//subscriptions/xxx/resourceGroups/MC_rxxx/providers/Microsoft.Network/loadBalancers/kubernetes: error listing metric definitions for the resource target /subscriptions/xxx//subscriptions/xxx/resourceGroups/MC_xxx/providers/Microsoft.Network/loadBalancers/kubernetes: GET https://management.azure.com/subscriptions/xxx/subscriptions/xxx/resourceGroups/MC_xxx/providers/Microsoft.Network/loadBalancers/kubernetes/providers/Microsoft.Insights/metricDefinitions
--------------------------------------------------------------------------------
RESPONSE 400: 400 Bad Request
ERROR CODE: InvalidApiVersionParameter
--------------------------------------------------------------------------------
{
  "error": {
    "code": "InvalidApiVersionParameter",
    "message": "The api-version '2021-05-01' is invalid. The supported versions are '2023-07-01,2023-07-01-preview,2023-03-01-preview,2022-12-01,2022-11-01-preview,2022-09-01,2022-06-01,2022-05-01,2022-03-01-preview,2022-01-01,2021-04-01,2021-01-01,2020-10-01,2020-09-01,2020-08-01,2020-07-01,2020-06-01,2020-05-01,2020-01-01,2019-11-01,2019-10-01,2019-09-01,2019-08-01,2019-07-01,2019-06-01,2019-05-10,2019-05-01,2019-03-01,2018-11-01,2018-09-01,2018-08-01,2018-07-01,2018-06-01,2018-05-01,2018-02-01,2018-01-01,2017-12-01,2017-08-01,2017-06-01,2017-05-10,2017-05-01,2017-03-01,2016-09-01,2016-07-01,2016-06-01,2016-02-01,2015-11-01,2015-01-01,2014-04-01-preview,2014-04-01,2014-01-01,2013-03-01,2014-02-26,2014-04'."
  }
}
--------------------------------------------------------------------------------

System info

Telegraf 1.29.5 (git: HEAD@138d0d54), Ubuntu 22.04.3 LTS

Docker

No response

Steps to reproduce

  1. Created an application in Entra ID
  2. Created a secret (password) for that application
  3. Install and run telegraf with that config (omitted the output for simplicity)

Expected behavior

It should work

Actual behavior

Throwing an error and the telegraf process ends

Additional info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugunexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions