Skip to content

jolokia2_proxy: Missing jolokia_agent_url tag with Jolokia 2.x proxy #18194

@elohmeier

Description

@elohmeier

Summary

When using the jolokia2_proxy input plugin with a Jolokia 2.x proxy server, the jolokia_agent_url tag is missing from metrics. This makes it impossible to distinguish metrics from different proxy targets.

Root Cause

Jolokia 2.x changed the response format for proxy requests. The target URL is now returned under request.options.target instead of request.target (Jolokia 1.x format).

Jolokia 1.x response:

{
  "request": {
    "target": {
      "url": "service:jmx:rmi:///jndi/rmi://target:9010/jmxrmi"
    }
  }
}

Jolokia 2.x response:

{
  "request": {
    "options": {
      "target": {
        "url": "service:jmx:rmi:///jndi/rmi://target:9010/jmxrmi"
      }
    }
  }
}

The current code only checks request.target, so it never finds the target URL when using Jolokia 2.x.

Expected Behavior

The jolokia_agent_url tag should be present on metrics regardless of whether Jolokia 1.x or 2.x is used.

Affected Versions

  • Telegraf: All versions
  • Jolokia: 2.0.0+ (released December 2023)

Workaround

Use separate [[inputs.jolokia2_proxy]] blocks with explicit [inputs.jolokia2_proxy.tags] for each target.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions