Skip to content

I can't figure out how to use proto files #554

@red8888

Description

@red8888

I can't figure out if this is an issue with the server "otelcol" or my syntax is wrong. I tried hitting an otelcol server locally and remotely.
telemetrygen works (or at least establishes a grpc connection) so I think my grpcurl syntax is wrong.

Running locally

IMAGE="ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:0.148.0"
docker run \
  -p 127.0.0.1:4317:4317 \
  -p 127.0.0.1:4318:4318 \
  -p 127.0.0.1:55679:55679 \
   $IMAGE

When I run telemetrygen traces --otlp-insecure --traces 3 it connects over GRPC

Trying to hit with grpcurl

PROTOS_REPO=https://github.com/open-telemetry/opentelemetry-proto.git

PROTO_FILES_FOLDER=/tmp/opentelemetry-proto/opentelemetry/proto
EXAMPLES_FOLDER=/tmp/opentelemetry-proto/examples

EX_TRACE=$EXAMPLES_FOLDER/trace.json
EX_METRICS=$EXAMPLES_FOLDER/metrics.json
EX_LOGS=$EXAMPLES_FOLDER/logs.json

TRACE_PROTO_PATH=$PROTO_FILES_FOLDER/trace/v1/trace.proto
METRICS_PROTO_PATH=$PROTO_FILES_FOLDER/metrics/v1/metrics.proto

TRACE_METHOD="opentelemetry.proto.collector.trace.v1.TraceService/Export"
METRICS_METHOD="opentelemetry.proto.collector.metrics.v1.MetricsService/Export"

HOST=localhost:4317
PAYLOAD=$EX_METRICS
PROTO_PATH=$METRICS_PROTO_PATH
METHOD="$METRICS_METHOD"


echo ######### Downloading proto files.... #########
CWD=$(pwd)
cd /tmp
git clone $PROTOS_REPO
cd opentelemetry-proto

echo ######### Sending test data.... #########
cat $PAYLOAD | \
grpcurl \
    --plaintext \
    -d @ \
    -proto $PROTO_PATH \
    -import-path "." \
    -vv \
    $HOST \
    $METHOD

cd $CWD

ERROR

Error invoking method "opentelemetry.proto.collector.metrics.v1.MetricsService/Export": target server does not expose service "opentelemetry.proto.collector.metrics.v1.MetricsService"

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