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

JMXReceiver start up failed with 1.33.0 #1213

Closed
CzyerChen opened this issue Mar 5, 2024 · 5 comments
Closed

JMXReceiver start up failed with 1.33.0 #1213

CzyerChen opened this issue Mar 5, 2024 · 5 comments

Comments

@CzyerChen
Copy link

CzyerChen commented Mar 5, 2024

Component(s)

jmx-metrics

What happened?

Description

I have tried activemq-opentelemetry-collector-contrib-jmxreceiver-otel.
failed with 1.33.0, but 1.32.0 successed.

Steps to Reproduce

config detail is here: open-telemetry/opentelemetry-collector-contrib#31542

Expected Result

start up successfully

Actual Result

Firstly tried 1.33.0

:~$ docker run -v $(pwd)/otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml -v $(pwd)/opentelemetry-jmx-metrics.jar:/usr/local/opentelemetry-jmx-metrics.jar otel/opentelemetry-collector-contrib:latest
Error: invalid configuration: receivers::jmx: invalid `jar_path`: jar hash does not match known versions
2024/03/05 03:11:23 collector server run finished with error: invalid configuration: receivers::jmx: invalid `jar_path`: jar hash does not match known versions

change opentelemetry-jmx-metrics.jar from 1.33.0 -> 1.32.0

