opentelemetry-collector-contrib icon indicating copy to clipboard operation
opentelemetry-collector-contrib copied to clipboard

jmx receiver autodiscover targets in kubernetes?

Open ceastman-r7 opened this issue 9 months ago • 1 comments

Component(s)

receiver/jmx

Is your feature request related to a problem? Please describe.

The problem is that the endpoint has to be hardcoded: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/jmxreceiver#endpoint

datadog's jmx can autodiscovery: https://docs.datadoghq.com/containers/guide/autodiscovery-with-jmx/?tab=operator

Describe the solution you'd like

Some mechanism for autodiscovery of jmx endpoints for kubernetes.

Describe alternatives you've considered

No response

Additional context

No response

ceastman-r7 avatar May 09 '24 15:05 ceastman-r7

Pinging code owners:

  • receiver/jmx: @rmfitzpatrick

See Adding Labels via Comments if you do not have permissions to add labels yourself.

github-actions[bot] avatar May 09 '24 15:05 github-actions[bot]

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

  • receiver/jmx: @rmfitzpatrick

See Adding Labels via Comments if you do not have permissions to add labels yourself.

github-actions[bot] avatar Jul 09 '24 03:07 github-actions[bot]

Hey, this seems like a dupe of 31599, could I mark it as such?

TL;dr is that there are extensions/observers that can, in conjunction with receivercreator, dynamically add jmx, but there are some caveats

@ datadog, it seems they have you specify a port for autodiscovery

Set <JMX_PORT> as desired, as long as it matches between the annotations and JAVA_OPTS

in the context of the docker observer/receiver_creator, you would specify port == JMXPORT in the rules, similar to the redis example

      redis/1:
        # If this rule matches an instance of this receiver will be started.
        rule: type == "port" && port == 6379
        config:
          # Static receiver-specific config.
          password: secret
          # Dynamic configuration value.
          collection_interval: '`pod.annotations["collection_interval"]`'

hughesjj avatar Jul 22 '24 21:07 hughesjj

@hughesjj feel free to mark this as a duplicate. I am going to close this issue.

ceastman-r7 avatar Jul 23 '24 15:07 ceastman-r7