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

Reinstate libp2p reciver-manager metrics #2059

Closed
philwinder opened this issue Feb 24, 2023 · 2 comments · Fixed by #2074
Closed

Reinstate libp2p reciver-manager metrics #2059

philwinder opened this issue Feb 24, 2023 · 2 comments · Fixed by #2074
Assignees
Labels
type/tech-debt Type: Issues meant to address technical debt

Comments

@philwinder
Copy link
Contributor

I had to remove the current metrics from libp2p receiver-manager because they stopped using opencensus and moved to prometheus. But we're using open telemetry and there was no obvious way to convert their prom metrics into our otel metrics (oltp).

This is their change: libp2p/go-libp2p@97af39a#diff-b1c5b5f77c1ee14eae450b69d05cd9f422859da177458a02783ee93ba7f01312L29

This is the code that I commented out: https://github.com/bacalhau-project/bacalhau/blob/main/pkg/libp2p/rcmgr/defaults.go#L50

The task is to reinstate the metrics and double check they appear in the otel outputs again. Note that two bac nodes need to connect to produce these metrics and they are prefixed with rcmgr_.

So to test, you need a monitoring setup (see the PR in the docs) to read the otel stream and you need two bacalhau nodes so they start communicating over libp2p.

@philwinder philwinder added the type/tech-debt Type: Issues meant to address technical debt label Feb 24, 2023
@wjam
Copy link
Contributor

wjam commented Feb 24, 2023

After looking through the OTEL code, it appears that it doesn't support the ability to ingest Prometheus metrics without running the agent and scraping a proper Prometheus endpoint. This appears to be a ticket about enabling receiving Prometheus metrics without running the endpoint but has yet to be implemented - open-telemetry/opentelemetry-collector-contrib#4973

The quickest and simplest solution is to not use the standard libp2p StatsTraceReporter and implement a custom rcmgr.TraceReporter which can talk straight to OTEL.

@wjam wjam self-assigned this Feb 24, 2023
@philwinder
Copy link
Contributor Author

Thanks Will. Asking the question "do we really need these metrics" in slack.

wjam added a commit that referenced this issue Feb 27, 2023
libp2p _used_ to support metrics using OpenCensus, but this was recently
changed to use Prometheus instead - libp2p/go-libp2p#1955.
Unfortunately, it is extremely difficult to get Prometheus metrics
into OpenTelemetry without running the external OTEL agent.

This re-implements the same metrics using OpenTelemetry using the
_new_ Prometheus names rather than the old OpenCensus naming.

Fixes #2059
wjam added a commit that referenced this issue Feb 27, 2023
libp2p _used_ to support metrics using OpenCensus, but this was recently
changed to use Prometheus instead - libp2p/go-libp2p#1955.
Unfortunately, it is extremely difficult to get Prometheus metrics
into OpenTelemetry without running the external OTEL agent.

This re-implements the same metrics using OpenTelemetry using the
_new_ Prometheus names rather than the old OpenCensus naming.

Fixes #2059
wjam added a commit that referenced this issue Feb 27, 2023
libp2p _used_ to support metrics using OpenCensus, but this was recently
changed to use Prometheus instead -
libp2p/go-libp2p#1955. Unfortunately, it is
extremely difficult to get Prometheus metrics into OpenTelemetry without
running the external OTEL agent.

This re-implements the same metrics using OpenTelemetry using the _new_
Prometheus names rather than the old OpenCensus naming.

Fixes #2059
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/tech-debt Type: Issues meant to address technical debt
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants