StefanoBoriero / ebpfRos

ebpf telemetry instrumentation for ROS2 applications
1 stars 0 forks source link

How to visualize observational results? #7

Closed chiaqi closed 2 days ago

chiaqi commented 3 days ago

I am a newcomer to OpenTelemetry. After syncing your repository, I was able to successfully compile and have log output; however, I failed to replicate your visualization. After running the ROS2 demo, I executed sudo -E ./ebpf-ros, and there was normal log output. When I opened the browser and entered http://localhost:4318/v1/metrics, I couldn't open the link. So, could you please tell me how you achieved the visualization of the results? I would be very grateful.

StefanoBoriero commented 3 days ago

OpenTelemetry is a vendor agnostic specification for application instrumentation. You can then send data to any compatible observability tool. You can run locally an OpenTelemetry collector that would accept metrics in the OTLP format and forward them to a tool of choice.

You can kickstart the process running this docker-compose project https://github.com/StefanoBoriero/lgtm-docker/tree/main and running this tool. If you access then localhost:3000 you should have a local Grafana instance with a Mimir datasource configured that would contain the metrics outputted from this tool.

Let me know if you run in any issue trying to do this!

chiaqi commented 2 days ago

Thank you very much for your prompt reply. After using lgtm-docker, I can access the Grafana page through localhost:3000, but there is no data. The "ebpf-ros" outputted the following log: "failed to upload metrics: Post "https://localhost:4318/v1/metrics": http: server gave HTTP response to HTTPS client" I am currently trying to resolve this issue. If you have encountered this problem as well, please offer your suggestions.

StefanoBoriero commented 2 days ago

Interesting, try exporting export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4318". It should be the default according to the documentation https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/#otel_exporter_otlp_endpoint but for some reason it seems like https is used instead of http.

If that doesn't work you can be more specific overriding only the metrics endpoint export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT="http://localhost:4318/v1/metrics".

chiaqi commented 2 days ago

Thank you very much. The problem was resolved after using export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4318".