$ docker run --name jmxreceiver -v $(pwd)/otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml -v $(pwd)/opentelemetry-jmx-metrics.jar:/usr/local/opentelemetry-jmx-metrics.jar -v $(pwd)/tmp/:/tmp/ otel/opentelemetry-collector-contrib:latest
2024-03-05T03:35:45.713Z	info	service@v0.95.0/telemetry.go:55	Setting up own telemetry...
2024-03-05T03:35:45.713Z	info	service@v0.95.0/telemetry.go:97	Serving metrics	{"address": ":8888", "level": "Basic"}
2024-03-05T03:35:45.720Z	info	service@v0.95.0/service.go:143	Starting otelcol-contrib...	{"Version": "0.95.0", "NumCPU": 4}
2024-03-05T03:35:45.720Z	info	extensions/extensions.go:34	Starting extensions...
2024-03-05T03:35:45.731Z	warn	zapgrpc/zapgrpc.go:195	[core] [Channel #1 SubChannel #2] grpc: addrConn.createTransport failed to connect to {Addr: "192.168.2.60:11800", ServerName: "192.168.2.60:11800", }. Err: connection error: desc = "transport: Error while dialing: dial tcp 192.168.2.60:11800: connect: connection refused"	{"grpc_log": true}
2024-03-05T03:35:45.743Z	warn	internal@v0.95.0/warning.go:42	Using the 0.0.0.0 address exposes this server to every network interface, which may facilitate Denial of Service attacks. Enable the feature gate to change the default and remove this warning.	{"kind": "receiver", "name": "jmx", "data_type": "metrics", "documentation": "https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/security-best-practices.md#safeguards-against-denial-of-service-attacks", "feature gate ID": "component.UseLocalHostAsDefaultHost"}
2024-03-05T03:35:45.745Z	info	otlpreceiver@v0.95.0/otlp.go:102	Starting GRPC server	{"kind": "receiver", "name": "jmx", "data_type": "metrics", "endpoint": "0.0.0.0:43303"}
2024-03-05T03:35:45.748Z	info	service@v0.95.0/service.go:169	Everything is ready. Begin running and processing data.
2024-03-05T03:35:45.748Z	warn	localhostgate/featuregate.go:63	The default endpoints for all servers in components will change to use localhost instead of 0.0.0.0 in a future version. Use the feature gate to preview the new default.	{"feature gate ID": "component.UseLocalHostAsDefaultHost"}
2024-03-05T03:35:45.751Z	error	subprocess/subprocess.go:242	subprocess died	{"kind": "receiver", "name": "jmx", "data_type": "metrics", "error": "exec: \"java\": executable file not found in $PATH"}

Component version

1.33.0

Log output

docker run -v $(pwd)/otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml -v $(pwd)/opentelemetry-jmx-metrics.jar:/usr/local/opentelemetry-jmx-metrics.jar otel/opentelemetry-collector-contrib:latest
Error: invalid configuration: receivers::jmx: invalid `jar_path`: jar hash does not match known versions
2024/03/05 03:11:23 collector server run finished with error: invalid configuration: receivers::jmx: invalid `jar_path`: jar hash does not match known versions
docker run --name jmxreceiver -v $(pwd)/otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml -v $(pwd)/opentelemetry-jmx-metrics.jar:/usr/local/opentelemetry-jmx-metrics.jar -v $(pwd)/tmp/:/tmp/ otel/opentelemetry-collector-contrib:latest
2024-03-05T03:35:45.713Z	info	service@v0.95.0/telemetry.go:55	Setting up own telemetry...
2024-03-05T03:35:45.713Z	info	service@v0.95.0/telemetry.go:97	Serving metrics	{"address": ":8888", "level": "Basic"}
2024-03-05T03:35:45.720Z	info	service@v0.95.0/service.go:143	Starting otelcol-contrib...	{"Version": "0.95.0", "NumCPU": 4}
2024-03-05T03:35:45.720Z	info	extensions/extensions.go:34	Starting extensions...
2024-03-05T03:35:45.731Z	warn	zapgrpc/zapgrpc.go:195	[core] [Channel #1 SubChannel #2] grpc: addrConn.createTransport failed to connect to {Addr: "192.168.2.60:11800", ServerName: "192.168.2.60:11800", }. Err: connection error: desc = "transport: Error while dialing: dial tcp 192.168.2.60:11800: connect: connection refused"	{"grpc_log": true}
2024-03-05T03:35:45.743Z	warn	internal@v0.95.0/warning.go:42	Using the 0.0.0.0 address exposes this server to every network interface, which may facilitate Denial of Service attacks. Enable the feature gate to change the default and remove this warning.	{"kind": "receiver", "name": "jmx", "data_type": "metrics", "documentation": "https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/security-best-practices.md#safeguards-against-denial-of-service-attacks", "feature gate ID": "component.UseLocalHostAsDefaultHost"}
2024-03-05T03:35:45.745Z	info	otlpreceiver@v0.95.0/otlp.go:102	Starting GRPC server	{"kind": "receiver", "name": "jmx", "data_type": "metrics", "endpoint": "0.0.0.0:43303"}
2024-03-05T03:35:45.748Z	info	service@v0.95.0/service.go:169	Everything is ready. Begin running and processing data.
2024-03-05T03:35:45.748Z	warn	localhostgate/featuregate.go:63	The default endpoints for all servers in components will change to use localhost instead of 0.0.0.0 in a future version. Use the feature gate to preview the new default.	{"feature gate ID": "component.UseLocalHostAsDefaultHost"}
2024-03-05T03:35:45.751Z	error	subprocess/subprocess.go:242	subprocess died	{"kind": "receiver", "name": "jmx", "data_type": "metrics", "error": "exec: \"java\": executable file not found in $PATH"}

Additional context

No response

@CzyerChen
Copy link
Author

Can I apply a Slack account in OpenTelemetry? I have already have the account and join ASF, but not permitted in OpenTelemetry part.

@CzyerChen
Copy link
Author

I config the otel-collector-config.yaml followed by https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/0bd3c27f442a011ab853986d87f2b8fec040a4a4/receiver/jmxreceiver/README.md#Configuration

receivers:
  jmx:
    jar_path: /usr/local/opentelemetry-jmx-metrics.jar
    endpoint: 192.168.x.x:1616
    target_system: jvm
    collection_interval: 10s
    username: admin
    password: xxx
    resource_attributes:
      host_name: jmx-activemq

Start up failed with error

Error: cannot start pipelines: failed to parse Endpoint "192.168.x.x:1616": parse "192.168.2.60:1616": first path segment in URL cannot contain colon
2024/03/05 03:16:33 collector server run finished with error: cannot start pipelines: failed to parse Endpoint "192.168.x.x:1616": parse "192.168.x.x:1616": first path segment in URL cannot contain colon

Fixed by add // at the front of host:port, that works.

receivers:
  jmx:
    jar_path: /usr/local/opentelemetry-jmx-metrics.jar
    endpoint: //192.168.x.x:1616
    target_system: jvm
    collection_interval: 10s
    username: admin
    password: activemq
    resource_attributes:
      host_name: jmx-activemq

Is that a code bug or a doc enhancement?

@laurit
Copy link
Contributor

laurit commented Mar 6, 2024

You should really be asking these questions from the collector folks in https://github.com/open-telemetry/opentelemetry-collector-contrib/. As far as I know they reject the metrics jar when the has doesn't match what they expect.

Can I apply a Slack account in OpenTelemetry? I have already have the account and join ASF, but not permitted in OpenTelemetry part.

OpenTelemetry channels are in CNCF slack, anybody can join.

@CzyerChen
Copy link
Author

You should really be asking these questions from the collector folks in https://github.com/open-telemetry/opentelemetry-collector-contrib/. As far as I know they reject the metrics jar when the has doesn't match what they expect.

Can I apply a Slack account in OpenTelemetry? I have already have the account and join ASF, but not permitted in OpenTelemetry part.

OpenTelemetry channels are in CNCF slack, anybody can join.

Thanks.

@CzyerChen
Copy link
Author

I made a mistake to check the support jars https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/jmxreceiver/supported_jars.go.
I just check the main -> v0.96.0, not match my test with 0.95.0.
So 1.32.0 matched 0.95.0, that works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants