open-telemetry / opentelemetry-java

OpenTelemetry Java SDK
https://opentelemetry.io
Apache License 2.0
2.01k stars 835 forks source link

Cannot connect to OTEL Collector: ERROR io.opentelemetry.exporter.internal.grpc.OkHttpGrpcExporter - Failed to export metrics. The request could not be executed. Full error message: Required SETTINGS preface not received #5084

Closed makigurapo closed 1 year ago

makigurapo commented 1 year ago

Hi, I'm also having the same issue:

after running the curl command. (ERROR)

image

and this what happens of microservice:

image

and this current value of run-microservice file:

mvn clean package -Dmaven.test.skip=true
AGENT_FILE=opentelemetry-javaagent-all.jar

if [ ! -f "${AGENT_FILE}" ]; then
curl -L https://github.com/aws-observability/aws-otel-java-instrumentation/releases/download/v1.19.2/aws-opentelemetry-agent.jar --output ${AGENT_FILE}
fi

export OTEL_TRACES_EXPORTER=otlp
export OTEL_METRICS_EXPORTER=otlp
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:5555/
export OTEL_RESOURCE_ATTRIBUTES=service.name=hello-app,service.version=1.0

java -javaagent:./${AGENT_FILE} -jar target/hello-app-1.0.jar

and this is the value of collector-config-local.yaml

receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:5555

exporters:
logging:
loglevel: debug

service:
pipelines:
metrics:
receivers: [otlp]
exporters: [logging]
traces:
receivers: [otlp]
exporters: [logging]
jack-berg commented 1 year ago

This is unexpected. What collector build / version are you running?

github-actions[bot] commented 1 year ago

This issue was marked stale due to lack of author feedback. It will be closed in 7 days.

github-actions[bot] commented 1 year ago

Closed as inactive. Feel free to reopen if this issue is still being worked on.

yassenb commented 1 year ago

Having the same issue here with 1.22.1 version of the Java agent, trying to use the OTLP GRPC exporter

jack-berg commented 1 year ago

What version of the collector are you using?

yassenb commented 1 year ago

What version of the collector are you using?

Sorry, I don't really know. I'm trying to set things up with a third party provider - Instana. I doubt their version is very old. What are the supported collector versions?

trask commented 1 year ago

hi @yassenb! can you check with your backend provider if they support OTLP metrics ingestion, and if you are using the correct setup for their OTLP service?

yassenb commented 1 year ago

hi @yassenb! can you check with your backend provider if they support OTLP metrics ingestion, and if you are using the correct setup for their OTLP service?

So I managed to get it working but only by running a collector locally with an OTLP GRPC exporter configured. I couldn't find any documentation on it but circumventing the collector and exporting directly should work just the same right? There seems to be some difference between what the collector OTLP GRPC receiver accepts and what the OTLP GRPC exporter sends which makes the open telemetry collector a mandatory component. I understand the benefits of the collector but for now would like to go without it, what is the proper way to do it?

jack-berg commented 1 year ago

If your vendor accepts OTLP directly they may be doing so without the collector. There may be something wrong (or different than the collector) in their implementation of the OTLP receiver protocol that is causing the problem.