Closed gabrielgiussi closed 1 year ago
Pinging code owners: @rmfitzpatrick. See Adding Labels via Comments if you do not have permissions to add labels yourself.
Is there any other way to export jvm metrics as a workaround until this is fixed (if it is a bug as I think it is)?
I know the agent will export jvm metrics but how to configure it to only do that? Is there a way to export jvm metrics without using the agent and just using the sdk? Of course I could instantiate some observable instruments that could fetch the metrics from the mbeans but perhaps this already exist somewhere and I can just plug it in to the OpenTelemetry I'm configuring manually.
I guess the user 10001 doesn't have write permissions over the /tmp
folder but I'm not familiarized with distroless images to understand how to give write permissions to that user.
Perhaps the solution is to allow this part to be configurable instead of using os.TempDir()
always, and pass a folder that user 10001 can write.
About my last question I found the artifact opentelemetry-runtime-metrics.
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:
See Adding Labels via Comments if you do not have permissions to add labels yourself.
ping @rmfitzpatrick
This is indeed a permission issue. The collector cannot write to disk. You can mount a volume specifically that is writeable, as /tmp
to help alleviate the issue.
I guess this is turning into a request for enhancement to make the temporary folder configurable. Is that correct?
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:
See Adding Labels via Comments if you do not have permissions to add labels yourself.
An other approach is to point to a separate temporary folder for golang by using the TMPDIR environment variable. This will take care of your immediate issue. Closing the issue as resolved, please reopen if you need more help.
@atoulme Could you tell the value to be used for TMPDIR environment variable. Tried multiple values eg: /var/run but still getting permission denied.
Error: cannot start pipelines: failed to get tmp file for jmxreceiver config: open /var/run/jmx-config-3089779787.properties: permission denied 2023/08/18 00:23:25 collector server run finished with error: cannot start pipelines: failed to get tmp file for jmxreceiver config: open /var/run/jmx-config-3089779787.properties: permission denied
@vigneshvdas I missed your question - please open a new issue to discuss further, sorry.
@atoulme Could you tell the value to be used for TMPDIR environment variable. Tried multiple values eg: /var/run but still getting permission denied.
Error: cannot start pipelines: failed to get tmp file for jmxreceiver config: open /var/run/jmx-config-3089779787.properties: permission denied 2023/08/18 00:23:25 collector server run finished with error: cannot start pipelines: failed to get tmp file for jmxreceiver config: open /var/run/jmx-config-3089779787.properties: permission denied
Making the dir volume worked for me -v $(pwd)/tmp/:/tmp/
in 1.32.0
sorry to bump this but i can't figure this out. i keep getting the same permission error
collector:
▎ image: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest
▎ command: ["--config=/etc/otel-collector-config.yml"]
▎ environment:
▎ ▍ TMPDIR: /data/tmp/
▎ volumes:
▎ ▍ - ./otel-collector-config.yml:/etc/otel-collector-config.yml
▎ ▍ - /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem:/etc/ssl/cert.pem:ro
▎ ▍ - ./opentelemetry-jmx-metrics.jar:/opt/opentelemetry-jmx-metrics.jar
▎ ▍ - ./tmp:/data/tmp
▎ extra_hosts:
▎ ▍ - host.docker.internal:host-gateway
fig": {"Endpoint":"localhost:55679","TLSSetting":null,"CORS":null,"Auth":null,"MaxRequestBodySize":0,"IncludeMetadata":false,"ResponseHeaders":null,"CompressionAlgorithms":null,"ReadTimeout":0,"ReadHeaderTimeout":0,"WriteTimeout":0,"IdleTimeout":0}}
monitoring-collector-1 | 2024-09-25T15:26:53.513Z info extensions/extensions.go:59 Extension started. {"kind": "extension", "name": "zpages"}
monitoring-collector-1 | 2024-09-25T15:26:53.513Z info internal/resourcedetection.go:125 began detecting resource information {"kind": "processor", "name": "resourcedetection/system", "pipeline": "metrics"}
monitoring-collector-1 | 2024-09-25T15:26:53.513Z info internal/resourcedetection.go:139 detected resource information {"kind": "processor", "name": "resourcedetection/system", "pipeline": "metrics", "resource": {"host.name":"551f6d561da7","os.type":"linux"}}
monitoring-collector-1 | 2024-09-25T15:26:53.513Z error graph/graph.go:425 Failed to start component {"error": "failed to get tmp file for jmxreceiver config: open /data/tmp/jmx-config-3010133719.properties: permission denied", "type": "Receiver", "id": "jmx"}
monitoring-collector-1 | 2024-09-25T15:26:53.513Z info service@v0.110.0/service.go:270 Starting shutdown...
monitoring-collector-1 | 2024-09-25T15:26:54.745Z info extensions/extensions.go:66 Stopping extensions...
monitoring-collector-1 | 2024-09-25T15:26:54.746Z info zpagesextension@v0.110.0/zpagesextension.go:106 Unregistered zPages span processor on tracer provider {"kind": "extension", "name": "zpages"}
monitoring-collector-1 | 2024-09-25T15:26:54.746Z info service@v0.110.0/service.go:284 Shutdown complete.
monitoring-collector-1 | Error: cannot start pipelines: failed to get tmp file for jmxreceiver config: open /data/tmp/jmx-config-3010133719.properties: permission denied
monitoring-collector-1 | 2024/09/25 15:26:54 collector server run finished with error: cannot start pipelines: failed to get tmp file for jmxreceiver config: open /data/tmp/jmx-config-3010133719.properties: permission denied
monitoring-collector-1 exited with code 1
what should i do??
What happened?
Description
The collector fails trying to start the jmxreceiver because it can't create the
jxm-config-*.properties
file.Steps to Reproduce
You can just apply the yaml configuration in a k8s cluster and the agent container won't start.
Collector version
otel/opentelemetry-collector-contrib:0.61.0 docker image
Environment information
OpenTelemetry Collector configuration
Log output
Additional context
No response